From 320ec256f0e6821509acc164c114795b0e087be3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 2 Nov 2013 18:15:00 -0400 Subject: test: set LC_ALL instead of LANG --- test/aur-test.sh | 2 +- test/is_built-test.sh | 2 +- test/lib-blacklist-test.sh | 6 +++--- test/librechroot-test.sh | 4 ++-- test/librefetch-test.sh | 2 +- test/libremakepkg-test.sh | 2 +- test/librerelease-test.sh | 4 ++-- test/librestage-test.sh | 2 +- test/pkgbuild-check-nonfree-test.sh | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/aur-test.sh b/test/aur-test.sh index 8b175eb..8bcb5ef 100644 --- a/test/aur-test.sh +++ b/test/aur-test.sh @@ -13,7 +13,7 @@ after() { } it_displays_help() { - LANG=C aur -h >$tmpdir/stdout 2>$tmpdir/stderr + LC_ALL=C aur -h >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] empty $tmpdir/stderr diff --git a/test/is_built-test.sh b/test/is_built-test.sh index e76ffc0..af754dc 100644 --- a/test/is_built-test.sh +++ b/test/is_built-test.sh @@ -13,7 +13,7 @@ after() { } it_displays_help() { - LANG=C is_built -h >$tmpdir/stdout 2>$tmpdir/stderr + LC_ALL=C is_built -h >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] empty $tmpdir/stderr diff --git a/test/lib-blacklist-test.sh b/test/lib-blacklist-test.sh index be54b47..640ed77 100644 --- a/test/lib-blacklist-test.sh +++ b/test/lib-blacklist-test.sh @@ -110,7 +110,7 @@ it_downloads_the_blacklist_repeatedly() { } it_displays_help_and_fails_with_no_args() { - LANG=C libreblacklist >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? + LC_ALL=C libreblacklist >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] empty $tmpdir/stdout @@ -118,14 +118,14 @@ it_displays_help_and_fails_with_no_args() { } it_displays_help_when_given_h() { - LANG=C libreblacklist -h >$tmpdir/stdout 2>$tmpdir/stderr + LC_ALL=C libreblacklist -h >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" =~ 'Usage: libreblacklist ' ]] empty $tmpdir/stderr } it_displays_help_when_given_h_cat() { - LANG=C libreblacklist -h cat >$tmpdir/stdout 2>$tmpdir/stderr + LC_ALL=C libreblacklist -h cat >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" == 'Usage: libreblacklist cat' ]] empty $tmpdir/stderr diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index 8efba67..5ca1b37 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -42,7 +42,7 @@ it_respects_exit_status_if_out_isnt_a_tty() ( it_displays_help_as_normal_user() { rm -rf "$XDG_CONFIG_HOME" - LANG=C librechroot help >$tmpdir/stdout 2>$tmpdir/stderr + LC_ALL=C librechroot help >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] empty $tmpdir/stderr @@ -57,7 +57,7 @@ it_otherwise_fails_as_normal_user() { } it_displays_help_and_fails_with_0_args() { - LANG=C librechroot >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? + LC_ALL=C librechroot >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] empty $tmpdir/stdout diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh index 7408993..13ce80f 100644 --- a/test/librefetch-test.sh +++ b/test/librefetch-test.sh @@ -25,7 +25,7 @@ after() { } it_displays_help() { - LANG=C librefetch -h >$tmpdir/stdout 2>$tmpdir/stderr + LC_ALL=C librefetch -h >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] empty $tmpdir/stderr diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh index bef1db8..e684f18 100644 --- a/test/libremakepkg-test.sh +++ b/test/libremakepkg-test.sh @@ -72,7 +72,7 @@ it_handles_PKGDEST_not_existing() { it_displays_help_as_normal_user() { rm -rf "$XDG_CONFIG_HOME" - LANG=C libremakepkg -h >$tmpdir/stdout 2>$tmpdir/stderr + LC_ALL=C libremakepkg -h >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] empty $tmpdir/stderr diff --git a/test/librerelease-test.sh b/test/librerelease-test.sh index ebbd504..c395bc6 100644 --- a/test/librerelease-test.sh +++ b/test/librerelease-test.sh @@ -26,7 +26,7 @@ after() { it_displays_usage_text() { rm -rf "$XDG_CONFIG_HOME" - LANG=C librerelease -h >"$tmpdir/stdout" 2>"$tmpdir/stderr" + LC_ALL=C librerelease -h >"$tmpdir/stdout" 2>"$tmpdir/stderr" [[ "$(sed 1q "$tmpdir/stdout")" =~ Usage:.* ]] empty "$tmpdir/stderr" @@ -40,7 +40,7 @@ it_lists_all_files() { "$WORKDIR/staging/repo1/file2" \ "$WORKDIR/staging/repo2/file with spaces" unset WORKDIR - LANG=C librerelease -l &>"$tmpdir/list" + LC_ALL=C librerelease -l &>"$tmpdir/list" cat > "$tmpdir/list-correct" < repo1 diff --git a/test/librestage-test.sh b/test/librestage-test.sh index 5c7487b..6728143 100644 --- a/test/librestage-test.sh +++ b/test/librestage-test.sh @@ -23,7 +23,7 @@ after() { it_displays_usage_text() { rm -rf "$XDG_CONFIG_HOME" - LANG=C librestage -h >$tmpdir/stdout 2>$tmpdir/stderr + LC_ALL=C librestage -h >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q "$tmpdir/stdout")" =~ Usage:.* ]] empty "$tmpdir/stderr" diff --git a/test/pkgbuild-check-nonfree-test.sh b/test/pkgbuild-check-nonfree-test.sh index b30204b..6463d64 100644 --- a/test/pkgbuild-check-nonfree-test.sh +++ b/test/pkgbuild-check-nonfree-test.sh @@ -27,7 +27,7 @@ after() { it_displays_usage_text() { # This test seems silly, but it makes sure that it is executable, # syntactically correct, and loading libraries works. - LANG=C $pcn -h >$tmpdir/stdout 2>$tmpdir/stderr + LC_ALL=C $pcn -h >$tmpdir/stdout 2>$tmpdir/stderr stat=$? [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] -- cgit v1.2.3-54-g00ecf From 4d7b01704fe2460f446a9892d63313ae571d45f3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 2 Nov 2013 18:17:16 -0400 Subject: librechroot: when detecting mount options, set LC_ALL instead of LANG --- src/chroot-tools/librechroot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index b55cae1..0b3a7f1 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -178,7 +178,7 @@ calculate_directories() { check_mountpoint() { local file=$1 local mountpoint="$(df -P "$file"|sed '1d;s/.*\s//')" - local mountopts=($(LANG=C mount|awk "{ if (\$3==\"$mountpoint\") { gsub(/[(,)]/, \" \", \$6); print \$6 } }")) + local mountopts=($(LC_ALL=C mount|awk "{ if (\$3==\"$mountpoint\") { gsub(/[(,)]/, \" \", \$6); print \$6 } }")) ! in_array nosuid "${mountopts[@]}" && ! in_array noexec "${mountopts[@]}" } -- cgit v1.2.3-54-g00ecf From c28a7d64bd9f10236a255c284442b1526c6b7990 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 3 Nov 2013 10:48:38 -0500 Subject: librechroot: correct comment --- src/chroot-tools/librechroot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 0b3a7f1..5e16587 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -190,8 +190,8 @@ arch-nspawn() { if [[ -t 1 ]]; then cmd=("$@") else - # This perl script is equivalent to `sed -s 's|\n|\r\n|g', but - # it doesn't line-buffer. + # This perl script is similar to `sed 's|\n|\r\n|g'`, (or, more + # correctly, `sed 's|$|\r|'`) but it does't line-buffer. local perlcmd=' my $size; my $buffer; -- cgit v1.2.3-54-g00ecf From 12a139ee5fb29a727c330fa61372f3d8d5fe7ab7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 3 Nov 2013 12:33:22 -0500 Subject: treepkg: internationalize (sometimes changing the format of a message) Changes in message format: - Terminal-titles now begin with capital letters - "error!" -> "Error!" - "done" -> "Done" - signal handler errors changed from (treepkg) MESSAGE (leftovers on BUILDDIR) to treepkg: MESSAGE (leftovers on BUILDDIR) --- src/treepkg | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/treepkg b/src/treepkg index 5c1312d..f7cc338 100755 --- a/src/treepkg +++ b/src/treepkg @@ -26,8 +26,8 @@ term_title "$(basename $0)" # End inmediately but print an useful message trap_exit() { - term_title "error!" - error "($(basename $0)) $@ (leftovers on ${BUILDDIR})" + term_title "${0##*/}: $(_ 'Error!')" + error "%s: %s (leftovers on %s" "${0##*/}" "$*" "${BUILDDIR}" exit 1 } @@ -79,7 +79,7 @@ guess_repo() { } if [ ! -f PKGBUILD ]; then - error "Missing PKGBUILD ($PWD)" + error "Missing PKGBUILD (%s)" "$PWD" exit 1 fi @@ -179,7 +179,7 @@ if [ ${DEPTH} -eq 0 ]; then ${VERBOSE} && msg "Starting build" || true if ${BUILD}; then - ${VERBOSE} && msg "Build tree stored in ${BUILDORDER}" || true + ${VERBOSE} && msg "Build tree stored in %s" "${BUILDORDER}" || true # Build everything sorting the build dir # The reverse order ensures we start by the deepest packages @@ -189,7 +189,7 @@ if [ ${DEPTH} -eq 0 ]; then # Skip if already built (faster than calling is_build again) if [ -f "${BUILDDIR}/${_pkg}/built_ok" ]; then continue; fi - ${VERBOSE} && msg "Building ${_pkg/_/ }" || true + ${VERBOSE} && msg "Building %s" "${_pkg/_/ }" || true # Remove leading zeros and space if any term_title "$(echo ${_pkg/_/ } | sed "s/^0\+ \?//")" @@ -214,11 +214,11 @@ if [ ${DEPTH} -eq 0 ]; then fi if ${CLEANUP} ; then - msg2 "Removing ${BUILDDIR}" + msg2 "Removing %s" "${BUILDDIR}" rm -rf "${BUILDDIR}" fi fi -term_title "done" +term_title "$(_ Done)" exit $? -- cgit v1.2.3-54-g00ecf From 7dbe6410f501a748759866cab89253c799001c57 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 3 Nov 2013 12:33:53 -0500 Subject: treepkg: obey $TMPDIR --- src/treepkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/treepkg b/src/treepkg index f7cc338..6dc9dda 100755 --- a/src/treepkg +++ b/src/treepkg @@ -103,7 +103,7 @@ done pkgbase="${pkgbase:-${pkgname[0]}}" # Get or set the work dir -BUILDDIR="${1:-$(mktemp -d /tmp/${pkgbase}-treepkg-XXXx)}" +BUILDDIR="${1:-$(mktemp --tmpdir -d ${pkgbase}-treepkg.XXXXXXXXXX)}" BUILDORDER="${BUILDDIR}/BUILDORDER" DEPTH=${2:-0} NEXTDEPTH=$((${DEPTH} + 1)) -- cgit v1.2.3-54-g00ecf From a9f812439059c7f6b4d631fcf02fc2c7a7200172 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 3 Nov 2013 13:17:46 -0500 Subject: aur, is_built: internationalize usage() --- src/aur | 14 +++++++------- src/is_built | 19 ++++++++++--------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/aur b/src/aur index 6fce891..2fc7142 100755 --- a/src/aur +++ b/src/aur @@ -20,15 +20,15 @@ . libremessages -cmd=${0##*/} usage() { - echo "Usage: $cmd [-h] pkgname-from-aur1 [pkgname-from-aur2 ...]" + print "Usage: %s [-h] PKGNAME [PKGNAME2 PKGNAME3...]" "${0##*/}" + print "Downloads packages from the AUR, and does basic freedom checks." echo - echo "This script will download packages from AUR to the current" - echo "directory and check their license for nonfree issues. This does" - echo "not mean that they are free; they may be incorrectly labeled, or" - echo "have other freedom issues. It's a tool to help Parabola" - echo "packagers, not to help users install things directly from AUR." + prose "This script will download packages from AUR to the current + directory and check their license for nonfree issues. This does + not mean that they are free; they may be incorrectly labeled, or + have other freedom issues. It's a tool to help Parabola + packagers, not to help users install things directly from AUR." } main() { diff --git a/src/is_built b/src/is_built index 80d0719..6def815 100755 --- a/src/is_built +++ b/src/is_built @@ -1,18 +1,19 @@ #!/usr/bin/env bash -cmd=${0##*/} usage() { - echo "Usage: $cmd [-h] pkgname [pkgver]" + print "Usage: %s [-h] PKGNAME [PKGVER]" "${0##*/}" "${0##*/}" + print 'Detect iv a given package (version) is already in the repos' echo - echo "Detect if a given package version is already in repos" - echo "Assuming you want greater or equal." + prose "If a version is specified, it assumedx that you want a greater or + equal version." echo - echo "Example usage: $cmd 'pcre' '20'" + prose "Example usage:" + print " $ %s 'pcre' '20'" "${0##*/}" echo - echo "Exit status:" - echo " 0: The package is built" - echo " 1: The package has not built" - echo " >1: There was an error" + print "Exit status:" + print " 0: The package is built" + print " 1: The package has not built" + print " >1: There was an error" } while getopts 'h' arg; do -- cgit v1.2.3-54-g00ecf From b20b7b03053f94499085a4570a241428b5676ce2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 4 Nov 2013 11:23:01 -0500 Subject: normalize on "[[" instead of "[" --- src/abslibre-tools/libreaddiff | 6 +++--- src/abslibre-tools/librerelease | 6 +++--- src/chroot-tools/chcleanup | 2 +- src/fullpkg/fullpkg-build | 14 +++++++------- src/fullpkg/fullpkg-find | 10 +++++----- src/treepkg | 16 ++++++++-------- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/abslibre-tools/libreaddiff b/src/abslibre-tools/libreaddiff index 9f5ae27..3855279 100755 --- a/src/abslibre-tools/libreaddiff +++ b/src/abslibre-tools/libreaddiff @@ -74,14 +74,14 @@ except StopIteration: load_PKGBUILD "$f/PKGBUILD" || continue is_here=false for arc in ${arch[@]} ; do - if [ "$arc" = "any" -o "$arc" = "$CARCH" ] ; then + if [[ "$arc" == "any" ]] || [[ "$arc" == "$CARCH" ]] ; then is_here=true break fi done - if [ "$is_here" = "true" ] ; then + if [[ "$is_here" == "true" ]] ; then for name in ${pkgname[@]} ; do - if [ -z "$epoch" ] ; then + if [[ -z "$epoch" ]] ; then echo $name-$pkgver-$pkgrel else echo $name-$epoch:$pkgver-$pkgrel diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index adfb935..d133571 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -80,12 +80,12 @@ create_signature() { } sign_packages() { - if [ -z "${GPG_AGENT_INFO}" ]; then + if [[ -z "${GPG_AGENT_INFO}" ]]; then warning "It's better to use gpg-agent to sign packages in batches" fi for package in $(find "${WORKDIR}/staging/" -type f -iname '*.pkg.tar.?z'); do - if [ -f "${package}.sig" ]; then + if [[ -f "${package}.sig" ]]; then msg2 "Package signature found, verifying..." # Verify that the signature is correct, else remove for re-signing @@ -95,7 +95,7 @@ sign_packages() { fi fi - if ! [ -f "${package}.sig" ]; then + if ! [[ -f "${package}.sig" ]]; then create_signature "$package" || return 2 fi done diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup index 0c78989..2ff45f9 100755 --- a/src/chroot-tools/chcleanup +++ b/src/chroot-tools/chcleanup @@ -53,7 +53,7 @@ fi source /etc/libretools.d/chroot.conf # If we're running makepkg -if [ -f PKGBUILD ]; then +if [[ -f PKGBUILD ]]; then export CARCH="$(. /etc/makepkg.conf; printf '%s' "$CARCH")" source ./PKGBUILD CHROOTEXTRAPKG+=("${depends[@]}" diff --git a/src/fullpkg/fullpkg-build b/src/fullpkg/fullpkg-build index 8149453..e824c2e 100755 --- a/src/fullpkg/fullpkg-build +++ b/src/fullpkg/fullpkg-build @@ -45,13 +45,13 @@ remove_buildorder() { succesfull_build() { - if [ "$RUN" != "$FULLBUILDCMD" ]; then + if [[ "$RUN" != "$FULLBUILDCMD" ]]; then return 0 # Custom command or download sources fi - if source .INFO && [ -n "$repo" ]; then + if source .INFO && [[ -n "$repo" ]]; then - if [ ! -z "$HOOKLOCALRELEASE" ]; then + if [[ ! -z "$HOOKLOCALRELEASE" ]]; then "$HOOKLOCALRELEASE" "$repo" fi @@ -75,11 +75,11 @@ __build() { build_packages=($(sort -gr $buildorder | cut -d: -f2)) # greater levels must be built first - while [ ${#build_packages[@]} -ge 1 ]; do + while [[ ${#build_packages[@]} -ge 1 ]]; do pushd "$build_dir/${build_packages[0]}" >/dev/null - if [ -n "${HOOKPKGBUILDMOD}" ]; then + if [[ -n "${HOOKPKGBUILDMOD}" ]]; then ${HOOKPKGBUILDMOD} || true fi @@ -156,7 +156,7 @@ shift $(( OPTIND - 1 )) build_dir="${1:-`pwd`}" buildorder="${build_dir}/BUILDORDER" -if [ ! -e "$buildorder" ]; then +if [[ ! -e "$buildorder" ]]; then error "This is not a build_dir. Make one using fullpkg." usage exit 1 @@ -172,7 +172,7 @@ fi msg "$MESSAGE" __build -if [ "$RUN" != "$FULLBUILDCMD" ]; then +if [[ "$RUN" != "$FULLBUILDCMD" ]]; then # Used for downloading or custom command mv "$build_dir/.BUILDORDER" "$buildorder" exit 0 diff --git a/src/fullpkg/fullpkg-find b/src/fullpkg/fullpkg-find index 566605a..57819c3 100755 --- a/src/fullpkg/fullpkg-find +++ b/src/fullpkg/fullpkg-find @@ -104,7 +104,7 @@ find_deps() { # greater levels are built first echo "${LEVEL}:${pkgbase}" >>"$build_dir/BUILDORDER" # PKGBUILD is already there - if [ -d "${build_dir}/${pkgbase}" ]; then + if [[ -d "${build_dir}/${pkgbase}" ]]; then exit 0 # Copy dir to build_dir else @@ -133,7 +133,7 @@ find_deps() { # arch=any packages. local pkgdir=$(toru -p ${_dep}) || true - if [ -n "$pkgdir" -a -d "${pkgdir}" ]; then + if [[ -n "$pkgdir" ]] && [[ -d "${pkgdir}" ]; then found=true pushd "${pkgdir}" > /dev/null @@ -193,7 +193,7 @@ while getopts 'hA:l:cmn' arg; do esac done -if [ ! -r PKGBUILD ]; then +if [[ ! -r PKGBUILD ]]; then error "This directory doesnt contain a PKGBUILD" usage exit 1 @@ -202,11 +202,11 @@ fi shift $(( OPTIND - 1 )) build_dir="${1}" -if [ "$LEVEL" -eq 0 ]; then +if [[ "$LEVEL" -eq 0 ]]; then build_dir="${1:-$(mktemp -d /tmp/fullpkg.XXXXXX)}" - if [ ! -d "$build_dir" ]; then + if [[ ! -d "$build_dir" ]]; then mkdir -p "$build_dir" elif "$CLEANFIRST"; then # Erase files already in dir diff --git a/src/treepkg b/src/treepkg index 6dc9dda..0f6d605 100755 --- a/src/treepkg +++ b/src/treepkg @@ -59,10 +59,10 @@ bury() { # If there's a depth or the package is not the root of the build tree (which # can lead to funny chicken-and-egg problems), update the depth to the current # package next-depth and rename the dir too - if [ -z "${current_depth}" ]; then return; fi - if [ -z "${current_name}" ]; then return; fi - if [ ${current_depth} -eq 0 ]; then return; fi - if [ ${current_depth} -ge $2 ]; then return; fi + if [[ -z "${current_depth}" ]]; then return; fi + if [[ -z "${current_name}" ]]; then return; fi + if [[ ${current_depth} -eq 0 ]]; then return; fi + if [[ ${current_depth} -ge $2 ]]; then return; fi ${VERBOSE} && msg "Burying ${1} from ${current_depth} to ${2}" @@ -78,7 +78,7 @@ guess_repo() { basename "$(dirname "${1}")" } -if [ ! -f PKGBUILD ]; then +if [[ ! -f PKGBUILD ]]; then error "Missing PKGBUILD (%s)" "$PWD" exit 1 fi @@ -175,7 +175,7 @@ if ! ${BUILDNOW}; then fi # Only build at the end -if [ ${DEPTH} -eq 0 ]; then +if [[ ${DEPTH} -eq 0 ]]; then ${VERBOSE} && msg "Starting build" || true if ${BUILD}; then @@ -185,9 +185,9 @@ if [ ${DEPTH} -eq 0 ]; then # The reverse order ensures we start by the deepest packages for _pkg in $(ls -r "${BUILDDIR}"); do # Ignore if there's no PKGBUILD - if [ ! -f "${BUILDDIR}/${_pkg}/PKGBUILD" ]; then continue; fi + if [[ ! -f "${BUILDDIR}/${_pkg}/PKGBUILD" ]]; then continue; fi # Skip if already built (faster than calling is_build again) - if [ -f "${BUILDDIR}/${_pkg}/built_ok" ]; then continue; fi + if [[ -f "${BUILDDIR}/${_pkg}/built_ok" ]]; then continue; fi ${VERBOSE} && msg "Building %s" "${_pkg/_/ }" || true -- cgit v1.2.3-54-g00ecf From e362e5b23aa9f7322df5995d4b5e51dfea17956f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 4 Nov 2013 11:23:33 -0500 Subject: touch up quoting on arrays --- src/abslibre-tools/libreaddiff | 2 +- src/fullpkg/fullpkg-find | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/abslibre-tools/libreaddiff b/src/abslibre-tools/libreaddiff index 3855279..ebd749d 100755 --- a/src/abslibre-tools/libreaddiff +++ b/src/abslibre-tools/libreaddiff @@ -80,7 +80,7 @@ except StopIteration: fi done if [[ "$is_here" == "true" ]] ; then - for name in ${pkgname[@]} ; do + for name in "${pkgname[@]}" ; do if [[ -z "$epoch" ]] ; then echo $name-$pkgver-$pkgrel else diff --git a/src/fullpkg/fullpkg-find b/src/fullpkg/fullpkg-find index 57819c3..a96bc8a 100755 --- a/src/fullpkg/fullpkg-find +++ b/src/fullpkg/fullpkg-find @@ -126,7 +126,8 @@ find_deps() { tr ' ' "\n" | \ sort -u)) - for _dep in ${deps[@]}; do + local _dep + for _dep in "${deps[@]}"; do local found=false # May fail, e.g. since abslibre-mips64el doesn't include -- cgit v1.2.3-54-g00ecf From 4024d5396973dcd9403f26efafc87309e6f2e124 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 4 Nov 2013 11:23:53 -0500 Subject: fullpkg: respect TMPDIR --- src/fullpkg/fullpkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fullpkg/fullpkg b/src/fullpkg/fullpkg index 00a9502..978cf7b 100755 --- a/src/fullpkg/fullpkg +++ b/src/fullpkg/fullpkg @@ -29,7 +29,7 @@ done shift $(( OPTIND - 1 )) -build_dir="${1:-$(mktemp -d /tmp/fullpkg.XXXXXX)}" +build_dir="${1:-$(mktemp --tmpdir -d fullpkg.XXXXXXXXXX)}" fullpkg-find "$build_dir" && fullpkg-build -N "$build_dir" exit 0 -- cgit v1.2.3-54-g00ecf From c230cf6bea67623b3741720255a2acc0075a7965 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 4 Nov 2013 11:24:25 -0500 Subject: librerelease: mention `gpg-agent --daemon` instead of just `gpg-agent` --- src/abslibre-tools/librerelease | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index d133571..70ff416 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -81,7 +81,7 @@ create_signature() { sign_packages() { if [[ -z "${GPG_AGENT_INFO}" ]]; then - warning "It's better to use gpg-agent to sign packages in batches" + warning "It's better to have \`%s\` running to sign packages in batches" 'gpg-agent --daemon' fi for package in $(find "${WORKDIR}/staging/" -type f -iname '*.pkg.tar.?z'); do -- cgit v1.2.3-54-g00ecf From 66924443eaf0d4342531323d00add4e14498b76f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 4 Nov 2013 11:25:14 -0500 Subject: librerelease: don't redirect output of gpg --detach-sign This should fix fauno's issue with pinentry-curses, or at least fail more verbosely. --- src/abslibre-tools/librerelease | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index 70ff416..b77b6ec 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -68,7 +68,7 @@ create_signature() { SIGNWITHKEY="-u ${GPGKEY}" fi # The signature will be generated directly in ascii-friendly format - gpg --detach-sign --use-agent ${SIGNWITHKEY} "$filename" &>/dev/null || ret=$? + gpg --detach-sign --use-agent ${SIGNWITHKEY} "$filename" || ret=$? if (( ! ret )); then -- cgit v1.2.3-54-g00ecf From 6a395c595a1aff501f5edc6b726e929476331b56 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 4 Nov 2013 11:25:50 -0500 Subject: treepkg: fail early if there is a configuration error --- src/treepkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/treepkg b/src/treepkg index 0f6d605..e509dac 100755 --- a/src/treepkg +++ b/src/treepkg @@ -19,7 +19,7 @@ source libremessages source $(librelib conf.sh) load_files libretools -check_vars libretools HOOKPREBUILD FULLBUILDCMD HOOKLOCALRELEASE +check_vars libretools HOOKPREBUILD FULLBUILDCMD HOOKLOCALRELEASE || exit 1 load_files makepkg term_title "$(basename $0)" -- cgit v1.2.3-54-g00ecf From 33715e2d293ebb16b388167085b15647f90b720a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 4 Nov 2013 11:31:08 -0500 Subject: libremessages(1): clarify when gettext is used. --- src/lib/libremessages.1.ronn | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/libremessages.1.ronn b/src/lib/libremessages.1.ronn index 970b950..b91a958 100644 --- a/src/lib/libremessages.1.ronn +++ b/src/lib/libremessages.1.ronn @@ -51,6 +51,8 @@ the command `help printf` from a Bash shell for more information. ### GENERAL ROUTINES +Unless otherwise noted, these do not implicitly call `gettext`. + * `_` : If `gettext` is available, calls `gettext`, otherwise just prints the arguments given. @@ -61,7 +63,7 @@ the command `help printf` from a Bash shell for more information. * `panic`: For the times when you can't reasonably continue, similar to - "assert" in some languages. + "assert" in some programming languages. * `term_title` ...: Joins all arguments with whitespace, and sets the terminal title @@ -72,6 +74,8 @@ the command `help printf` from a Bash shell for more information. These routines print to standard output, ande are useful for printing word-wrapped prose. +For each of these, is fed through `gettext` automatically. + * `print` [...]: Like `printf`(1), but `gettext`-aware, and automatically prints a trailing newline. @@ -102,6 +106,8 @@ These routines print to standard error, and all take arguments in the same format as `printf`(1), except for `stat_done`, which doesn't take any arguments. +For each of these, is fed through `gettext` automatically. + * `plain` [...]: Prints "plain" message in bold, indented with 4 spaces. -- cgit v1.2.3-54-g00ecf From b195c3f87ab2910f76bec71fec659752aa7f6c5a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 4 Nov 2013 12:51:14 -0500 Subject: createworkdir: clean up output --- src/abslibre-tools/createworkdir | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/abslibre-tools/createworkdir b/src/abslibre-tools/createworkdir index 8e88375..4421ae2 100755 --- a/src/abslibre-tools/createworkdir +++ b/src/abslibre-tools/createworkdir @@ -42,10 +42,11 @@ if ! "${cmd[@]}"; then plain "Try running this command:" echo printf '%q ' "${cmd[@]}" + echo exit 1 fi msg "Finished, your packaging directory tree looks like this now:" -ls --color=always "${WORKDIR}"/*/* +ls --color=always "${WORKDIR}"/* trap -- EXIT -- cgit v1.2.3-54-g00ecf From ce38f1a98210191755945a0e018ff871f422d0d0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 4 Nov 2013 12:51:30 -0500 Subject: gitget: fix option parsing --- src/gitget/gitget | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gitget/gitget b/src/gitget/gitget index 256b4e4..194ec05 100755 --- a/src/gitget/gitget +++ b/src/gitget/gitget @@ -191,6 +191,7 @@ main() { *) usage >&2; return 1;; esac done + shift $(($OPTIND - 1)) [[ $# == 3 ]] || { usage >&2; return 1; } local mode=$1 local url=${2#git+} @@ -198,6 +199,9 @@ main() { local urlmain=${url%%#*} local urlfrag=${url#*#} + if [[ "$urlfrag" == "$urlmain" ]]; then + urlfrag='' + fi local ref=${urlfrag#*=} if [[ -z $ref ]]; then -- cgit v1.2.3-54-g00ecf From 3badc2fc023259c725491d69d0de63fdb99f205c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 4 Nov 2013 12:51:57 -0500 Subject: libretools.conf: fix typo --- src/libretools.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libretools.conf b/src/libretools.conf index 50ded8b..ff03b3a 100644 --- a/src/libretools.conf +++ b/src/libretools.conf @@ -28,7 +28,7 @@ ARCHES=('x86_64' 'i686' 'mips64el') ## ABSLibre ## Used by `createworkdir` -ABSLIBREREGV=git://projects.parabolagnulinux.org/abslibre.git +ABSLIBRERECV=git://projects.parabolagnulinux.org/abslibre.git ABSLIBRESEND=ssh://git@projects.parabolagnulinux.org:1863/srv/git/abslibre.git ################################################################################ -- cgit v1.2.3-54-g00ecf From e1c883572ab25d5502cae13869709ed9d94400e6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 4 Nov 2013 12:52:28 -0500 Subject: libretools.conf: base WORKDIR off of $LIBREHOME, not /home/$LIBREUSER --- src/libretools.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libretools.conf b/src/libretools.conf index ff03b3a..17f853e 100644 --- a/src/libretools.conf +++ b/src/libretools.conf @@ -5,7 +5,7 @@ ################################################################################ # The dir where you work on -WORKDIR=/home/$LIBREUSER/packages +WORKDIR="$LIBREHOME/packages" ## Blacklist URL BLACKLIST=https://repo.parabolagnulinux.org/docs/blacklist.txt -- cgit v1.2.3-54-g00ecf From 69121ee97028f975bf93ef0c7a70fb6d390c2d83 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 7 Nov 2013 11:20:17 -0500 Subject: libremakepkg: useless use of `cat` --- src/chroot-tools/hooks-distcc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chroot-tools/hooks-distcc.sh b/src/chroot-tools/hooks-distcc.sh index 9e42242..d8d708a 100644 --- a/src/chroot-tools/hooks-distcc.sh +++ b/src/chroot-tools/hooks-distcc.sh @@ -75,7 +75,7 @@ distcc_stop() { if [[ -f "$copydir/run/distcc-tool.pid" ]]; then - odaemon=$(cat "$copydir/distcc-tool.pid") + odaemon=$(< "$copydir/distcc-tool.pid") kill -- "$odaemon" rm -f -- \ -- cgit v1.2.3-54-g00ecf From 0f03eb7ac94ad72f551eb1b2470b850d6bcf8bf0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 12 Nov 2013 14:12:12 -0500 Subject: is_built: needs libremessages --- src/is_built | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/is_built b/src/is_built index 6def815..ba5f061 100755 --- a/src/is_built +++ b/src/is_built @@ -1,5 +1,7 @@ #!/usr/bin/env bash +. libremessages + usage() { print "Usage: %s [-h] PKGNAME [PKGVER]" "${0##*/}" "${0##*/}" print 'Detect iv a given package (version) is already in the repos' -- cgit v1.2.3-54-g00ecf From 9afe5dec0e21122bd81941f420c987da48173559 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 16 Nov 2013 15:19:17 -0500 Subject: makechrootpkg.sh: The delete message always said 'temporary copy' --- src/chroot-tools/makechrootpkg.sh.patch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch index 4082bdd..4dd1146 100644 --- a/src/chroot-tools/makechrootpkg.sh.patch +++ b/src/chroot-tools/makechrootpkg.sh.patch @@ -1,5 +1,5 @@ ---- makechrootpkg.sh.in 2013-10-15 21:33:17.000000000 -0400 -+++ makechrootpkg.sh.ugly 2013-10-25 19:05:08.000000000 -0400 +--- makechrootpkg.sh.in 2013-10-26 14:53:57.000000000 -0400 ++++ makechrootpkg.sh.ugly 2013-11-16 15:14:04.000000000 -0500 @@ -12,6 +12,7 @@ shopt -s nullglob @@ -92,7 +92,7 @@ # Get a read lock on the root chroot to make # sure we don't clone a half-updated chroot slock 8 "$chrootdir/root.lock" "Locking clean chroot" -@@ -154,10 +171,15 @@ +@@ -154,11 +171,16 @@ # Drop the read lock again lock_close 8 @@ -100,6 +100,7 @@ } -clean_temporary() { +- stat_busy "Removing temporary copy [%s]" "$copy" +# Usage: delete_chroot $copydir [$copy] +delete_chroot() { + local copydir=$1 @@ -107,9 +108,10 @@ + # Detect chrootdir filesystem type + local chroottype=$(stat -f -c %T "$copydir") + - stat_busy "Removing temporary copy [%s]" "$copy" ++ stat_busy "Removing chroot copy [%s]" "$copy" if [[ "$chroottype" == btrfs ]]; then btrfs subvolume delete "$copydir" >/dev/null || + die "Unable to delete subvolume %s" "$copydir" @@ -173,9 +195,14 @@ stat_done } -- cgit v1.2.3-54-g00ecf From ad559c83b26bc3c1d50afc8140ce3d4191b3c4b0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 16 Nov 2013 15:25:44 -0500 Subject: Add a HACKING.md file --- HACKING.md | 223 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 223 insertions(+) create mode 100644 HACKING.md diff --git a/HACKING.md b/HACKING.md new file mode 100644 index 0000000..73556a4 --- /dev/null +++ b/HACKING.md @@ -0,0 +1,223 @@ +This document is a little all over the place--I've been working on it +for a while, but I keep refactoring it as I move pieces of it into man +pages and whatnot. It's mostly a brain dump, sorry. + +There are three parts to this; procedures, "content" guidelines and +"style" guidelines. The style guidelines are less strict; as long as +things are consistent at the file-level, I'm pretty happy. + +Contributing +============ + +I'd love to have your patches! Code should be hackable; if you want +to modify something, but can't figure out how: 1) ping me for help, 2) +it probably means the code was too complicated in the first place. + +Patches should be sent to ; please put +"[PATCH]" and "libretools" in the subject line. If you have commit +access, but want me to look over it first, feel free to create a new +branch in git, and I will notice it. Try to avoid pushing to the +"master" branch unless it's a trivial change; it makes it easier to +review things; though I *will* look over every commit before I do a +release, so don't think you can sneak something in :) + +I'd love to discuss possible changes on IRC (I'm lukeshu), either on +irc.freenode.net#parabola or in personal messages. My account may be +online even if I'm not; I will eventually see your it, I do a search +for mentions of "luke" on #parabola every time I get on. + +Code content +============ + +Be aware of the `librelib(7)` library suite, which lives `src/lib`. +It is a suite of Bash libraries that will help you out. Most of the +people looking at the libretools code are familiar with the `messages` +part of it, which actually contains a much of utility routines, not +just message printing. There is also a library for dealing with +`blacklist.txt`, and one for loading configuration files and +PKGBUILDs. These are common tasks, but are tricky to handle +consistently--the libraries are there to make things easier. Take a +look at the man pages. + +Message printing: All of the message printing routines, except for +`term_title` and `flag`, take printf-type arguments. Take advantage +of that; don't use string interpolation (don't do `"foo ${var} +bar"`). The reason for this is that if you don't do string +interpolation, messages can be automatically internationalized. +(Internationalization is incomplete at the momement) + +Message printing: The in `--help`/`-h` text, use `print` to print +lines that should not wrap, `echo` to print blank lines, `prose` to +print paragraphs, `bullet` to print bullet points, and `flag` to print +option flags. The text should follow this general format: + + print |Usage: ${program} [OPTIONS] VARS_ARE_UNDERSCORE_AND_CAPITAL + print |One line description of program, no period + echo + prose |More details. This is a paragraph. + echo + print |Options: + flag | -h Show this message + +In the "Usage:" line, use printf `%s` and the value `"${0##*/}"` to +determine the program name at runtime. + +There used to be guidelines for how to align the option flags and +descriptions, but now the `flag` command exists takes care of it for +you. Yay for things being easier! + +When using `set -u`, `set -e`, or `trap`, you should also use `set -E` +to have the error handling be passed down to subshells. + +Feel free to use `set -e` (fail on error), but be careful of the +caveats (there are a bunch of them); don't assume all errors are +checked because of it. + +Use `set -u` if you can; it makes using an unset variable an error. + - If a variable not being set is valid (perhaps a configuration + option), use `${var:-}` when accessing it to suppress the error. + - An empty array counts as unset, so if you have an array that may be + empty, use `set +u` before accessing it. + - The reason for this is that a normal string variable is basically + an array with length=1; an unset variable looks like an array + with length=0. Weird stuff. + +In the shebang, use `#!/usr/bin/env bash`. This allows us to not +hardcode the location of bash (I'm not sure why this is useful for +something distro-dependent like libretools, but fauno seems to have a +use-case for it). + +In the shebang, don't pass flags to bash, besides breaking `env` +(above), it means people will make mistakes when debugging, and +running things with `bash FILENAME`. Instead, use `set` to adjust the +flags inside of the program. + +Obey `$TMPDIR`. It's usually as easy as passing `--tmpdir` to +`mktemp`. + +Use `trap` to clean up your temporary files. This way, even if your +program terminates early, things will be cleaned up. + +Bash best practices +=================== + +Basically, know what you are doing, and be safe with it. The problem +is that most people don't know about safe bash scripting. + +A lot of people look at the "Advanced Bash Scripting" ebook--DO NOT do +that, it is trash... though it contains a "reference card" page that +may be useful and isn't trash. + +Take a look at Gentoo's Bash guidelines +. +They're pretty good, and cover most of the "gotcha's" about Bash +syntax. It mentions but discourages the use of Bash 3 +features... why? Who still uses Bash 2? Feel free to use Bash 4 +features! + +I wrote an article on Bash arrays +. A lot of people think +they're tricky, but they're simple once you know how they work. It's +short enough that you should read the whole thing. Know the +difference between `"${array[@]}"` and `"${array[*]}"`. And I'll say +it again here, ALWAYS wrap those in double quotes; there is no reason +I can think of that the unquoted behavior would ever be the correct +thing. + +My brief rules of thumb: + + - Quote every variable. + - That includes arrays: `"${array[@]}"` and `"${array[*]}"`. + - In most (but not all!) cases inside of `[[ ... ]]` conditions, + variables don't need to be quoted. When in doubt, quote them. + - When assigning one variable to another, you don't need quotes; + you don't need quotes for `foo=$bar` + - Try to avoid global variables; declare all variables in functions + with `local`. + - Or `declare`; inside of a function, unless you pass the `-g` + flag, `declare` makes the variable local. + - Use `local VAR` before a `for VAR in LIST` loop--the variable is created in the + current scope, not the scope of the loop. + - Feeding input to `while` loops is weird because of how subshells + work: + + # Input from a file + # BAD + cat file | while read line; do + ... + done + # GOOD + while read line; do + ... + done Date: Thu, 28 Nov 2013 00:36:38 -0500 Subject: fix typos in HACKING.md --- HACKING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HACKING.md b/HACKING.md index 73556a4..2e5937b 100644 --- a/HACKING.md +++ b/HACKING.md @@ -159,7 +159,7 @@ My brief rules of thumb: # GOOD while read line; do ... - done <(prog) + done < <(prog) Style guidelines @@ -181,7 +181,7 @@ space) } The `; then` and `; do` should go on the same line as -`if`/`elif`/`for`/`while`. Also, there is no space before th `;`. +`if`/`elif`/`for`/`while`. Also, there is no space before the `;`. Prefer the `for VAR in LIST` syntax over the `for ((init; cond; inc))` syntax, when possible. For example (heh, `for` example): -- cgit v1.2.3-54-g00ecf From 92ce5b8ce36f849b47b72c2e3b315abb6b6767f1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 28 Nov 2013 00:39:22 -0500 Subject: add an INSTALL file --- INSTALL | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 INSTALL diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..f25c466 --- /dev/null +++ b/INSTALL @@ -0,0 +1,119 @@ +Installation of libretools is pretty straight-forward. The only +tricky thing is the weird dependence on the devtools-par source code. + +The build system will by default look at `$(topdir)/../devtools-par` +for the devtools-par source code. This can be changed by adjusting +the `devtoolsdir` configuration variable, see "Configuration" below. + +Once you have the devtools source taken care of, you can have the +default everything-included install by running: + + $ make + # make install + +Dependencies +------------ + +Unlike a lot of software, run-time dependencies are not required at +build-time. + +Libretools is mostly shell scripts. It very specifically targets +Parabola GNU/Linux-libre; there are a lot of dependencies, most of +which are undocumented. Switching away from a GNU user-land is bound +to cause issues. + +## Build dependencies + +The "unusual" build-time dependencies are: + + - GNU Make -- other `make`s will not work. + - GNU sed -- must support `-r` for ERE; BSD sed uses `-E` for this purpose. + - Emacs -- `emacs --batch` is used use Emacs Lisp to process some text. + - ronn -- A markdown-to-manpage converter + +At this time, the build system dos not support not building the +documentation; ronn is required. + +Additionally, other usual "core utilities" are required: + + cat, chmod, cp, echo, false, find, install, ln, msguniq, rm, tr, + xgettext + +Also, `/bin/sh` must support `{brace,expansion}`. If it doesn't, find +a shell that does, and configure `make` to use it. Though, because +libretools is mostly shell scripts, if you deviate too much from a GNU +command-line environment, I suspect that you will run into more +issues. If I were targeting anything other than Parabola, this would +be a bigger issue. + +## Test suite dependencies + +If you wish to run the test suite, you will need the "roundup" shell +unit testing program. On Parabola GNU/Linux-libre it is called +"sh-roundup". If your operating system doesn't have it, it is +available at . + +## Run-time dependencies + +Being mostly shell scripts, many external program are used. Anything +that is included when installing the `base` package group on Parabola +GNU/Linux, I consider an implicit dependency. If something isn't used +now, that doesn't mean it won't be in the future. + +On top of that, the following dependencies are also needed: + +librelib subpackage: + - wget +gitget subpackage: + - librelib (provided) + - git +main libretools subpackage: + - librelib (provided) + - gitget (provided, only needed for `createworkdir`) + - arch-install-scripts + - ssh client (OpenSSH, only needed for `librerelease` + - rsync + - subversion + - tokyocabinet +libretools-mips64el subpackage: + - libretools (provided) + - git + +Configuration +------------- + +This is not a GNU package, there is no `./configure` script. + +There are two ways to set configuration variables: + 1. Edit config.mk + 2. Pass `VARIABLE=VALUE` to `make` + +The configuration variables mostly match GNU packages, but default +values differ; libretools installs to `prefix=/usr` by default instead +of GNU's `prefix=/usr/local`. + +Building and installing subpackages +----------------------------------- + +There are several subpackages you can build and install. This is done +by running: + + $ make build-${package} + # make install-${package} + +respectively. In addition to `build` and `install`, the activities +you can do are: + + - `copy` -- copy necessary files from the devtools-par source code + - `build` -- build all programs and files + - `install` -- install everything + - `clean` -- remove generated files + - `pot` -- generate gettext portable object template files. + +The subpackages you can run these on are: + + - doc -- The non-manpage documentation + - libretools -- The main libretools package + - libretools-mips64el -- Programs useful for porting to mips64el + - librelib -- generic libraries included + - gitget -- A git downloader -- cgit v1.2.3-54-g00ecf From 91c74601d0e6839e88074a8d2ce3fcfd347b35e5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 3 Jan 2014 02:07:30 -0500 Subject: Phase out DIFFTOOL for DIFFPROG (issue #438) https://labs.parabola.nu/issues/438 --- src/abslibre-tools/diff-unfree | 4 ++-- src/aur | 4 ++-- src/lib/conf.sh | 4 ++++ src/libretools.conf | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/abslibre-tools/diff-unfree b/src/abslibre-tools/diff-unfree index b3e2327..1ef0649 100755 --- a/src/abslibre-tools/diff-unfree +++ b/src/abslibre-tools/diff-unfree @@ -23,7 +23,7 @@ . libremessages . $(librelib conf.sh) load_files libretools -check_vars libretools DIFFTOOL || exit 1 +check_vars libretools DIFFPROG || exit 1 usage() { print "Usage: %s [community|packages] [unfree-package] [repo]" "${0##*/}" @@ -80,7 +80,7 @@ main() { for _file in ${unfree_dir}/*; do msg2 "%s" "$(basename "${_file}")" - ${DIFFTOOL} "$PWD/$(basename "${_file}")" "${_file}" + ${DIFFPROG} "$PWD/$(basename "${_file}")" "${_file}" done } diff --git a/src/aur b/src/aur index 2fc7142..2d1efbb 100755 --- a/src/aur +++ b/src/aur @@ -45,7 +45,7 @@ main() { . $(librelib conf.sh) load_files libretools - check_vars libretools DIFFTOOL || exit 1 + check_vars libretools DIFFPROG || exit 1 local startdir="$(pwd)" local missing_deps=() @@ -88,7 +88,7 @@ main() { if ! cmp -s "${copy_old}/${file}" "${copy_new}/${file}" ; then warning "%s != %s" "${copy_old}/${file}" "${copy_new}/${file}" diffed=true - "${DIFFTOOL}" "${copy_old}/${file}" "${copy_new}/${file}" + "${DIFFPROG}" "${copy_old}/${file}" "${copy_new}/${file}" fi done if $diffed; then diff --git a/src/lib/conf.sh b/src/lib/conf.sh index 7555794..0a6fb89 100644 --- a/src/lib/conf.sh +++ b/src/lib/conf.sh @@ -73,6 +73,10 @@ list_envvars() { PKGEXT SRCEXT \ GPGKEY PACKAGER ;; + libretools) + printf '%s\n' \ + DIFFPROG + ;; *) :;; esac } diff --git a/src/libretools.conf b/src/libretools.conf index 17f853e..ff989f0 100644 --- a/src/libretools.conf +++ b/src/libretools.conf @@ -12,7 +12,7 @@ BLACKLIST=https://repo.parabolagnulinux.org/docs/blacklist.txt ## Diff tool (vimdiff, gvimdiff, meld, etc) ## Used by `aur`, `diff-unfree` -DIFFTOOL=`which kdiff3 meld gvimdiff vimdiff colordiff diff 2>/dev/null|sed 's/\s.*//;1q'` +DIFFPROG=`which kdiff3 meld gvimdiff vimdiff colordiff diff 2>/dev/null|sed 's/\s.*//;1q'` ## The repos you'll be packaging for ## Used by `toru`, `createworkdir` -- cgit v1.2.3-54-g00ecf From 58e2a9cd5aa9a4eb80f8da675685f62aca128eb3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 3 Jan 2014 02:10:02 -0500 Subject: librefetch: change default MIRROR location --- src/librefetch/librefetch.conf | 2 +- src/librefetch/librefetch.conf.5.ronn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librefetch/librefetch.conf b/src/librefetch/librefetch.conf index 40d2078..ce328d8 100644 --- a/src/librefetch/librefetch.conf +++ b/src/librefetch/librefetch.conf @@ -1,2 +1,2 @@ -MIRROR='https://repo.parabolagnulinux.org/sources/' +MIRROR='https://repo.parabolagnulinux.org/other/' DOWNLOADER='/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u' diff --git a/src/librefetch/librefetch.conf.5.ronn b/src/librefetch/librefetch.conf.5.ronn index 3d80ab5..4e59877 100644 --- a/src/librefetch/librefetch.conf.5.ronn +++ b/src/librefetch/librefetch.conf.5.ronn @@ -24,7 +24,7 @@ If `$XDG_CONFIG_HOME` is not set, a default value is set: ## OPTIONS - * `MIRROR='https://repo.parabolagnulinux.org/sources/'`: + * `MIRROR='https://repo.parabolagnulinux.org/other/'`: The location to download pre-built source tarball in download mode. * `DOWNLOADER='/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'`: -- cgit v1.2.3-54-g00ecf