--- /usr/bin/makepkg.ori 2010-03-16 16:37:47 +0100 +++ /usr/bin/makepkg 2010-03-16 16:39:52 +0100 @@ -66,6 +66,7 @@ RMDEPS=0 REPKG=0 LOGGING=0 +QUESTION=0 SOURCEONLY=0 IGNOREARCH=0 HOLDVER=0 @@ -1421,6 +1422,7 @@ echo "$(gettext " -m, --nocolor Disable colorized output messages")" echo "$(gettext " -o, --nobuild Download and extract files only")" printf "$(gettext " -p Use an alternate build script (instead of '%s')")\n" "$BUILDSCRIPT" + echo "$(gettext " -q, --question Just return zero if pacakge is already built, nonzero otherwise")" echo "$(gettext " -r, --rmdeps Remove installed dependencies after a successful build")" # fix flyspray feature request #2978 echo "$(gettext " -R, --repackage Repackage contents of the package without rebuilding")" @@ -1460,11 +1462,11 @@ ARGLIST=("$@") # Parse Command Line Options. -OPT_SHORT="AcCdefFghiLmop:rRsV" -OPT_LONG="allsource,asroot,ignorearch,clean,cleancache,nodeps" -OPT_LONG="$OPT_LONG,noextract,force,forcever:,geninteg,help,holdver" -OPT_LONG="$OPT_LONG,install,log,nocolor,nobuild,rmdeps,repackage,skipinteg" -OPT_LONG="$OPT_LONG,source,syncdeps,version,config:" +OPT_SHORT="AcCdefFghiLmop:qrRsV" +OPT_LONG="allsource,asroot,ignorearch,clean,cleancache,config:,force" +OPT_LONG="$OPT_LONG,force,forcever:,geninteg,help,holdver,install,log" +OPT_LONG="$OPT_LONG,nodeps,noextract,nocolor,nobuild,question,rmdeps" +OPT_LONG="$OPT_LONG,repackage,skipinteg,source,syncdeps,version" # Pacman Options OPT_LONG="$OPT_LONG,noconfirm,noprogressbar" OPT_TEMP="$(parse_options $OPT_SHORT $OPT_LONG "$@" || echo 'PARSE_OPTIONS FAILED')" @@ -1501,6 +1503,7 @@ -m|--nocolor) USE_COLOR='n' ;; -o|--nobuild) NOBUILD=1 ;; -p) shift; BUILDFILE=$1 ;; + -q|--question) QUESTION=1 ;; -r|--rmdeps) RMDEPS=1 ;; -R|--repackage) REPKG=1 ;; --skipinteg) SKIPINTEG=1 ;; @@ -1686,6 +1689,9 @@ if [ "$SPLITPKG" -eq 0 ]; then if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \ -a "$FORCE" -eq 0 -a "$SOURCEONLY" -eq 0 -a "$NOBUILD" -eq 0 ]; then + if [ "$QUESTION" -eq 1 ]; then + exit 0 + fi if [ "$INSTALL" -eq 1 ]; then warning "$(gettext "A package has already been built, installing existing package...")" install_package @@ -1707,6 +1713,9 @@ done if [ "$FORCE" -eq 0 -a "$SOURCEONLY" -eq 0 -a "$NOBUILD" -eq 0 ]; then if [ "$allpkgbuilt" -eq 1 ]; then + if [ "$QUESTION" -eq 1 ]; then + exit 0 + fi if [ "$INSTALL" -eq 1 ]; then warning "$(gettext "The package group has already been built, installing existing packages...")" install_package @@ -1724,6 +1733,10 @@ unset allpkgbuilt somepkgbuilt fi +if [ "$QUESTION" -eq 1 ]; then + exit 1 +fi + # Run the bare minimum in fakeroot if [ "$INFAKEROOT" -eq 1 ]; then if [ "$SPLITPKG" -eq 0 ]; then