indent heredocs when possible

This commit is contained in:
Jakub Jirutka 2016-08-20 15:16:48 +02:00
parent e8508f7b18
commit 948fedc5f7
7 changed files with 128 additions and 128 deletions

View File

@ -88,18 +88,18 @@ do_keygen() {
} }
usage() { usage() {
cat >&2 <<__EOF__ cat >&2 <<-__EOF__
$program $program_version - generate signing keys $program $program_version - generate signing keys
Usage: $program [-a|--append] [-i|--install] [-n] Usage: $program [-a|--append] [-i|--install] [-n]
Options: Options:
-a, --append Set PACKAGER_PRIVKEY=<generated key> in -a, --append Set PACKAGER_PRIVKEY=<generated key> in
$ABUILD_USERCONF $ABUILD_USERCONF
-i, --install Install public key into /etc/apk/keys using sudo -i, --install Install public key into /etc/apk/keys using sudo
-n Non-interactive. Use defaults -n Non-interactive. Use defaults
-q, --quiet -q, --quiet
-h, --help Show this help -h, --help Show this help
__EOF__ __EOF__
} }
append_config= append_config=

View File

@ -43,19 +43,19 @@ do_sign() {
} }
usage() { usage() {
cat >&2 <<__EOF__ cat >&2 <<-__EOF__
$program $program_version - sign indexes $program $program_version - sign indexes
Usage: $program [-k PRIVKEY] [-p PUBKEY] INDEXFILE... Usage: $program [-k PRIVKEY] [-p PUBKEY] INDEXFILE...
$program -e $program -e
Options: Options:
-e, --installed Check only of there exist a private key for signing -e, --installed Check only of there exist a private key for signing
-k, --private KEY The private key to use for signing -k, --private KEY The private key to use for signing
-p, --public KEY The name of public key. apk add will look for -p, --public KEY The name of public key. apk add will look for
/etc/apk/keys/KEY /etc/apk/keys/KEY
-q, --quiet -q, --quiet
-h, --help Show this help -h, --help Show this help
__EOF__ __EOF__
} }
check_installed=false check_installed=false

114
abuild.in
View File

@ -827,17 +827,17 @@ prepare_metafiles() {
echo "# using $($FAKEROOT -v)" >> "$pkginfo" echo "# using $($FAKEROOT -v)" >> "$pkginfo"
fi fi
echo "# $(date -u)" >> "$pkginfo" echo "# $(date -u)" >> "$pkginfo"
cat >> "$pkginfo" <<EOF cat >> "$pkginfo" <<-EOF
pkgname = $name pkgname = $name
pkgver = $pkgver-r$pkgrel pkgver = $pkgver-r$pkgrel
pkgdesc = $pkgdesc pkgdesc = $pkgdesc
url = $url url = $url
builddate = $builddate builddate = $builddate
packager = ${PACKAGER:-"Unknown"} packager = ${PACKAGER:-"Unknown"}
size = $size size = $size
arch = ${subpkgarch:-$pkgarch} arch = ${subpkgarch:-$pkgarch}
origin = $pkgname origin = $pkgname
EOF EOF
local i deps local i deps
deps="$depends" deps="$depends"
if [ "$pkgname" != "busybox" ] && ! depends_has busybox; then if [ "$pkgname" != "busybox" ] && ! depends_has busybox; then
@ -2133,55 +2133,55 @@ snapshot() {
usage() { usage() {
echo "$program $program_version" echo "$program $program_version"
cat << EOF cat <<-EOF
usage: $program [options] [-P REPODEST] [-s SRCDEST] [cmd] ... usage: $program [options] [-P REPODEST] [-s SRCDEST] [cmd] ...
$program [-c] -n PKGNAME[-PKGVER] $program [-c] -n PKGNAME[-PKGVER]
Options: Options:
-A Print CARCH and exit -A Print CARCH and exit
-c Enable colored output -c Enable colored output
-d Disable dependency checking -d Disable dependency checking
-f Force specified cmd, even if they are already done -f Force specified cmd, even if they are already done
-F Force run as root -F Force run as root
-h Show this help -h Show this help
-i Install PKG after successful build -i Install PKG after successful build
-k Keep built packages, even if APKBUILD or sources are newer -k Keep built packages, even if APKBUILD or sources are newer
-K Keep buildtime temp dirs and files (srcdir/pkgdir/deps) -K Keep buildtime temp dirs and files (srcdir/pkgdir/deps)
-m Disable colors (monochrome) -m Disable colors (monochrome)
-P Set REPODEST as the repository location for created packages -P Set REPODEST as the repository location for created packages
-q Quiet -q Quiet
-r Install missing dependencies from system repository (using sudo) -r Install missing dependencies from system repository (using sudo)
-R Recursively build and install missing dependencies (using sudo) -R Recursively build and install missing dependencies (using sudo)
-s Set source package destination directory -s Set source package destination directory
-u Recursively build and upgrade all dependencies (using sudo) -u Recursively build and upgrade all dependencies (using sudo)
Commands: Commands:
build Compile and install package into \$pkgdir build Compile and install package into \$pkgdir
checksum Generate checksum to be included in APKBUILD checksum Generate checksum to be included in APKBUILD
clean Remove temp build and install dirs clean Remove temp build and install dirs
cleancache Remove downloaded files from \$SRCDEST cleancache Remove downloaded files from \$SRCDEST
cleanoldpkg Remove binary packages except current version cleanoldpkg Remove binary packages except current version
cleanpkg Remove already built binary and source package cleanpkg Remove already built binary and source package
deps Install packages listed in makedepends and depends deps Install packages listed in makedepends and depends
fetch Fetch sources to \$SRCDEST and verify checksums fetch Fetch sources to \$SRCDEST and verify checksums
index Regenerate indexes in \$REPODEST index Regenerate indexes in \$REPODEST
listpkg List target packages listpkg List target packages
package Create package in \$REPODEST package Create package in \$REPODEST
prepare Apply patches prepare Apply patches
rootpkg Run 'package', the split functions and create apks as fakeroot rootpkg Run 'package', the split functions and create apks as fakeroot
sanitycheck Basic sanity check of APKBUILD sanitycheck Basic sanity check of APKBUILD
snapshot Create a \$giturl or \$svnurl snapshot and upload to \$disturl snapshot Create a \$giturl or \$svnurl snapshot and upload to \$disturl
sourcecheck Check if remote source package exists upstream sourcecheck Check if remote source package exists upstream
srcpkg Make a source package srcpkg Make a source package
undeps Uninstall packages listed in makedepends and depends undeps Uninstall packages listed in makedepends and depends
unpack Unpack sources to \$srcdir unpack Unpack sources to \$srcdir
up2date Compare target and sources dates up2date Compare target and sources dates
verify Verify checksums verify Verify checksums
To activate cross compilation specify in environment: To activate cross compilation specify in environment:
CHOST Arch or hostspec of machine to generate packages for CHOST Arch or hostspec of machine to generate packages for
CTARGET Arch or hostspec of machine to generate compiler for CTARGET Arch or hostspec of machine to generate compiler for
EOF EOF
exit 0 exit 0
} }

View File

@ -86,18 +86,18 @@ fixes #${fixes#\#}
} }
usage() { usage() {
cat >&2 <<__EOF__ cat >&2 <<-__EOF__
$program $program_version - bump pkgver in APKBUILDs $program $program_version - bump pkgver in APKBUILDs
Usage: $program [-s CVE-1,CVE-2,...] [-f ISSUE] [-R|--recursive] [-k|--keep] PKGNAME-1.2.3 ... Usage: $program [-s CVE-1,CVE-2,...] [-f ISSUE] [-R|--recursive] [-k|--keep] PKGNAME-1.2.3 ...
Options: Options:
-s, --security CVE1,CVE-2,... Security update -s, --security CVE1,CVE-2,... Security update
-f, --fixes ISSUE Fixes ISSUE -f, --fixes ISSUE Fixes ISSUE
-R, --recursive Run abuild with -R for recursive building -R, --recursive Run abuild with -R for recursive building
-k, --keep Run abuild with -k to keep existing packages -k, --keep Run abuild with -k to keep existing packages
-q, --quiet -q, --quiet
-h, --help Show this help -h, --help Show this help
__EOF__ __EOF__
} }
keep= keep=

View File

@ -73,21 +73,21 @@ do_nothing() {
} }
usage() { usage() {
cat >&2 <<__EOF__ cat >&2 <<-__EOF__
$program $program_version - display or bump pkgrel in APKBUILDs $program $program_version - display or bump pkgrel in APKBUILDs
Usage: $program [-z|--zero] [-a|--add] [-g|--clean-git] [-s|--set NUM] Usage: $program [-z|--zero] [-a|--add] [-g|--clean-git] [-s|--set NUM]
[-t|--test] [-f|--force] DIR or APKBUILD... [-t|--test] [-f|--force] DIR or APKBUILD...
Options: Options:
-z, --zero Set pkgrel to 0 -z, --zero Set pkgrel to 0
-a, --add Add 1 to current pkgrel -a, --add Add 1 to current pkgrel
-g, --clean-git Only operate on APKBUILDs with clean git status (implies -g, --clean-git Only operate on APKBUILDs with clean git status (implies
--add) --add)
-s, --set NUM Set pkgrel to NUM -s, --set NUM Set pkgrel to NUM
-t, --test Only verify that files have a valid pkgrel -t, --test Only verify that files have a valid pkgrel
-f, --force Operate on files without a valid pkgrel -f, --force Operate on files without a valid pkgrel
-h, --help Show this help -h, --help Show this help
__EOF__ __EOF__
} }
cmd=do_show cmd=do_show

View File

@ -17,13 +17,13 @@ fi
usage() { usage() {
cat >&2 <<__EOF__ cat >&2 <<-__EOF__
$program $program_version - find ABI breakages in package upgrades $program $program_version - find ABI breakages in package upgrades
Usage: $program Usage: $program
Run in the directory of a built package. Run in the directory of a built package.
__EOF__ __EOF__
} }
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then

View File

@ -286,25 +286,25 @@ __EOF__
} }
usage() { usage() {
cat >&2 <<__EOF__ cat >&2 <<-__EOF__
$program $program_version - generate a new APKBUILD $program $program_version - generate a new APKBUILD
Usage: $program [-cfh] [-d DESC] [-l LICENSE] [-n NAME] [-u URL] Usage: $program [-cfh] [-d DESC] [-l LICENSE] [-n NAME] [-u URL]
PKGNAME[-PKGVER]|SRCURL PKGNAME[-PKGVER]|SRCURL
Options: Options:
-n Set package name to NAME -n Set package name to NAME
-d Set package description (pkgdesc) to DESC -d Set package description (pkgdesc) to DESC
-l Set package license to LICENSE -l Set package license to LICENSE
-u Set package URL -u Set package URL
-a Create autotools (use ./configure ...) -a Create autotools (use ./configure ...)
-C Create CMake pakckage (Assume cmake/ is there) -C Create CMake pakckage (Assume cmake/ is there)
-p Create perl package (Assume Makefile.PL is there) -p Create perl package (Assume Makefile.PL is there)
-y Create python package (Assume setup.py is there) -y Create python package (Assume setup.py is there)
-s Use sourceforge source URL -s Use sourceforge source URL
-c Copy a sample init.d, conf.d, and install script to new directory -c Copy a sample init.d, conf.d, and install script to new directory
-f Force even if directory already exist -f Force even if directory already exist
-h Show this help -h Show this help
__EOF__ __EOF__
} }
while getopts "acd:fhl:n:pyu:s" opt; do while getopts "acd:fhl:n:pyu:s" opt; do