From f6b0869ee56d6048c954bc2a6df496b8e452ac6a Mon Sep 17 00:00:00 2001 From: Andrew Fyfe Date: Wed, 11 Apr 2007 22:02:56 +0100 Subject: [PATCH] autotool scripts/repo-add - move scripts/repo-add -> scripts/repo-add.in - add -V --version options to scripts/repo-add.in - add autotool commands to generate scripts/repo-add Signed-off-by: Andrew Fyfe --- configure.ac | 1 + scripts/Makefile.am | 2 +- scripts/{repo-add => repo-add.in} | 17 ++++++++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) rename scripts/{repo-add => repo-add.in} (95%) diff --git a/configure.ac b/configure.ac index bc36ce16..b31bc671 100644 --- a/configure.ac +++ b/configure.ac @@ -222,6 +222,7 @@ scripts/gensync scripts/makepkg scripts/makeworld scripts/pacman-optimize +scripts/repo-add doc/Makefile etc/Makefile etc/makepkg.conf diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 98621e60..e131b865 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -19,7 +19,7 @@ EXTRA_DIST = abs.in \ makeworld.in \ pacman-optimize.in \ rankmirrors \ - repo-add \ + repo-add.in \ repo-remove \ updatesync diff --git a/scripts/repo-add b/scripts/repo-add.in similarity index 95% rename from scripts/repo-add rename to scripts/repo-add.in index cf58585c..f8c71557 100755 --- a/scripts/repo-add +++ b/scripts/repo-add.in @@ -19,7 +19,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. -myver='3.0.0' +myver='@PACKAGE_VERSION@' FORCE=0 REPO_DB_FILE="" @@ -43,6 +43,15 @@ usage() { echo } +version() { + printf "repo-add (pacman) %s\n" "$myver" + printf "Copyright (C) 2006 Aaron Griffin .\n" + echo + printf "This is free software; see the source for copying conditions.\n" + printf "There is NO WARRANTY, to the extent permitted by law.\n" + echo +} + # return calculated checksum of package # arg1 - checksum type # arg2 - path to package @@ -215,6 +224,12 @@ if [ "$1" = "-h" -o "$1" = "--help" ]; then exit 0 fi +# check for version flags +if [ "$1" = "-V" -o "$1" = "--version" ]; then + version + exit 0 +fi + # check for correct number of args if [ $# -lt 2 ]; then usage