Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=16c1d00a44cf8ac3f979d5b4f6c4a8a2780e3547

commit 16c1d00a44cf8ac3f979d5b4f6c4a8a2780e3547
Author: Michel Hermier <[email protected]>
Date:   Fri Nov 23 13:01:31 2012 +0100

scripts/makepkg

* Move usage function next to the parser.

diff --git a/scripts/makepkg b/scripts/makepkg
index 79476f2..df861ff 100755
--- a/scripts/makepkg
+++ b/scripts/makepkg
@@ -333,54 +333,6 @@ handledeps() {
return $missingdeps
}

-usage() {
-       $ECHO "makepkg"
-       $ECHO
-       $ECHO "Usage: $0 [options] [variable assignations]"
-       $ECHO
-       $ECHO "Options:"
-       $ECHO "  -a, --searchdeps Search for package dependencies automatically"
-       $ECHO "  -A <url>         rsync cache url to use before downloading 
anything"
-       $ECHO "  -b, --builddeps  Build missing dependencies from source"
-       $ECHO "  -B, --noccache   Do not use ccache during build"
-       $ECHO "  -c, --clean      Clean up work files after build"
-       $ECHO "  -C, --cleancache Clean up source files from the cache"
-       $ECHO "  -d, --nodeps     Skip all dependency checks"
-       $ECHO "  -D <pkgname>     Clean up the compiler cache for a package"
-       $ECHO "  -e, --noextract  Do not extract source files (use existing 
src/ dir)"
-       $ECHO "  -f, --force      Overwrite existing package"
-       $ECHO "  -g, --gensha1    Generate SHA1sums for source files"
-       $ECHO "  -G, --wrtsha1    Generate SHA1sums for source files and add it 
to the build script"
-       $ECHO "  -h, --help       This help"
-       $ECHO "  -i, --install    Install package after successful build"
-       $ECHO "  -j <jobs>        Set MAKEFLAGS to \"-j<jobs>\" before building"
-       $ECHO "  -l <pkgname>     Download buildscripts before building"
-       $ECHO "  -m, --nocolor    Disable colorized output messages"
-       $ECHO "  -n, --nostrip    Do not strip binaries/libraries"
-       $ECHO "  -o, --nobuild    Download and extract files only"
-       $ECHO "  -p <buildscript> Use an alternate build script (instead of 
$BUILDSCRIPT)"
-       $ECHO "  -r, --rmdeps     Remove installed dependencies after a 
successful build"
-       $ECHO "  -R, --chroot     Build the package in a chroot environment 
(default)"
-       $ECHO "  -H, --host       Build the package on the host system"
-       $ECHO "  -s, --syncdeps   Install missing dependencies with pacman-g2"
-       $ECHO "  -S, --sudosync   Install missing dependencies with pacman-g2 
and sudo"
-       $ECHO "  -u, --noup2date  Do not check for newer version"
-       $ECHO "  -t <tree>        Use the given tree's chroot to build in"
-       $ECHO "  -w <destdir>     Write package to <destdir> instead of the 
working dir"
-       $ECHO "  -z <compression> Use compression program for a package 
(instead of $PKG_COMP)"
-       $ECHO
-       $ECHO "These options can be passed to pacman-g2:"
-       $ECHO
-       $ECHO "  --noconfirm      Do not ask for confirmation when resolving 
dependencies"
-       $ECHO "  --noprogressbar  Do not show a progress bar when downloading 
files"
-       $ECHO
-       $ECHO "If -p is not specified, makepkg will look for $BUILDSCRIPT"
-       $ECHO "Variable assignations are user defined shell assignations (eg. 
USE_FOO=BAR) used to interact with makepkg and the FrugalBuilds."
-       $ECHO
-       $ECHO "Compatibility options (these may be removed in any future 
release):"
-       $ECHO "  --gzip           Use gzip compression for a package"
-}
-
chroot_lock() {
if [ -e $CHROOTDIR/var/tmp/fst/lock -a -d /proc/$(cat 
$CHROOTDIR/var/tmp/fst/lock 2>/dev/null) ]; then
error "Process $(cat $CHROOTDIR/var/tmp/fst/lock) is already building in this 
chroot."
@@ -1384,6 +1336,54 @@ install_pkg()
exit 0
}

+makepkg_usage() {
+       $ECHO "makepkg"
+       $ECHO
+       $ECHO "Usage: $0 [options] [variable assignations]"
+       $ECHO
+       $ECHO "Options:"
+       $ECHO "  -a, --searchdeps Search for package dependencies automatically"
+       $ECHO "  -A <url>         rsync cache url to use before downloading 
anything"
+       $ECHO "  -b, --builddeps  Build missing dependencies from source"
+       $ECHO "  -B, --noccache   Do not use ccache during build"
+       $ECHO "  -c, --clean      Clean up work files after build"
+       $ECHO "  -C, --cleancache Clean up source files from the cache"
+       $ECHO "  -d, --nodeps     Skip all dependency checks"
+       $ECHO "  -D <pkgname>     Clean up the compiler cache for a package"
+       $ECHO "  -e, --noextract  Do not extract source files (use existing 
src/ dir)"
+       $ECHO "  -f, --force      Overwrite existing package"
+       $ECHO "  -g, --gensha1    Generate SHA1sums for source files"
+       $ECHO "  -G, --wrtsha1    Generate SHA1sums for source files and add it 
to the build script"
+       $ECHO "  -h, --help       This help"
+       $ECHO "  -i, --install    Install package after successful build"
+       $ECHO "  -j <jobs>        Set MAKEFLAGS to \"-j<jobs>\" before building"
+       $ECHO "  -l <pkgname>     Download buildscripts before building"
+       $ECHO "  -m, --nocolor    Disable colorized output messages"
+       $ECHO "  -n, --nostrip    Do not strip binaries/libraries"
+       $ECHO "  -o, --nobuild    Download and extract files only"
+       $ECHO "  -p <buildscript> Use an alternate build script (instead of 
$BUILDSCRIPT)"
+       $ECHO "  -r, --rmdeps     Remove installed dependencies after a 
successful build"
+       $ECHO "  -R, --chroot     Build the package in a chroot environment 
(default)"
+       $ECHO "  -H, --host       Build the package on the host system"
+       $ECHO "  -s, --syncdeps   Install missing dependencies with pacman-g2"
+       $ECHO "  -S, --sudosync   Install missing dependencies with pacman-g2 
and sudo"
+       $ECHO "  -u, --noup2date  Do not check for newer version"
+       $ECHO "  -t <tree>        Use the given tree's chroot to build in"
+       $ECHO "  -w <destdir>     Write package to <destdir> instead of the 
working dir"
+       $ECHO "  -z <compression> Use compression program for a package 
(instead of $PKG_COMP)"
+       $ECHO
+       $ECHO "These options can be passed to pacman-g2:"
+       $ECHO
+       $ECHO "  --noconfirm      Do not ask for confirmation when resolving 
dependencies"
+       $ECHO "  --noprogressbar  Do not show a progress bar when downloading 
files"
+       $ECHO
+       $ECHO "If -p is not specified, makepkg will look for $BUILDSCRIPT"
+       $ECHO "Variable assignations are user defined shell assignations (eg. 
USE_FOO=BAR) used to interact with makepkg and the FrugalBuilds."
+       $ECHO
+       $ECHO "Compatibility options (these may be removed in any future 
release):"
+       $ECHO "  --gzip           Use gzip compression for a package"
+}
+
makepkg_parseargs() {
local consumed

@@ -1403,7 +1403,7 @@ makepkg_parseargs() {
-f|--force)             FORCE=1 ;;
-g|--gensha1)           GENSHA1=1; CHROOT=0 ;;
-G|--wrtsha1)           GENSHA1=1; WRITESHA1=1; CHROOT=0; NODEPS=1 ;;
-               -h|--help)              usage; exit 0 ;;
+               -h|--help)              makepkg_usage; exit 0 ;;
-i|--install)           INSTALL=1 ;;
-j)                     export MAKEFLAGS="-j$2"; consumed=2 ;;
-l)                     DOWNLOAD="$2"; consumed=2 ;;
@@ -1432,7 +1432,7 @@ makepkg_parseargs() {
# special options
#               --)                     shift; break;;
#               -*=*)                   # IMPLEMENT ME: Assigned option support
-               --*|-?)                 usage; exit 1 ;;
+               --*|-?)                 makepkg_usage; exit 1 ;;
-*)                     # Combined short options
split="$1"
shift
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to