Changeset 6683
- Timestamp:
- 09/10/08 12:14:35 (5 years ago)
- Files:
-
- modules/branches/2.5/fw_langpacks (copied) (copied from modules/branches/2.5/fw_ari)
- modules/branches/2.5/fw_langpacks/install.php (copied) (copied from modules/branches/2.5/fw_ari/install.php) (3 diffs)
- modules/branches/2.5/fw_langpacks/module.xml (copied) (copied from modules/branches/2.5/fw_ari/module.xml) (1 diff)
- modules/branches/2.5/fw_langpackssvn.pl (copied) (copied from modules/branches/2.5/fw_arisvn.pl) (2 diffs)
- modules/branches/2.5/publish.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.5/fw_langpacks/install.php
r6500 r6683 3 3 // HELPER FUNCTIONS: 4 4 5 function fw_ ari_print_errors($src, $dst, $errors) {6 echo "error copying fw_ arifiles:<br />'cp -rf' from src: '$src' to dst: '$dst'...details follow<br />";5 function fw_langpacks_print_errors($src, $dst, $errors) { 6 echo "error copying fw_langpacks files:<br />'cp -rf' from src: '$src' to dst: '$dst'...details follow<br />"; 7 7 foreach ($errors as $error) { 8 8 echo "$error<br />"; … … 44 44 45 45 global $amp_conf; 46 global $asterisk_conf;47 46 48 47 $debug = false; … … 66 65 67 66 /* 68 * fw_ari install script 67 * fw_langpacks install script 68 * 69 * for each installed component on the target system, copy localization files using the -u option 70 * on copy which will only copy them if our copy is newer then the destination which protects 71 * from overwriting destination files that have been updated by the user. 69 72 */ 73 $htdocs_source = dirname(__FILE__)."/htdocs"; 74 $htdocs_dest = $amp_conf['AMPWEBROOT']; 70 75 71 $htdocs_ari_source = dirname(__FILE__)."/htdocs_ari/*"; 72 $htdocs_ari_dest = $amp_conf['AMPWEBROOT']."/recordings"; 76 // Always copy main FreePBX amp.po/mo files 77 // 78 out(sprintf(_("Preparing to copy %s to %s"),'i18n',"$htdocs_dest/admin")); 79 $htdocs_copy[] = array("source" => "$htdocs_source/admin/i18n", "dest" => "$htdocs_dest/admin"); 73 80 74 exec("cp -rf $htdocs_ari_source $htdocs_ari_dest 2>&1",$out,$ret); 75 if ($ret != 0) { 76 fw_ari_print_errors($htdocs_panel_source, $htdocs_panel_dest, $out); 81 // If ARI is there copy those 82 // 83 if (is_dir("$htdocs_dest/recordings")) { 84 $htdocs_copy[] = array("source" => "$htdocs_source/recordings", "dest" => "$htdocs_dest"); 85 out(sprintf(_("Preparing to copy %s to %s"),'recordings',"$htdocs_dest")); 86 } else { 87 out(sprintf(_("No destination directory %s to copy %s to"),"$htodcs_dest/recordings","recordings")); 77 88 } 78 89 90 // Now for each module we have, make sure the module is in the destination as we don't want to create 91 // empty destinatino folders with just i18n directories. 92 // 93 $dir = opendir($htdocs_source.'/admin/modules'); 94 while ($file = readdir($dir)) { 95 if (is_dir("$htdocs_dest/admin/modules/$file") && ($file != ".") && ($file != "..")) { 96 out(sprintf(_("Preparing to copy %s to %s"),"$file","$htdocs_dest/admin/modules")); 97 $htdocs_copy[] = array("source" => "$htdocs_source/admin/modules/$file", "dest" => "$htdocs_dest/admin/modules"); 98 } else if ($file != "." && $file != "..") { 99 out(sprintf(_("No destination directory %s to copy %s to"),"$htodcs_dest/modules/$file","$file")); 100 } 101 } 102 103 foreach ($htdocs_copy as $translations) { 104 exec("cp -ru ".$translations['source']." ".$translations['dest']." 2>&1",$out,$ret); 105 if ($ret != 0) { 106 fw_langpacks_print_errors($translations['source'], $translations['dest'], $out); 107 } else { 108 out(sprintf(_("Updated %s"),basename($translations['source']))); 109 } 110 } 79 111 ?> modules/branches/2.5/fw_langpacks/module.xml
r6608 r6683 1 1 <module> 2 <rawname>fw_ari</rawname> 3 <name>FreePBX ARI Framework</name> 4 <version>2.5.0.3</version> 5 <candisable>no</candisable> 6 <canuninstall>no</canuninstall> 2 <rawname>fw_langpacks</rawname> 3 <name>FreePBX Localization Updates</name> 4 <version>2.5.0</version> 7 5 <changelog> 8 *2.5.0.3* #3165, #3077, #2609 and additional fixes related to #3161 9 *2.5.0.2* r6505, #3161 SQL Injection vulnerability that could allow and authenticated user to access all CDRs and recordings 10 *2.5.0.1* remove inclusion of libfreepbx.install.php in install script resulting in warnings 11 *2.5.0* #3104 and First release of fw_ari 6 *2.5.0* First release 12 7 </changelog> 13 8 <description> 14 This module provides a facility to install bug fixes to the ARI code that is not otherwise housed in a module, it used to be part of framework but has been removed to isolate ARI from Framework updates.9 This module provides a facility to install new and updated localization translations for all componets in FreePBX. Localization i18n translations are still kept with each module and other components such as the User Portal (ARI). This provides an easy ability to bring all components up-to-date without the need of publishing dozens of modules for every minor change. The localization updates used will be the latest available for all modules and will not consider the curent version you are running. 15 10 </description> 16 11 <type>setup</type> 17 12 <category>Basic</category> 18 <location>release/2.5/fw_ ari-2.5.0.3.tgz</location>19 <md5sum> d345aeed410ba8180dc7b877412b8d03</md5sum>13 <location>release/2.5/fw_langpacks-2.5.0.tgz</location> 14 <md5sum>4d31935ef78a53c3b70bb8ce32f0c8cd</md5sum> 20 15 </module> modules/branches/2.5/fw_langpackssvn.pl
r6498 r6683 2 2 3 3 # This script (sculpted from publish.pl) will check the last tarball (which must be there) 4 # based on the fw_ arixml version number and then run svn log against all updates since5 # fw_ ariwas last published.4 # based on the fw_langpacks xml version number and then run svn log against all updates since 5 # fw_langpacks was last published. 6 6 # 7 7 $rver = "2.5"; 8 $fw_ ari = "fw_ari";8 $fw_langpacks = "fw_langpacks"; 9 9 10 $moddir = 'fw_ ari';10 $moddir = 'fw_langpacks'; 11 11 12 12 my $reldir = "release/"; … … 25 25 26 26 # Now we know the version. Get the svnversion.txt from the last update. 27 $filename = "../../$reldir"."$rver/$fw_ ari-$vers.tgz";27 $filename = "../../$reldir"."$rver/$fw_langpacks-$vers.tgz"; 28 28 print "CHECKING VERSION: ..... "; 29 29 #print "CHECKING VERSION WITH: tar -zxOf $filename $moddir/svnversion.txt: ... "; 30 30 system("tar -zxOf ".$filename." ".$moddir."/svnversion.txt"); 31 print "Geting svn log since that version for $rver : .... \n\n"; 32 $svnver = system("svn log http://svn.freepbx.org/freepbx/branches/$rver/amp_conf/htdocs/recordings -r `tar -zxOf ".$filename." ".$moddir."/svnversion.txt | sed -e s/SVN\\\ VERSION://`:HEAD"); 31 print "Geting svn log of language updates since that version for $rver : .... \n\n"; 32 system("svn log http://svn.freepbx.org/freepbx/branches/$rver/amp_conf/htdocs/recordings/locale -v -r `tar -zxOf ".$filename." ".$moddir."/svnversion.txt | sed -e s/SVN\\\ VERSION://`:HEAD | grep 'htdocs/recordings/locale'"); 33 system("svn log http://svn.freepbx.org/freepbx/branches/$rver/amp_conf/htdocs/admin -v -r `tar -zxOf ".$filename." ".$moddir."/svnversion.txt | sed -e s/SVN\\\ VERSION://`:HEAD | grep 'i18n/' | grep 'htdocs/admin'"); 34 system("svn log http://svn.freepbx.org/modules/branches/$rver -v -r `tar -zxOf ".$filename." ".$moddir."/svnversion.txt | sed -e s/SVN\\\ VERSION://`:HEAD | grep 'i18n/' | grep 'modules/branches'"); 33 35 36 37 # Test calls 38 # system("svn log http://svn.freepbx.org/freepbx/branches/$rver/amp_conf/htdocs/recordings/locale -v -r 4000:HEAD | grep 'htdocs/recordings/locale'"); 39 # system("svn log http://svn.freepbx.org/freepbx/branches/$rver/amp_conf/htdocs/admin -v -r 4000:HEAD | grep 'i18n/' | grep 'htdocs/admin'"); 40 # system("svn log http://svn.freepbx.org/modules/branches/$rver -v -r 4000:HEAD | grep 'i18n/' | grep 'modules/branches'"); modules/branches/2.5/publish.pl
r6498 r6683 12 12 $fw_fop = "fw_fop"; 13 13 $fw_ari = "fw_ari"; 14 $fw_langpacks = "fw_langpacks"; 14 15 15 16 my $reldir = "release/"; … … 120 121 if (system("rm -rf $fw_ari/htdocs_ari/includes/main.conf.php")) { 121 122 die "FATAL: failed to trim main.conf.php ARI file\n"; 123 } 124 125 } 126 if ($moddir =~ /$fw_langpacks/) { 127 128 my $module_url="http://svn.freepbx.org/modules/branches/$rver"; 129 my $base_url="http://svn.freepbx.org/freepbx/$fwbranch/amp_conf/htdocs"; 130 my $framework_url="$base_url/admin"; 131 my $recordings_url="$base_url/recordings"; 132 133 @modules=`svn list $module_url | grep '/'`; 134 135 if (system("rm -rf $fw_langpacks/htdocs")) { 136 die "FATAL: failed to remove old htdocs dir\n"; 137 } 138 if (system("mkdir -p $fw_langpacks/htdocs/admin/modules")) { 139 die "FATAL: failed to create htdocs/admin/modules\n"; 140 } 141 if (system("mkdir -p $fw_langpacks/htdocs/recordings")) { 142 die "FATAL: failed to create htdocs/recordings\n"; 143 } 144 145 if (system("svn export $framework_url/i18n $fw_langpacks/htdocs/admin/i18n")) { 146 die "FATAL: failed to export $framework_url/i18n\n"; 147 } 148 if (system("svn export $recordings_url/locale $fw_langpacks/htdocs/recordings/locale")) { 149 die "FATAL: failed to export $recurdings_url/locale\n"; 150 } 151 foreach my $module ( @modules ) { 152 chomp($module); 153 if (system("rm -rf $fw_langpacks/i18n")) { 154 die "FATAL: failed to remove temp i18n dir\n"; 155 } 156 if (!system("svn export $module_url/$module"."i18n $fw_langpacks/i18n 2> /dev/null")) { 157 if (system("mkdir $fw_langpacks/htdocs/admin/modules/$module")) { 158 die "FATAL: failed to create htdocs/admin/modules/$module\n"; 159 } 160 if (system("mv $fw_langpacks/i18n $fw_langpacks/htdocs/admin/modules/$module")) { 161 die "FATAL: failed to move i18n to htdocs/admin/modules/$module\n"; 162 } 163 } else { 164 print "No i18n files for $module"."\n"; 165 } 166 } 167 168 169 # Create the svnversion information for this framework snapshot 170 # 171 if (system("echo SVN VERSION: `svn log -q -r HEAD http://svn.freepbx.org/ | cut -s -f 1 -d ' ' | cut -b '2-'` > $fw_langpacks/svnversion.txt")) { 172 die "FATAL: svnversion failed to create svnversion.txt\n"; 122 173 } 123 174 … … 161 212 next if ($x =~ /module.xml/); 162 213 next if ($x =~ /htdocs_ari/); 214 next if ($x =~ /svnversion.txt/); 215 $files .= "$x "; 216 } elsif ($moddir =~ /$fw_langpacks/) { 217 next if ($x =~ /module.xml/); 218 next if ($x =~ /htdocs/); 163 219 next if ($x =~ /svnversion.txt/); 164 220 $files .= "$x ";
