| 17 | | if ($moddir =~ /$framework/) { |
|---|
| 18 | | |
|---|
| 19 | | # Framework module is special case. We export and pull in all the files of framework that we are going to want to udpate. For now this is |
|---|
| 20 | | # all files under htdocs, agi-bin and bin. We have not included astetc since such files should be done with core modules. We have also |
|---|
| 21 | | # temporarily chosen not to include FOP since it is likely FOP may be handled by a FOP module going forward. Othewise we will add it here. |
|---|
| 22 | | # |
|---|
| 23 | | # TODO: ADD FOP until we can get into a module |
|---|
| 24 | | # |
|---|
| 25 | | if (system("rm -rf $framework/agi-bin $framework/bin $framework/htdocs $framework/htdocs_panel $framework/upgrades $framework/libfreepbx.install.php")) { |
|---|
| 26 | | die "FATAL: failed to remove previoulsly exported directories\n"; |
|---|
| 27 | | } |
|---|
| 28 | | if (system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/amp_conf/agi-bin $framework/agi-bin")) { |
|---|
| 29 | | die "FATAL: failed to export agi-bin directory\n"; |
|---|
| 30 | | } |
|---|
| 31 | | if (system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/amp_conf/bin $framework/bin")) { |
|---|
| 32 | | die "FATAL: failed to export bin directory\n"; |
|---|
| 33 | | } |
|---|
| 34 | | if (system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/amp_conf/htdocs $framework/htdocs")) { |
|---|
| 35 | | die "FATAL: failed to export htdocs directory\n"; |
|---|
| 36 | | } |
|---|
| 37 | | if (system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/amp_conf/htdocs_panel $framework/htdocs_panel")) { |
|---|
| 38 | | die "FATAL: failed to export htdocs_panel directory\n"; |
|---|
| 39 | | } |
|---|
| 40 | | if (system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/upgrades $framework/upgrades")) { |
|---|
| 41 | | die "FATAL: failed to export upgrades directory\n"; |
|---|
| 42 | | } |
|---|
| 43 | | # svn doesn't seem to allow for a single file to be checked out so we need to do a kludgey workaround |
|---|
| 44 | | # this is what we wanted: |
|---|
| 45 | | # |
|---|
| 46 | | # if (system("svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch/libfreepbx.install.php $framework/libfreepbx.install.php")) |
|---|
| 47 | | # |
|---|
| 48 | | if (system("svn co --non-recursive https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/$fwbranch $framework/tmp")) { |
|---|
| 49 | | die "FATAL: failed to checkout branch with libfreepbx.install.php\n"; |
|---|
| 50 | | } |
|---|
| 51 | | # Create the svnversion information for this framework snapshot |
|---|
| 52 | | # |
|---|
| 53 | | if (system("echo SVN VERSION: `svnversion $framework/tmp` > $framework/svnversion.txt")) { |
|---|
| 54 | | die "FATAL: svnversion failed to create svnversion.txt\n"; |
|---|
| 55 | | } |
|---|
| 56 | | |
|---|
| 57 | | if (system("mv $framework/tmp/libfreepbx.install.php $framework/")) { |
|---|
| 58 | | die "FATAL: failed to mv libfreepbx.install.php to $framework\n"; |
|---|
| 59 | | } |
|---|
| 60 | | if (system("rm -rf $framework/tmp")) { |
|---|
| 61 | | die "FATAL: failed to remove $framework/tmp\n"; |
|---|
| 62 | | } |
|---|
| 63 | | |
|---|
| 64 | | # Now we must remove a few files which users may have legitimately edited. For now this is the main.conf.php file which is the current |
|---|
| 65 | | # ARI file used for editing paramters and options. |
|---|
| 66 | | # |
|---|
| 67 | | if (system("rm -rf $framework/htdocs/recordings/includes/main.conf.php")) { |
|---|
| 68 | | die "FATAL: failed to trim main.conf.php ARI file\n"; |
|---|
| 69 | | } |
|---|
| 70 | | |
|---|
| 71 | | # Remove from htdocs root mainstyle.css and index.html as these are owned by root (need to investigate why these are there |
|---|
| 72 | | # and change that. Also some others |
|---|
| 73 | | # |
|---|
| 74 | | # TODO: check if these are stiff there and need to be special cased |
|---|
| 75 | | # |
|---|
| 76 | | if (system("rm -rf $framework/htdocs/mainstyle.css")) { |
|---|
| 77 | | die "FATAL: failed to trim htdocs/mainstyle.css\n"; |
|---|
| 78 | | } |
|---|
| 79 | | if (system("rm -rf $framework/htdocs/index.html")) { |
|---|
| 80 | | die "FATAL: failed to trim htdocs/index.html\n"; |
|---|
| 81 | | } |
|---|
| 82 | | if (system("rm -rf $framework/htdocs/admin/modules/_cache")) { |
|---|
| 83 | | die "FATAL: failed to trim modules/_cache\n"; |
|---|
| 84 | | } |
|---|
| 85 | | } |
|---|
| 86 | | |
|---|
| 103 | | if ($moddir =~ /$framework/) { |
|---|
| 104 | | while ($x = shift @arr) { |
|---|
| 105 | | # Excluding module.xml which gets checked in later.. |
|---|
| 106 | | next if ($x =~ /module.xml/); |
|---|
| 107 | | next if ($x =~ /agi-bin/); |
|---|
| 108 | | next if ($x =~ /bin/); |
|---|
| 109 | | next if ($x =~ /htdocs/); |
|---|
| 110 | | next if ($x =~ /htdocs_panel/); |
|---|
| 111 | | next if ($x =~ /upgrades/); |
|---|
| 112 | | next if ($x =~ /libfreepbx.install.php/); |
|---|
| 113 | | next if ($x =~ /svnversion.txt/); |
|---|
| 114 | | $files .= "$x "; |
|---|
| 115 | | } |
|---|
| 116 | | } else { |
|---|
| 117 | | while ($x = shift @arr) { |
|---|
| 118 | | # Excluding module.xml which gets checked in later.. |
|---|
| 119 | | next if ($x =~ /module.xml/); |
|---|
| 120 | | $files .= "$x "; |
|---|
| 121 | | |
|---|
| 122 | | # Quick and dirty check for php syntax errors at the top level of module directories. Should probably |
|---|
| 123 | | # do this recursively in the future. Also - checks all files now but php -l seems to be ok with that. |
|---|
| 124 | | # |
|---|
| 125 | | if (-f $x && $checkphp) { |
|---|
| 126 | | if (system("php -l $x")) { |
|---|
| 127 | | die "FATAL: php syntax error detected in $x\n"; |
|---|
| 128 | | } |
|---|
| 129 | | } |
|---|
| 130 | | } |
|---|
| | 25 | while ($x = shift @arr) { |
|---|
| | 26 | # Excluding module.xml which gets checked in later.. |
|---|
| | 27 | next if ($x =~ /module.xml/); |
|---|
| | 28 | $files .= "$x "; |
|---|