31 clean-tars.php [-h] -i <input-path>
33 Clean cruft out of fedora packages. The following is cleaned:
34 make.out - the make prep output
36 compressed archives - all .tgz, .gz, bzip2, bz2, zip files
38 Dead packages and packages with no .spec file are skipped.
41 -h standard help,
usage message.
42 -i input-path path where sources/packages will be cleaned
46 $options = getopt(
"hi:");
53 if (array_key_exists(
"h",$options))
58 if (array_key_exists(
"i",$options))
60 $in_path = $options[
'i'];
68 chdir($in_path) or die("Can't chdir to $in_path: $php_errormsg\n");
70 $toss = exec('ls', $list, $rtn);
72 echo
"ERROR, ls of $in_path did not return zero: $rtn\n";
77 echo
"Starting at: $date";
80 foreach($list as $pkg)
82 echo
"Package is:$pkg\n";
84 print
"ERROR: Can't chdir to $pkg, skipping: $php_errormsg\n";
88 $toss = exec(
'ls -a', $plist, $rtn);
91 echo
"ERROR, ls of $pkg did not return zero: $rtn\n";
102 foreach($plist as $file)
105 if (preg_match(
'/dead\.package/i', $file))
107 print
"$pkg is a dead.package, skipping\n";
111 if (!(preg_match(
'/.*\.spec/i', $alist)))
113 echo
"$pkg has no spec file, skipping\n";
118 if(preg_match(
'/.*?gz$/i', $file, $match))
120 echo
"Executing set -o noclobber; rm -rf $match[0]\n";
121 $toss = system(
"set -o noclobber; rm -rf $match[0]", $rtn);
123 echo
"ERROR, remove of {$match[0]} did not return zero: $rtn\n";
126 if(preg_match(
'/.*?bz2$/i', $file, $match))
128 echo
"Executing set -o noclobber; rm -rf $match[0]\n";
129 $toss = system(
"set -o noclobber; rm -rf $match[0]", $rtn);
132 echo
"ERROR, remove of {$match[0]} did not return zero: $rtn\n";
135 if(preg_match(
'/.*?Bzip2$/i', $file, $match))
137 echo
"Executing set -o noclobber; rm -rf $match[0]\n";
138 $toss = system(
"set -o noclobber; rm -rf $match[0]", $rtn);
140 echo
"ERROR, remove of {$match[0]} did not return zero: $rtn\n";
143 if(preg_match(
'/.*?zip$/i', $file, $match))
145 echo
"Executing set -o noclobber; rm -rf $match[0]\n";
146 $toss = system(
"set -o noclobber; rm -rf $match[0]", $rtn);
148 echo
"ERROR, remove of {$match[0]} did not return zero: $rtn\n";
151 if(preg_match(
'/\.cvsignore$/i', $file, $match))
153 echo
"Executing set -o noclobber; rm -rf $match[0]\n";
154 $toss = system(
"set -o noclobber; rm -rf $match[0]", $rtn);
156 echo
"ERROR, remove of {$match[0]} did not return zero: $rtn\n";
159 if(preg_match(
'/make\.out$/i', $file, $match))
161 echo
"Executing set -o noclobber; rm -rf $match[0]\n";
162 $toss = system(
"set -o noclobber; rm -rf $match[0]", $rtn);
164 echo
"ERROR, remove of {$match[0]} did not return zero: $rtn\n";
168 chdir(
'..') or die("Can't chdir to ..: $php_errormsg\n");
172 print "Ending at: $date";
if(!preg_match("/\s$projectGroup\s/", $groups)&&(posix_getgid()!=$gInfo['gid']))
get monk license list of one specified uploadtree_id
FUNCTION void usage(char *name)