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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(+) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(-) (limited to 'src') 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(+) (limited to 'src') 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(-) (limited to 'src') 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 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(-) (limited to 'src') 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(-) (limited to 'src') 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