[arch-dev-public] [PATCH] Allow repo name to be specified on command line
From: Dan McGee <dan@archlinux.org> Move the extrapkg script to the name repopkg. All of the corepkg/extrapkg etc. scripts will retain their same behavior; however if the program is called with the name repopkg the first parameter passed will be used as the repository name to upload to. Note that the non-existence of this directory on the remote end will probably result in failure. Signed-off-by: Dan McGee <dan@archlinux.org> --- Makefile | 14 ++++++++------ extrapkg => repopkg | 7 +++++-- 2 files changed, 13 insertions(+), 8 deletions(-) rename extrapkg => repopkg (96%) diff --git a/Makefile b/Makefile index 384e7e0..75c83c9 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,14 @@ all: install: - # extrapkg/checkpkg and friends + # repopkg/checkpkg and friends mkdir -p $(DESTDIR)/usr/bin install -m 755 checkpkg $(DESTDIR)/usr/bin - install -m 755 extrapkg $(DESTDIR)/usr/bin - ln -sf extrapkg $(DESTDIR)/usr/bin/corepkg - ln -sf extrapkg $(DESTDIR)/usr/bin/testingpkg - ln -sf extrapkg $(DESTDIR)/usr/bin/unstablepkg + install -m 755 repopkg $(DESTDIR)/usr/bin + ln -sf repopkg $(DESTDIR)/usr/bin/corepkg + ln -sf repopkg $(DESTDIR)/usr/bin/extrapkg + ln -sf repopkg $(DESTDIR)/usr/bin/testingpkg + ln -sf repopkg $(DESTDIR)/usr/bin/unstablepkg # arch{co,release,rm} install -m 755 archco $(DESTDIR)/usr/bin install -m 755 archrelease $(DESTDIR)/usr/bin @@ -23,8 +24,9 @@ install: uninstall: # remove all files we installed rm $(DESTDIR)/usr/bin/checkpkg - rm $(DESTDIR)/usr/bin/extrapkg + rm $(DESTDIR)/usr/bin/repopkg rm $(DESTDIR)/usr/bin/corepkg + rm $(DESTDIR)/usr/bin/extrapkg rm $(DESTDIR)/usr/bin/testingpkg rm $(DESTDIR)/usr/bin/unstablepkg rm $(DESTDIR)/usr/sbin/mkarchroot diff --git a/extrapkg b/repopkg similarity index 96% rename from extrapkg rename to repopkg index fa72c53..04b6451 100755 --- a/extrapkg +++ b/repopkg @@ -13,7 +13,7 @@ if [ -r ~/.makepkg.conf ]; then source ~/.makepkg.conf fi -cmd=`basename $0` +cmd=$(basename $0) if [ ! -f PKGBUILD ]; then echo "No PKGBUILD file" @@ -38,7 +38,10 @@ if [ ! -f $pkgfile ]; then fi fi -if [ "$cmd" == "extrapkg" ]; then +if [ "$cmd" == "repopkg" ]; then + repo="$1" + shift +elif [ "$cmd" == "extrapkg" ]; then repo="extra" elif [ "$cmd" == "corepkg" ]; then repo="core" -- 1.5.5.3
On Fri, May 30, 2008 at 6:44 PM, <dpmcgee@gmail.com> wrote:
From: Dan McGee <dan@archlinux.org>
Move the extrapkg script to the name repopkg. All of the corepkg/extrapkg etc. scripts will retain their same behavior; however if the program is called with the name repopkg the first parameter passed will be used as the repository name to upload to.
Note that the non-existence of this directory on the remote end will probably result in failure.
Signed-off-by: Dan McGee <dan@archlinux.org>
Would you mind doing a: if name == repopkg: if $# -ne 1: omg abort! yell yell yell
On Fri, May 30, 2008 at 7:25 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On Fri, May 30, 2008 at 6:44 PM, <dpmcgee@gmail.com> wrote:
From: Dan McGee <dan@archlinux.org>
Move the extrapkg script to the name repopkg. All of the corepkg/extrapkg etc. scripts will retain their same behavior; however if the program is called with the name repopkg the first parameter passed will be used as the repository name to upload to.
Note that the non-existence of this directory on the remote end will probably result in failure.
Signed-off-by: Dan McGee <dan@archlinux.org>
Would you mind doing a: if name == repopkg: if $# -ne 1: omg abort! yell yell yell
I thought of this, but there are bigger problems. 1. scp options are there. You could end up trying to repopkg yourself into the -l repo 2. Uploading with a commit message: fix the download URL would send your upgrades to the 'fix' repository. So [ $# -ne 1 ] wouldn't really do the full verification job at all. -Dan
On Fri, May 30, 2008 at 7:31 PM, Dan McGee <dpmcgee@gmail.com> wrote:
On Fri, May 30, 2008 at 7:25 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On Fri, May 30, 2008 at 6:44 PM, <dpmcgee@gmail.com> wrote:
From: Dan McGee <dan@archlinux.org>
Move the extrapkg script to the name repopkg. All of the corepkg/extrapkg etc. scripts will retain their same behavior; however if the program is called with the name repopkg the first parameter passed will be used as the repository name to upload to.
Note that the non-existence of this directory on the remote end will probably result in failure.
Signed-off-by: Dan McGee <dan@archlinux.org>
Would you mind doing a: if name == repopkg: if $# -ne 1: omg abort! yell yell yell
I thought of this, but there are bigger problems. 1. scp options are there. You could end up trying to repopkg yourself into the -l repo 2. Uploading with a commit message: fix the download URL would send your upgrades to the 'fix' repository.
So [ $# -ne 1 ] wouldn't really do the full verification job at all.
oi vey! why can't scripts write themselves? when do we get robots to do this for us?
participants (3)
-
Aaron Griffin
-
Dan McGee
-
dpmcgee@gmail.com