mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Support for uploading plain PKGBUILDs
Adds support for uploading plain PKGBUILDs to the AUR Simply moves the PKGBUILD to a directory to be treated the same as if it were in a tarball Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
This commit is contained in:
parent
435e2c6c1a
commit
4ac945a87e
1 changed files with 9 additions and 5 deletions
|
@ -37,11 +37,15 @@ 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 {
|
||||||
# try using general tar. it should take .gz, .bz2, and plain .tar
|
if ($_FILES['pfile']['name'] == "PKGBUILD") {
|
||||||
exec("/bin/sh -c 'tar xf ".$_FILES['pfile']['tmp_name']."'", $trash, $retval);
|
move_uploaded_file($_FILES['pfile']['tmp_name'], UPLOAD_DIR . $tempdir . "/PKGBUILD");
|
||||||
if ($retval) {
|
} else {
|
||||||
$error = __("Unknown file format for uploaded file.");
|
# try using general tar. it should take .gz, .bz2, and plain .tar
|
||||||
}
|
exec("/bin/sh -c 'tar xf ".$_FILES['pfile']['tmp_name']."'", $trash, $retval);
|
||||||
|
if ($retval) {
|
||||||
|
$error = __("Unknown file format for uploaded file.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue