diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-09-23 19:59:53 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-09-29 18:48:45 -0400 |
commit | 1711a5c07c5d35d21f422e59f10c7836953a256e (patch) | |
tree | 55de0bd30542ef91192a57f401b065cf0ed5ce50 /src | |
parent | d11311f66524dd61b4f186bbbc91d0e47b7e4f4d (diff) |
fullpkg: internationalize
Diffstat (limited to 'src')
-rw-r--r-- | src/fullpkg/Makefile | 2 | ||||
-rwxr-xr-x | src/fullpkg/fullpkg | 31 | ||||
-rwxr-xr-x | src/fullpkg/fullpkg-build | 41 | ||||
-rwxr-xr-x | src/fullpkg/fullpkg-find | 43 |
4 files changed, 58 insertions, 59 deletions
diff --git a/src/fullpkg/Makefile b/src/fullpkg/Makefile index 2c76089..ee9c395 100644 --- a/src/fullpkg/Makefile +++ b/src/fullpkg/Makefile @@ -1 +1,3 @@ include ../../common.mk + +fullpkg-build.pot: xgettext-keywords-sh+=--keyword=list_pkgs:2 diff --git a/src/fullpkg/fullpkg b/src/fullpkg/fullpkg index 7724165..00a9502 100755 --- a/src/fullpkg/fullpkg +++ b/src/fullpkg/fullpkg @@ -4,25 +4,26 @@ # aren't built or need update and then makepkg them in order. usage() { - - echo "cd to a dir containing a PKGBUILD and run:" - echo "$0 [build_dir]" - echo "" - echo "This script will check dependencies, build them if possible " - echo "and stage the packages on it's repo." - echo "" - echo "OPTIONS:" - echo " -h : this message." - echo "" - echo "Wrapper for \`fullpkg-find' and \`fullpkg-build'" - echo "" - exit 1 - + print "Usage: %s [OPTIONS] [BUILD_DIR]" "${0##*/}" + print "A (libre)makepkg wrapper that will also build dependencies" + echo + prose "More directly, it wraps fullpkg-find and fullpkg-build; + fullpkg-find finds the dependencies, and sets them up in + BUILD_DIR; then fullpkg-build builds them." + echo + prose "This script will check dependencies, build them if possible and + stage the packages on its repo." + echo + prose "If no BUILD_DIR is specified, it will create a temporary + directory." + echo + print "Options:" + flag '-h' "Show this message" } while getopts 'h' arg; do case "$arg" in - h) usage ;; + h) usage; exit 0 ;; esac done diff --git a/src/fullpkg/fullpkg-build b/src/fullpkg/fullpkg-build index 106ff0e..8f01369 100755 --- a/src/fullpkg/fullpkg-build +++ b/src/fullpkg/fullpkg-build @@ -124,38 +124,34 @@ trap 'trap_exit "(fullpkg-build) An unknown error has occurred. Exiting..."' ERR CLEANUP="false" CHECKNONFREE="true" RUN="$FULLBUILDCMD" -MESSAGE="Building packages" +MESSAGE="$(_ 'Building packages')" usage() { - - echo "" - echo "$(basename $0) [options] <build_dir>" - echo "" - echo "Builds packages from build_dir, create a build_dir using:" - echo "'fullpkg-find <build_dir>'" - echo "" - echo "If no <build_dir> is specified, it uses the current directory." - echo "" - echo "OPTIONS:" - echo " -h : this message." - echo " -c : clean <build_dir> on succesfull build" - echo " -N : don't check for freedom issues." #Also made by fullpkg-find - echo " -r \"command\" : use this instead of \"$FULLBUILDCMD\"." - echo " -g : get sources for building packages on build_dir." - echo "" - exit 1 - + print "Usage: %s [OPTIONS] [BUILD_DIR]" "${0##*/}" + print "Builds packages in BUILD_DIR, as set up by fullpkg-find" + echo + prose "Builds packages from BUILD_DIR; create BUILD_DIR using:" + print ' $ fullpkg-find BUILD_DIR' + echo + prose "If no BUILD_DIR is specified, it uses the current directory." + echo + print "Options:" + flag "-c" "Clean BUILD_DIR on succesfull build" + flag "-N" "Don't check for freedom issues." #Also made by fullpkg-find + flag "-r $(_ CMD)" "Use CMD instead of \${FULLBUILDCMD}" + flag "-g" "Get sources for building packages on BUILD_DIR" + flag "-h" "Show this message" } while getopts 'hNr:g' arg; do case $arg in - h) usage ;; + h) usage; exit 0 ;; c) CLEAN ;; N) CHECKNONFREE="false" ;; r) RUN="$OPTARG" - MESSAGE="Executing custom action";; + MESSAGE="$(_ 'Executing custom action')";; g) RUN='makepkg -g > /dev/null' - MESSAGE="Downloading packages";; + MESSAGE="$(_ 'Downloading packages')";; esac done @@ -166,6 +162,7 @@ buildorder="${build_dir}/BUILDORDER" if [ ! -e "$buildorder" ]; then error "This is not a build_dir. Make one using fullpkg." usage + exit 1 else # backup BUILDORDER cp "$buildorder" "$build_dir/.BUILDORDER" diff --git a/src/fullpkg/fullpkg-find b/src/fullpkg/fullpkg-find index a8f2ac8..1a4f62e 100755 --- a/src/fullpkg/fullpkg-find +++ b/src/fullpkg/fullpkg-find @@ -53,7 +53,7 @@ find_deps() { if ! pkgbuild-check-nonfree > /dev/null 2> /dev/null; then if [ "$?" -eq 15 ]; then - error "pkgbase" has nonfree issues + error "%s has nonfree issues" "$pkgbase" return 15 fi fi @@ -80,7 +80,7 @@ find_deps() { fi # current package plus a space for every level - msg2 "%${LEVEL}s${pkgbase}-$(get_full_version)" + msg2 "%${LEVEL}s%s" '' "${pkgbase}-$(get_full_version)" ## Check next levels declare -i next_level=$LEVEL+1 @@ -128,30 +128,28 @@ CLEANFIRST='false' UPDATEDB='true' usage() { - - echo "" - echo "cd to a dir containing a PKGBUILD and run:" - echo "$(basename $0) [options] <build_dir>" - echo "" - echo "This script will create a build_dir for recursive building" - echo "it tries to find dependencies that aren't built or need update." - echo "" - echo "If no <build_dir> is specified, the script works on a tempdir" - echo "" - echo "OPTIONS:" - echo " -h : this message." - echo " -A <absroot> : use this ABSROOT." - echo " -c : clean <build_dir> before working." - echo " -m <max_level> : check deps until this level" - echo " -n : don't update pacman db." - echo "" - exit 1 - + print "Usage: %s [OPTIONS] [BUILD_DIR]" "${0##*/}" + print "Finds package dependencies and sets up a build order" + echo + prose "Run this from a directory containing a PKGBUILD." + echo + prose "This script will create a BUILD_DIR for recursive building; it + tries to find dependencies that aren't built or need update." + echo + prose "If no BUILD_DIR is specified, it will create a temporary + directory." + echo + print "Options:" + flag "-h" "Show this message" + flag "-A <$(_ ABSROOT)>" "Use ABSROOT as the root of the ABS tree" + flag "-c" "Clean BUILD_DIR before working." + flag "-m <$(_ MAX_LEVEL)>" "Limit the depth of the dependency recursion" + flag "-n" "Don't update pacman DB" } while getopts 'hA:l:cmn' arg; do case "$arg" in - h) usage ;; + h) usage; exit 0 ;; A) ABSROOT="$OPTARG" ;; l) LEVEL="$OPTARG" ;; # hidden option to know dep level. c) CLEANFIRST='true' ;; @@ -163,6 +161,7 @@ done if [ ! -r PKGBUILD ]; then error "This directory doesnt contain a PKGBUILD" usage + exit 1 fi shift $(( OPTIND - 1 )) |