summaryrefslogtreecommitdiffstats
path: root/web/html/pkgsubmit.php
diff options
context:
space:
mode:
authorCallan Barrett <wizzomafizzo@gmail.com>2008-06-03 22:34:03 +0200
committerCallan Barrett <wizzomafizzo@gmail.com>2008-06-07 11:52:07 +0200
commit4ac945a87e5c7e71831377bc95563aa53e7f1eaa (patch)
tree85a6d90d7c2c0de0cd80552ba78b23bad88e8e0c /web/html/pkgsubmit.php
parent435e2c6c1aa2bc37c5c06fa3dbdd81088cc524fa (diff)
downloadaur-4ac945a87e5c7e71831377bc95563aa53e7f1eaa.tar.gz
aur-4ac945a87e5c7e71831377bc95563aa53e7f1eaa.tar.xz
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>
Diffstat (limited to 'web/html/pkgsubmit.php')
-rw-r--r--web/html/pkgsubmit.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index d7026b75..1e5a1343 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -37,11 +37,15 @@ if ($_COOKIE["AURSID"]) {
$error = __("Could not change directory to %s.",
array(UPLOAD_DIR . $tempdir));
} else {
- # 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.");
- }
+ if ($_FILES['pfile']['name'] == "PKGBUILD") {
+ move_uploaded_file($_FILES['pfile']['tmp_name'], UPLOAD_DIR . $tempdir . "/PKGBUILD");
+ } else {
+ # 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.");
+ }
+ }
}
}
}