[arch-projects] [abs] [PATCH] Add -r/--root option to set ABSROOT

Mark Blakeney mark.blakeney at bullet-systems.net
Fri Jul 17 07:13:53 UTC 2015


As per discussion at https://bugs.archlinux.org/task/41186 here is a patch
adding a -r and --root option to abs so a user can specify an alternate
ABSROOT,
e.g. a user can type:

abs -r. core/linux

instead of the cumbersome looking:

ABSROOT=. abs core/linux

I will update this in the wiki at
https://wiki.archlinux.org/index.php/Kernels/Compilation/Arch_Build_System
if this patch gets accepted.

--- a/abs 2014-07-01 00:26:01.047766500 +0800
+++ b/abs 2015-07-11 09:15:38.410677329 +0800
@@ -69,6 +69,8 @@
 ##
 [ -f ~/.abs.conf ] && source ~/.abs.conf

+ABSROOT_DEFAULT="$ABSROOT"
+
 ##
 # Helper functions
 ##
@@ -79,13 +81,15 @@
  echo "$0 [options] [repository1[/package1] [repository2[/package2] ...]]"
  echo
  echo "Options:"
- echo "  -h, --help     Display this help message then exit."
- echo "  -V, --version  Display version information then exit."
- echo "  -t, --tarball  Sync ABS tree using tarballs from your pacman
mirror."
+ echo "  -h, --help       Display this help message then exit."
+ echo "  -V, --version    Display version information then exit."
+ echo "  -t, --tarball    Sync ABS tree using tarballs from pacman mirror."
+ echo "  -r, --root <dir> Sync to specified dir rather than
$ABSROOT_DEFAULT."
  echo
  echo "abs will synchronize PKGBUILD scripts from the Arch Linux
repositories"
- echo "into $ABSROOT via rsync. If no argument is given, abs will
synchronize"
- echo "the repositories specified in ${CONFDIR}abs.conf."
+ echo "into $ABSROOT_DEFAULT (or where you specify -r/--root) via rsync."
+ echo "If no argument is given, abs will synchronize the repositories"
+ echo "specified in ${CONFDIR}abs.conf."
  echo
  echo "Report bugs to $BUG_REPORT_EMAIL with [ABS] in the subject"
 }
@@ -218,8 +222,8 @@
 ##
 # Parse Options
 ##
-OPT_SHORT="hVt"
-OPT_LONG="help,version,tarball"
+OPT_SHORT="hVtr:"
+OPT_LONG="help,version,tarball,root:"
 OPT_TEMP="$(getopt -o "$OPT_SHORT" -l "$OPT_LONG" -n "$(basename "$0")" --
"$@" || echo 'GETOPT GO BANG!')"
 if echo "$OPT_TEMP" | grep -q 'GETOPT GO BANG!'; then
  # This is a small hack to stop the script bailing with 'set -e'
@@ -233,6 +237,7 @@
  -h|--help)     usage; exit $_E_OK;;
  -V|--version)  version; exit $_E_OK;;
  -t|--tarball)  TARBALL=1;;
+ -r|--root)     ABSROOT="$2"; shift;;

  --)            OPT_IND=0; shift; break;;
  *)             usage; exit $_E_INVALID_OPTION;;
--
bulletmark.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.archlinux.org/pipermail/arch-projects/attachments/20150717/ac1b1926/attachment.html>


More information about the arch-projects mailing list