Allow pkgsubmit to accept any tar* file

Instead of restricting to gz and bz2, allow just plain tar and any other
format tar can understand to be uploaded. I make the mistake all the time of
forgetting to pass -z to tar when making something to upload, and there is
no real reason to exclude plain tar files.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2008-01-13 20:52:44 -06:00
parent 379e16eebd
commit 0eb2997a82

View file

@ -47,11 +47,9 @@ if ($_COOKIE["AURSID"]) {
$error = __("Could not change directory to %s.", $error = __("Could not change directory to %s.",
array(UPLOAD_DIR . $tempdir)); array(UPLOAD_DIR . $tempdir));
} else { } else {
exec("/bin/sh -c 'tar xzf " . $_FILES["pfile"]["tmp_name"] . "'", $trash, $retval); # try using general tar. it should take .gz, .bz2, and plain .tar
if ($retval) { exec("/bin/sh -c 'tar xf ".$upload_file."'", $trash, $retval);
exec("/bin/sh -c 'tar xjf " . $_FILES["pfile"]["tmp_name"] . "'", $trash, $retval); if (!$retval) {
}
if ($retval) {
$error = __("Unknown file format for uploaded file."); $error = __("Unknown file format for uploaded file.");
} }
} }