[aur-dev] [PATCH] 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> --- web/html/pkgsubmit.php | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 6e754bf..44b5070 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -121,14 +121,9 @@ if ($_COOKIE["AURSID"]) { $error = __("Could not change directory to %s.", array(INCOMING_DIR.$pkg_name)); } else { - # try .gz first + # try using general tar. it should take .gz, .bz2, and plain .tar # - exec("/bin/sh -c 'tar xzf ".$upload_file."'", $trash, $retval); - if (!$retval) { - # now try .bz2 format - # - exec("/bin/sh -c 'tar xjf ".$upload_file."'", $trash, $retval); - } + exec("/bin/sh -c 'tar xf ".$upload_file."'", $trash, $retval); if (!$retval) { $error = __("Unknown file format for uploaded file."); } -- 1.5.4.rc3
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> --- Hey-o. The same patch as the earlier one in this thread, except it is based off of cactus/testing, since it looks like that is where the real work is getting done right now. PLEASE make this change. :) -Dan web/html/pkgsubmit.php | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 801348b..ccf66c1 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -47,11 +47,9 @@ if ($_COOKIE["AURSID"]) { $error = __("Could not change directory to %s.", array(UPLOAD_DIR . $tempdir)); } else { - exec("/bin/sh -c 'tar xzf " . $_FILES["pfile"]["tmp_name"] . "'", $trash, $retval); - if ($retval) { - exec("/bin/sh -c 'tar xjf " . $_FILES["pfile"]["tmp_name"] . "'", $trash, $retval); - } - if ($retval) { + # try using general tar. it should take .gz, .bz2, and plain .tar + exec("/bin/sh -c 'tar xf ".$upload_file."'", $trash, $retval); + if (!$retval) { $error = __("Unknown file format for uploaded file."); } } -- 1.5.4.rc3
This one applied... however, I had to copy/paste with a different editor. I think my vim config (convert tabs to spaces) is causing the problem. This is a big failure of using inline and having to copy paste. Remember kids..dont use tabs, they make cactus cry. On 1/13/08, Dan McGee <dan@archlinux.org> wrote:
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> ---
Hey-o. The same patch as the earlier one in this thread, except it is based off of cactus/testing, since it looks like that is where the real work is getting done right now.
PLEASE make this change. :)
-Dan
web/html/pkgsubmit.php | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 801348b..ccf66c1 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -47,11 +47,9 @@ if ($_COOKIE["AURSID"]) { $error = __("Could not change directory to %s.", array(UPLOAD_DIR . $tempdir)); } else { - exec("/bin/sh -c 'tar xzf " . $_FILES["pfile"]["tmp_name"] . "'", $trash, $retval); - if ($retval) { - exec("/bin/sh -c 'tar xjf " . $_FILES["pfile"]["tmp_name"] . "'", $trash, $retval); - } - if ($retval) { + # try using general tar. it should take .gz, .bz2, and plain .tar + exec("/bin/sh -c 'tar xf ".$upload_file."'", $trash, $retval); + if (!$retval) { $error = __("Unknown file format for uploaded file."); } } -- 1.5.4.rc3
On Jan 13, 2008 9:04 PM, eliott <eliott@cactuswax.net> wrote:
This one applied... however, I had to copy/paste with a different editor. I think my vim config (convert tabs to spaces) is causing the problem. This is a big failure of using inline and having to copy paste.
Are you doing copy/pasta from gmail? I always had problems there. Does it do the same when you "view original" and "save as"? For me that always works (after removing the first blank line).
Remember kids..dont use tabs, they make cactus cry. He says, as he top-posts.
another fail of gmail. Top posting is standard. wtf! On 1/13/08, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
Are you doing copy/pasta from gmail? yes
I always had problems there. Does it do the same when you "view original" and "save as"? For me that always works (after removing the first blank line).
I tried save page as, but here is the kicker..i have to edit it to remove the first line. I narrowed it down to my vimrc of all things. I finally got it to work using mousepad (xfce gui text editor) after a save page as. Talk about failhouse. :( This seems like a real failing of the inline patch method. It is very fragile in regard to line breaks and tab interpretation.
Remember kids..dont use tabs, they make cactus cry. He says, as he top-posts.
*shakes fist*
for whatever reason, I cannot apply patches like this. The inline fails every time with hunks not applying. Attached patches (even the exact same ones) work flawlessly. It could be the specific version of git i am using, but that doesn't seem to be the problem. I blame gmail currently. error: patch failed: web/html/pkgsubmit.php:121 error: web/html/pkgsubmit.php: patch does not apply Patch failed at 0001. On 1/13/08, Dan McGee <dan@archlinux.org> wrote:
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> --- web/html/pkgsubmit.php | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 6e754bf..44b5070 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -121,14 +121,9 @@ if ($_COOKIE["AURSID"]) { $error = __("Could not change directory to %s.", array(INCOMING_DIR.$pkg_name)); } else { - # try .gz first + # try using general tar. it should take .gz, .bz2, and plain .tar # - exec("/bin/sh -c 'tar xzf ".$upload_file."'", $trash, $retval); - if (!$retval) { - # now try .bz2 format - # - exec("/bin/sh -c 'tar xjf ".$upload_file."'", $trash, $retval); - } + exec("/bin/sh -c 'tar xf ".$upload_file."'", $trash, $retval); if (!$retval) { $error = __("Unknown file format for uploaded file."); } -- 1.5.4.rc3
participants (3)
-
Aaron Griffin
-
Dan McGee
-
eliott