From 53bdccad688b40cac7a948c6a54d2283b4ff42ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mantas=20Mikul=C4=97nas?= Date: Fri, 3 Feb 2012 15:18:14 +0200 Subject: [PATCH 2/2] makepkg: add --asdeps option --- doc/makepkg.8.txt | 4 ++++ scripts/makepkg.sh.in | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletions(-) diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt index df41e18..dbfaa98 100644 --- a/doc/makepkg.8.txt +++ b/doc/makepkg.8.txt @@ -35,6 +35,10 @@ your logs and output are not localized. Options ------- +*\--asdeps*:: + When installing the package after build, mark it as a dependency (equivalent + to the linkman:pacman[8] option "\--asdeps"). + *\--asroot*:: Allow makepkg to run as root. This is for security purposes as it is normally dangerous to do so. This will also disable use of fakeroot and diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index b88994b..d96bde8 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -59,6 +59,7 @@ GENINTEG=0 SKIPCHECKSUMS=0 SKIPPGPCHECK=0 INSTALL=0 +INSTALLASDEPS=0 NOBUILD=0 NODEPS=0 NOEXTRACT=0 @@ -1427,6 +1428,8 @@ install_package() { fi done + (( INSTALLASDEPS )) && pkglist+=" --asdeps" + if ! run_pacman -U $pkglist; then warning "$(gettext "Failed to install built package(s).")" return 0 @@ -1856,6 +1859,7 @@ usage() { printf -- "$(gettext " -s, --syncdeps Install missing dependencies with %s")\n" "pacman" printf -- "$(gettext " -S, --source Generate a source-only tarball without downloaded sources")\n" printf -- "$(gettext " --allsource Generate a source-only tarball including downloaded sources")\n" + printf -- "$(gettext " --asdeps Mark package as a dependency when installing")\n" printf -- "$(gettext " --asroot Allow %s to run as root user")\n" "makepkg" printf -- "$(gettext " --check Run the %s function in the %s")\n" "check()" "$BUILDSCRIPT" printf -- "$(gettext " --config Use an alternate config file (instead of '%s')")\n" "$confdir/makepkg.conf" @@ -1900,7 +1904,7 @@ ARGLIST=("$@") # Parse Command Line Options. OPT_SHORT="AcdefFghiLmop:rRsSV" -OPT_LONG="allsource,asroot,ignorearch,check,clean,nodeps" +OPT_LONG="allsource,asdeps,asroot,ignorearch,check,clean,nodeps" OPT_LONG+=",noextract,force,forcever:,geninteg,help,holdver,skippgpcheck" OPT_LONG+=",install,key:,log,nocolor,nobuild,nocheck,nosign,pkg:,rmdeps" OPT_LONG+=",repackage,skipchecksums,skipinteg,skippgpcheck,sign,source,syncdeps" @@ -1922,6 +1926,7 @@ while true; do # Makepkg Options --allsource) SOURCEONLY=2 ;; + --asdeps) INSTALLASDEPS=1 ;; --asroot) ASROOT=1 ;; -A|--ignorearch) IGNOREARCH=1 ;; -c|--clean) CLEANUP=1 ;; -- 1.7.9