From 4d156213b19def55ab8b8ddcb15c5b57040bbe1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Thu, 20 Jun 2013 18:22:00 -0300 Subject: Be able to ignore packages - export I="glibc binutils gcc" --- treepkg | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/treepkg b/treepkg index ee4964d..1350428 100755 --- a/treepkg +++ b/treepkg @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #set -x # (c) 2012 Nicolás Reynolds # @@ -127,6 +127,7 @@ BUILD=${B:-true} CLEANUP=${C:-true} # Skip BUILDORDER creation and build anything on BUILDDIR BUILDNOW=${N:-false} +IGNORE=${I:-} if [ ! -z "${1}" -a ${DEPTH} -eq 0 ]; then BUILDNOW=true @@ -138,6 +139,12 @@ if ! ${BUILDNOW}; then # If this package is already built quit silently for _pkg in ${pkgname[@]}; do + + echo "${IGNORE[@]}" | grep -q ${_pkg} && { + add_order "ignore" + exit 0 + } + if is_built "${_pkg}" "${fullver}"; then add_order "ignore" exit 0 -- cgit v1.2.2 From a20d4c7fc88f07e747536d8520eb1d041b64b2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Thu, 20 Jun 2013 18:22:30 -0300 Subject: Show diff between repos --- repo-diff | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 repo-diff diff --git a/repo-diff b/repo-diff new file mode 100755 index 0000000..7527381 --- /dev/null +++ b/repo-diff @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# Shows a diff between repo databases + +if test $# -eq 0; then + printf "$(gettext "Compares two repo databases using distro/repo/architecture format + +Usage: +\t%s arch/core/i686 parabola/core/i686 + +Shortcuts: +\tarch \texpands to archlinux repo url repo +\tparabola\texpands to parabola repo url\n")" ${0##*/} + exit 0 +fi + +b() { bsdtar ztf $1 | cut -d "/" -f1 | sort -u ; } +n() { echo "$1".db | tr "/" "-"; } + +# hopefully simple way to convert +# parabola/libre/i686 +# to +# http://repo.parabolagnulinux.org/libre/os/i686/libre.db +# add more distros here +g() { + echo "$1" | sed -e "s,^\([^/]\+\)/\([^/]\+\)/\([^/]\+\)$,\1/\2/os/\3/\2.db," \ + -e "s,^parabola/,http://repo.parabolagnulinux.org/," \ + -e "s,^arch\(linux\)\?/,http://mirrors.kernel.org/archlinux/," +} + +mkdir ${0##*/}.$$ +pushd ${0##*/}.$$ >/dev/null + +d="" +for i in $1 $2; do + n=$(n "$i") + + test -z "$n" && exit 1 + + wget -O "$n" -nv $(g "$i") + b "$n" >${n}.orig + + d+=" ${n}.orig" +done + +{ + printf "$(gettext "Difference between %s and %s")\n---\n" $1 $2 + which diffstat &>/dev/null && diff -auN ${d[@]} | diffstat + diff -auN ${d[@]} +} >../${n}.diff + +popd >/dev/null +rm -r ${0##*/}.$$ + +printf "$(gettext "Difference save on %s")\n" ${n}.diff -- cgit v1.2.2 From 43340dd5019bce02af94dc1717b6ad60b84a1ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Wed, 1 Jan 2014 22:22:33 -0300 Subject: cleanup after release --- mips64el/mipsrelease | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mips64el/mipsrelease b/mips64el/mipsrelease index 4d7a7de..586adfc 100755 --- a/mips64el/mipsrelease +++ b/mips64el/mipsrelease @@ -43,7 +43,7 @@ fi source PKGBUILD fullver=$(get_full_version ${epoch:-0} ${pkgver} ${pkgrel}) pkgs=() -makepkg --source -f --skippgpcheck +makepkg --source -f --skippgpcheck -c msg "Adding packages to [stage3]..." for name in ${pkgname[@]}; do -- cgit v1.2.2 From 7f3926f2aab774eacc5fc5963725d44c70f50bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Wed, 1 Jan 2014 22:22:59 -0300 Subject: minor checks --- treepkg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/treepkg b/treepkg index 1350428..dc2575d 100755 --- a/treepkg +++ b/treepkg @@ -127,7 +127,7 @@ BUILD=${B:-true} CLEANUP=${C:-true} # Skip BUILDORDER creation and build anything on BUILDDIR BUILDNOW=${N:-false} -IGNORE=${I:-} +IGNORE=${I} if [ ! -z "${1}" -a ${DEPTH} -eq 0 ]; then BUILDNOW=true @@ -233,7 +233,7 @@ if [ ${DEPTH} -eq 0 ]; then ${VERBOSE} || echo "${BUILDORDER}" || true fi -if ${CLEANUP} ; then +if (( CLEANUP )) ; then msg2 "Removing ${BUILDDIR}" rm -rf "${BUILDDIR}" fi -- cgit v1.2.2 From 048ae6172b791ab9f5ae7cce022ba9f6d39dac18 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 3 Jan 2014 22:22:01 -0500 Subject: touch up misc qouting --- src/fullpkg/fullpkg-find | 4 ++-- src/treepkg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fullpkg/fullpkg-find b/src/fullpkg/fullpkg-find index a96bc8a..2a5fc44 100755 --- a/src/fullpkg/fullpkg-find +++ b/src/fullpkg/fullpkg-find @@ -51,7 +51,7 @@ # Get repo name. Asumes ${ABSROOT}/repo/package/PKGBUILD guess_repo() { - basename $(dirname $(pwd)) + basename "$(dirname "$(pwd)")" } # This function is stolen from makechrootpkg. @@ -139,7 +139,7 @@ find_deps() { pushd "${pkgdir}" > /dev/null # runs itself on dep's PKGBUILD dir - $0 -l ${next_level} ${build_dir} || return $? + "$0" -l "${next_level}" "${build_dir}" || return $? popd > /dev/null fi diff --git a/src/treepkg b/src/treepkg index e509dac..8879e54 100755 --- a/src/treepkg +++ b/src/treepkg @@ -22,7 +22,7 @@ load_files libretools check_vars libretools HOOKPREBUILD FULLBUILDCMD HOOKLOCALRELEASE || exit 1 load_files makepkg -term_title "$(basename $0)" +term_title "${0##*/}" # End inmediately but print an useful message trap_exit() { -- cgit v1.2.2 From fcddad60721db6dceb4858fc752f109c954e54e2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 3 Jan 2014 22:25:33 -0500 Subject: fullpkg-find: touch up dependency listing --- src/fullpkg/fullpkg-find | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/fullpkg/fullpkg-find b/src/fullpkg/fullpkg-find index 2a5fc44..f1b9573 100755 --- a/src/fullpkg/fullpkg-find +++ b/src/fullpkg/fullpkg-find @@ -120,11 +120,12 @@ find_deps() { ## Check next levels declare -i next_level=$LEVEL+1 - # All deps in separate line, only once, without version. - deps=($(echo "${depends[@]} ${makedepends[@]}" | \ - sed "s/[=<>]\+[^ ]\+//g" | \ - tr ' ' "\n" | \ - sort -u)) + # All deps + local deps=("${depends[@]}" "${makedepends[@]}" "${checkdepends[@]}") + # Strip version specifiers + deps=("${deps[@]%%[=<>]*}") + # Filter out duplicates + read -d $'\n' -a deps <<<"$(printf '%s\n' "${deps[@]}"|sort -u)" local _dep for _dep in "${deps[@]}"; do -- cgit v1.2.2 From 0318548c81d95cc2483aaf44e63f487650a74f87 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 3 Jan 2014 22:33:48 -0500 Subject: librefetch: accept HTTP URLs, but don't create if they aren't in $MIRROR But, don't update the documentation. I have a feeling things will change again in the next few commits. --- src/librefetch/librefetch | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 93bcd1e..e963b96 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -127,12 +127,12 @@ main() { local src dst case ${#extra_opts[@]} in 1) - src="${extra_opts[0]#*://}" - dst="$(readlink -m -- "${src##*/}")" + src="${extra_opts[0]}" + dst="${src##*/}" ;; 2) - src="${extra_opts[0]#*://}" - dst="$(readlink -m -- "${extra_opts[1]}")" + src="${extra_opts[0]}" + dst="${extra_opts[1]}" ;; *) print "%s: %d non-flag arguments found, expected 1 or 2: %s" "$cmd" ${#extra_opts[@]} >> /dev/stderr @@ -140,17 +140,25 @@ main() { return 1 esac + if [[ "$src" == libre://* ]]; then + src="${MIRROR}/${src#libre://}" + fi + + if [[ "$src" != "$MIRROR"* ]]; then + # inhibit create + mode=download + fi + dst="$(readlink -m -- "$dst")" # canonicalize $dst + # Mode: download ####################################################### if [[ $mode =~ download ]]; then load_files librefetch check_vars librefetch MIRROR DOWNLOADER || return 1 - local url="${MIRROR}/${src}" - local dlcmd="${DOWNLOADER}" dlcmd="${dlcmd//\%o/\"$dst\"}" - dlcmd="${dlcmd//\%u/\"$url\"}" + dlcmd="${dlcmd//\%u/\"$src\"}" { eval "$dlcmd"; } >> /dev/stderr && return 0 fi -- cgit v1.2.2 From 0f078d1763a156993c372a49ae0f8ceefde52444 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 3 Jan 2014 22:34:23 -0500 Subject: librefetch: partially update the docs --- src/librefetch/librefetch | 8 +++++--- src/librefetch/librefetch.conf.5.ronn | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index e963b96..42253b2 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -37,9 +37,11 @@ usage() { prose "If OUTPUT_FILE isn't specified, it defaults to the non-directory part of SOURCE_URL, in the current directory." echo - prose "In download mode, the glob '*://' is stripped from the beginning - of SOURCE_URL, and the resulting path is attempted to be - downloaded from the configured mirror." + prose "Unless '-C' is specified, if SOURCE_URL does not begin with the + configured mirror, create mode is inhibited." + echo + prose "In download mode, it simply tries to download SOURCE_URL. At the + beginning of a URL, 'libre://' expands to the configured mirror." echo prose "In create mode, it looks at a build script, and uses that to create the source tarball. SOURCE_URL is ignored, except that it diff --git a/src/librefetch/librefetch.conf.5.ronn b/src/librefetch/librefetch.conf.5.ronn index 4e59877..7b25400 100644 --- a/src/librefetch/librefetch.conf.5.ronn +++ b/src/librefetch/librefetch.conf.5.ronn @@ -25,8 +25,9 @@ If `$XDG_CONFIG_HOME` is not set, a default value is set: ## OPTIONS * `MIRROR='https://repo.parabolagnulinux.org/other/'`: - The location to download pre-built source tarball in download - mode. + Files from within this tree will be attempted to be built if + downloading them fails. Also, `libre://` expands to this + location. * `DOWNLOADER='/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'`: The HTTP client to use when downloading pre-built source tarballs in download mode. -- cgit v1.2.2 From 6eb64cb5bdce43fb5b1a83f93496083761ea2718 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 4 Jan 2014 19:37:33 -0500 Subject: librefetch: clean up option parsing --- src/librefetch/librefetch | 74 +++++++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 42253b2..eb7eb61 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -99,11 +99,6 @@ main() { # Mode: checksums ###################################################### if [[ $mode =~ checksums ]]; then - if [[ ${#extra_opts[@]} != 0 ]]; then - print "%s: found extra non-flag arguments: %s" "$cmd" "${extra_opts[*]}" >> /dev/stderr - usage >> /dev/stderr - return 1 - fi "$makepkg" "${makepkg_opts[@]}" -g -p "$srcbuild" | case ${BUILDFILE##*/} in PKGBUILD) sed -e 's/^[a-z]/mk&/' -e 's/^\s/ &/';; @@ -115,42 +110,27 @@ main() { # Mode: print ########################################################## if [[ $mode =~ print ]]; then - if [[ ${#extra_opts[@]} != 0 ]]; then - print "%s: found extra non-flag arguments: %s" "$cmd" "${extra_opts[*]}" >> /dev/stderr - usage >> /dev/stderr - return 1 - fi cat "$srcbuild" return 0 fi ######################################################################## - local src dst - case ${#extra_opts[@]} in - 1) - src="${extra_opts[0]}" - dst="${src##*/}" - ;; - 2) - src="${extra_opts[0]}" - dst="${extra_opts[1]}" - ;; - *) - print "%s: %d non-flag arguments found, expected 1 or 2: %s" "$cmd" ${#extra_opts[@]} >> /dev/stderr - usage >> /dev/stderr - return 1 - esac + local src="${extra_opts[0]}" + local dst="${extra_opts[1]:-${src##*/}}" + # canonicalize $src if [[ "$src" == libre://* ]]; then src="${MIRROR}/${src#libre://}" fi + # canonicalize $dst + dst="$(readlink -m -- "$dst")" + # check to see if $src is a candidate for create mode if [[ "$src" != "$MIRROR"* ]]; then # inhibit create mode=download fi - dst="$(readlink -m -- "$dst")" # canonicalize $dst # Mode: download ####################################################### @@ -179,10 +159,17 @@ main() { # sets the variables BUILDFILE, makepkg_opts, extra_opts, mode parse_options() { - # Detect makepkg options that take a second argument + # Detect makepkg options local makepkg_orig="$(which makepkg)" - local makepkg_opt2long=($("${makepkg_orig}" -h | sed -rn 's/\s*(--\S*) <.*/\1/p')) - local makepkg_opt2short=($("${makepkg_orig}" -h | sed -rn 's/\s*(-.) <.*/\1/p')) + # --long flags that take a second argument + local makepkg_opt2long=( $(LC_ALL=C "${makepkg_orig}" -h | sed -rn 's/\s*(--\S*) <.*/\1/p')) + # -s hort flags that take a second argument + local makepkg_opt2short=($(LC_ALL=C "${makepkg_orig}" -h | sed -rn 's/\s*(-.) <.*/\1/p')) + # all flags + local makepkg_argall=( $(LC_ALL=C "${makepkg_orig}" -h | sed -rn \ + -e 's/^ +(-.) .*/\1/p' \ + -e 's/^ +(-.), (--\S*) .*/\1\n\2/p' \ + -e 's/^ +(--\S*) .*/\1/p')) local opt local have_opt @@ -207,8 +194,13 @@ parse_options() { -p) BUILDFILE="$(readlink -m -- "$opt")";; -h|--help) mode=help;; -*) - makepkg_opts+=("$arg") - $have_opt && makepkg_opts+=("$opt") + if in_array "${arg}" "${makepkg_argall[@]}"; then + makepkg_opts+=("$arg") + $have_opt && makepkg_opts+=("$opt") + else + printf '%s: invalid flag: %s' "$cmd" "$arg" + return 1 + fi ;; --) shift; break;; *) extra_opts+=("$arg");; @@ -216,6 +208,26 @@ parse_options() { shift done extra_opts+=("$@") + + # check the number of extra_opts + case "$mode" in + help) # don't worry about it + :;; + checksums|print) # don't take any extra arguments + if [[ ${#extra_opts[@]} != 0 ]]; then + print "%s: found extra non-flag arguments: %s" "$cmd" "${extra_opts[*]}" >> /dev/stderr + usage >> /dev/stderr + return 1 + fi + ;; + *download*|*create*) # take 1 or 2 extra arguments + if [[ ${#extra_opts[@]} != 1 ]] && [[ ${#extra_opts[@]} != 2 ]]; then + print "%s: %d non-flag arguments found, expected 1 or 2: %s" "$cmd" ${#extra_opts[@]} >> /dev/stderr + usage >> /dev/stderr + return 1 + fi + ;; + esac } # Modify makepkg ############################################################### -- cgit v1.2.2 From 8698eb5f1dff6d046fb708d1e4f529d83e88cb4c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 4 Jan 2014 19:39:02 -0500 Subject: librefetch: Update the docs: `version` mode is gone, a while ago. --- src/librefetch/librefetch | 2 +- src/librefetch/librefetch.8.ronn | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index eb7eb61..6268d75 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -28,7 +28,7 @@ trap cleanup EXIT cmd=${0##*/} usage() { print "Usage: %s [OPTIONS] SOURCE_URL [OUTPUT_FILE]" "$cmd" - print "Usage: %s -[g|P|V|h]" "$cmd" + print "Usage: %s -[g|P|h]" "$cmd" print "Downloads or creates a liberated source tarball." echo prose "The default mode is to create OUTPUT_FILE, first by trying diff --git a/src/librefetch/librefetch.8.ronn b/src/librefetch/librefetch.8.ronn index c2b8ffe..16c3838 100644 --- a/src/librefetch/librefetch.8.ronn +++ b/src/librefetch/librefetch.8.ronn @@ -4,7 +4,7 @@ librefetch(8) -- downloads or creates a liberated source tarball ## SYNOPSIS `librefetch` [options] []
-`librefetch` -[g|V|h] +`librefetch` -[g|P|h] ## DESCRIPTION @@ -18,7 +18,7 @@ package adds `librefetch` as a download agent for `libre://` to `makepkg.conf`. Because of this, it is almost never necessary to call `librefetch` manually. -There are 7 modes: +There are 6 modes: * `download-create`: The default mode. First try `download` mode, then `create` mode. @@ -26,7 +26,6 @@ There are 7 modes: * `create`: Create the tarball from a `PKGBUILD`/`SRCBUILD`. * `checksums`: Generate integrity checks for source files. * `print`: Print the effective build script. - * `version`: Print `librefetch` version information. * `help`: Print `librefetch` usage information. ## OPTIONS @@ -39,7 +38,6 @@ There are 7 modes: * `-g` | `--geninteg`: Use `checksums` mode: Generate integrity checks for source files. * `-P` | `--print`: Use `print` mode: print the effective build script. - * `-V` | `--version`: Use `version` mode: Show version information. * `-h` | `--help`: Use `help` mode: Show useage information. ## CREATE MODE -- cgit v1.2.2 From f1487a80edac9e8f651f7bf2970e8fa4d2a9e971 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 3 Jan 2014 23:06:17 -0500 Subject: librefetch: defer canonicalizing $src until we've validated $MIRROR --- src/librefetch/librefetch | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 6268d75..3d7f667 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -119,18 +119,11 @@ main() { local src="${extra_opts[0]}" local dst="${extra_opts[1]:-${src##*/}}" - # canonicalize $src - if [[ "$src" == libre://* ]]; then - src="${MIRROR}/${src#libre://}" - fi - # canonicalize $dst - dst="$(readlink -m -- "$dst")" + # Don't canonicalize $src unless mode =~ download, and we've validated + # that $MIRROR is configured. - # check to see if $src is a candidate for create mode - if [[ "$src" != "$MIRROR"* ]]; then - # inhibit create - mode=download - fi + # Canonicalize $dst + dst="$(readlink -m -- "$dst")" # Mode: download ####################################################### @@ -138,6 +131,17 @@ main() { load_files librefetch check_vars librefetch MIRROR DOWNLOADER || return 1 + # Canonicalize $src + if [[ "$src" == libre://* ]]; then + src="${MIRROR}/${src#libre://}" + fi + + # check to see if $src is a candidate for create mode + if [[ "$src" != "$MIRROR"* ]]; then + # inhibit create + mode=download + fi + local dlcmd="${DOWNLOADER}" dlcmd="${dlcmd//\%o/\"$dst\"}" dlcmd="${dlcmd//\%u/\"$src\"}" -- cgit v1.2.2 From 403b4f20e5cfd2d2c0348de076effd3ddb616844 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 3 Jan 2014 23:07:13 -0500 Subject: librefetch: replace MIRROR with MIRRORS (but doesn't update the docs) --- src/librefetch/librefetch | 16 ++++++++++++---- src/librefetch/librefetch.conf | 5 ++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 3d7f667..61fc3ad 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -120,7 +120,7 @@ main() { local dst="${extra_opts[1]:-${src##*/}}" # Don't canonicalize $src unless mode =~ download, and we've validated - # that $MIRROR is configured. + # that $MIRRORS is configured. # Canonicalize $dst dst="$(readlink -m -- "$dst")" @@ -129,15 +129,23 @@ main() { if [[ $mode =~ download ]]; then load_files librefetch - check_vars librefetch MIRROR DOWNLOADER || return 1 + check_vars librefetch MIRRORS DOWNLOADER || return 1 # Canonicalize $src if [[ "$src" == libre://* ]]; then - src="${MIRROR}/${src#libre://}" + src="${MIRRORS[0]}/${src#libre://}" fi # check to see if $src is a candidate for create mode - if [[ "$src" != "$MIRROR"* ]]; then + local inmirror=false; + local mirror + for mirror in "${MIRRORS[@]}"; do + if [[ "$src" == "$mirror"* ]]; then + inmirror=true + break + fi + done + if ! $inmirror; then # inhibit create mode=download fi diff --git a/src/librefetch/librefetch.conf b/src/librefetch/librefetch.conf index ce328d8..6948e8d 100644 --- a/src/librefetch/librefetch.conf +++ b/src/librefetch/librefetch.conf @@ -1,2 +1,5 @@ -MIRROR='https://repo.parabolagnulinux.org/other/' +MIRRORS=( + 'https://repo.parabolagnulinux.org/sources/' + 'https://repo.parabolagnulinux.org/other/' +) DOWNLOADER='/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u' -- cgit v1.2.2 From 5f97f7885b8bdb7a6fea34d6d073428b199d66ef Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 4 Jan 2014 16:07:40 -0500 Subject: librefetch: fiddle with DOWNLOADER percent-substitution --- src/librefetch/librefetch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 61fc3ad..a477315 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -151,8 +151,10 @@ main() { fi local dlcmd="${DOWNLOADER}" - dlcmd="${dlcmd//\%o/\"$dst\"}" - dlcmd="${dlcmd//\%u/\"$src\"}" + [[ $dlcmd = *%u* ]] || dlcmd="$dlcmd %u" + dlcmd="${dlcmd//\%o/$(printf '%q' "$dst")}" + dlcmd="${dlcmd//\%u/$(printf '%q' "$src")}" + { eval "$dlcmd"; } >> /dev/stderr && return 0 fi -- cgit v1.2.2 From 811df5ff79f76b8128380715ac5ae127cd76be56 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 4 Jan 2014 19:32:14 -0500 Subject: librefetch: update docs --- src/librefetch/librefetch | 7 +++-- src/librefetch/librefetch.8.ronn | 54 ++++++++++++++++++++++++++++------- src/librefetch/librefetch.conf.5.ronn | 17 +++++++---- 3 files changed, 58 insertions(+), 20 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index a477315..819a51a 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -37,11 +37,12 @@ usage() { prose "If OUTPUT_FILE isn't specified, it defaults to the non-directory part of SOURCE_URL, in the current directory." echo - prose "Unless '-C' is specified, if SOURCE_URL does not begin with the + prose "Unless '-C' is specified, if SOURCE_URL does not begin with a configured mirror, create mode is inhibited." echo prose "In download mode, it simply tries to download SOURCE_URL. At the - beginning of a URL, 'libre://' expands to the configured mirror." + beginning of a URL, 'libre://' expands to the first configured + mirror." echo prose "In create mode, it looks at a build script, and uses that to create the source tarball. SOURCE_URL is ignored, except that it @@ -56,7 +57,7 @@ usage() { '-a -b', not '-ab'." "$cmd" echo print "Example usage:" - print ' $ %s libre://mypackage-1.0.tar.gz' "$cmd" + print ' $ %s https://repo.parabolagnulinux.org/other/mypackage/mypackage-1.0.tar.gz' "$cmd" echo print "Options:" print " Settings:" diff --git a/src/librefetch/librefetch.8.ronn b/src/librefetch/librefetch.8.ronn index 16c3838..c7247d5 100644 --- a/src/librefetch/librefetch.8.ronn +++ b/src/librefetch/librefetch.8.ronn @@ -3,31 +3,40 @@ librefetch(8) -- downloads or creates a liberated source tarball ## SYNOPSIS -`librefetch` [options] []
-`librefetch` -[g|P|h] +`librefetch` [] []
+`librefetch` `-`[`g`|`P`|`h`] ## DESCRIPTION `librefetch` is a program to streamline creation of custom source tarballs for `PKGBUILD(5)` files. -To automatically use `librefetch` to download or create a source -tarball, you can add `libre://FILENAME.tar.gz` to the source array in -your `PKGBUILD`. This works because a post-install script for the -package adds `librefetch` as a download agent for `libre://` to -`makepkg.conf`. Because of this, it is almost never necessary to call -`librefetch` manually. +If a URL mentioned in the `source` array in a `PKGUILD` is in a +location that Parabola uploads "custom" source tarballs (or configured +locations), and no file is at that URL, librefetch will automatically +create it for you. -There are 6 modes: +This works because a post-install script for the package configures +`librefetch` as the download agent for `https://` URLs in +`makepkg.conf`; allowing it to jump in and create a file if need be. +Because of this, it is almost never necessary to call `librefetch` +manually. + +The post-install script also configures `librefetch` as the download +agent for `libre://` URLs, for compatability with PKGBUILDs that used +a previous version of librefetch. + +There are 5 modes: - * `download-create`: The default mode. First try `download` mode, - then `create` mode. * `download`: Download the tarball from the configured mirror. * `create`: Create the tarball from a `PKGBUILD`/`SRCBUILD`. * `checksums`: Generate integrity checks for source files. * `print`: Print the effective build script. * `help`: Print `librefetch` usage information. +The normal mode of operation is `download` mode. If `download` mode +fails, it may choose to try `create` mode. + ## OPTIONS * `-C`: Force `create` mode (don't download) @@ -40,6 +49,24 @@ There are 6 modes: * `-P` | `--print`: Use `print` mode: print the effective build script. * `-h` | `--help`: Use `help` mode: Show useage information. +## DOWNLOAD MODE + +If begins with the string `libre://`, it is replaced with +the first value in `MIRRORS`, as configured in `librefetch.conf(5)`; +this is for compatability with PKGBUILDs that used a previous version +of librefetch. + +It uses `DOWNLOADER`, as configured in `librefetch.conf` to attempt to +download the source tarball from that URL. If that fails, and +following conditions are met, it proceeds to `create` mode: + + * The `-D` flag has not been specified to inhibit `create` mode. + * The `` begins with one of the values in `MIRRORS`. + +The latter requirement allows librefetch to be used as a generic +HTTP(S) download agent, that can automatically create files from +whitelisted locations. + ## CREATE MODE The principle of `create` mode is that a special `PKGBUILD(5)`, called @@ -155,6 +182,11 @@ The following modifications are made to makepkg: See `librefetch.conf(5)` for details on configuring librefetch using the `librefetch.conf` file. +## BUGS + +In download mode, if the local download location contains the string +`%u`, it will be replaced by the URL being downloaded from. + ## SEE ALSO librefetch.conf(5), makepkg(8), PKGBUILD(5), SRCBUILD(5) diff --git a/src/librefetch/librefetch.conf.5.ronn b/src/librefetch/librefetch.conf.5.ronn index 7b25400..6158104 100644 --- a/src/librefetch/librefetch.conf.5.ronn +++ b/src/librefetch/librefetch.conf.5.ronn @@ -24,14 +24,19 @@ If `$XDG_CONFIG_HOME` is not set, a default value is set: ## OPTIONS - * `MIRROR='https://repo.parabolagnulinux.org/other/'`: - Files from within this tree will be attempted to be built if - downloading them fails. Also, `libre://` expands to this - location. + * `MIRRORS=( ... )`: + A list of locations that generated source tarballs may be located + at. If a URL begins with `libre://`, then `libre://` is replaced + with the first location listed here. * `DOWNLOADER='/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'`: The HTTP client to use when downloading pre-built source tarballs - in download mode. + in download mode. The format and semantics are similar to + `DLAGENTS` in `makepkg.conf`(5). If present, `%u` will be replaced + with the download URL (correctly quoted), otherwise the download + URL will be appended to the end of the command. If present, `%o` + will be replaced with the local filename that it should be + downloaded to. ## SEE ALSO -librefetch(8) +librefetch(8), makepkg.conf(5) -- cgit v1.2.2 From 7d7556e3afb934b69b99f7a7b1960c7be3d04be2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 4 Jan 2014 22:27:52 -0500 Subject: librestage: stage files generated by librefetch --- src/abslibre-tools/librestage | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index 6bbe80e..aa7f600 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -59,7 +59,8 @@ main() { # Load configuration load_files libretools check_vars libretools WORKDIR ARCHES || return 1 - load_files makepkg # for PKGDEST, which is optional + load_files makepkg # for PKGDEST and SRCDEST, which are optional + load_files librefetch # for MIRRORS, which is optional # Load the PKGBUILD load_PKGBUILD @@ -79,7 +80,7 @@ main() { pkgpath="$(readlink -f "$pkgpath")" fi - msg 'Found %s' "${pkgfile}" + msg 'Found package: %s' "${pkgfile}" canonical="" # is empty for the first iteration, set after that for repo in "${repos[@]}"; do @@ -101,10 +102,42 @@ main() { done done + for netfile in "${source[@]}"; do + for mirror in "${MIRRORS[@]}"; do + srcurl=${netfile#*::} + if [[ "$srcurl" == "$mirror"* ]]; then + if [[ $netfile = *::* ]]; then + srcname=${netfile%%::*} + else + srcname=${netfile##*/} + fi + + srcpath='' + for path in "./$srcname" "${SRCDEST:-.}/$srcname"; do + if [[ -f "path" ]]; then + srcpath="$path" + break + fi + done + if [[ -n "$srcpath" ]]; then + msg "Found generated source file: %s" "$srcname" + if cp "$srcpath" "${WORKDIR}/staging/other/${srcurl##"$mirror"}"; then + msg2 "%s staged on [%s]" "$srcname" other + staged=true + else + error "Can't put %s on [%s]" "$srcname" other + return 1 + fi + fi + break + fi + done + done + if $staged ; then return 0 else - error "No package was staged" + error "Nothing was staged" return 1 fi } -- cgit v1.2.2 From bd47fdc61018da61cbd0b1978e04a27239a380b5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 4 Jan 2014 22:58:12 -0500 Subject: libretools.conf: change default REPODEST to cause less clutter in ~repo --- src/libretools.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libretools.conf b/src/libretools.conf index ff989f0..4b1973a 100644 --- a/src/libretools.conf +++ b/src/libretools.conf @@ -37,7 +37,7 @@ ABSLIBRESEND=ssh://git@projects.parabolagnulinux.org:1863/srv/git/abslibre.git ## Where to upload packages to # '/staging/' is appended; this is for compatability with previous versions. -REPODEST=repo@repo:/srv/http/repo/staging-$LIBREUSER +REPODEST=repo@repo:/srv/http/repo/staging/$LIBREUSER ## Assumes something similar in your .ssh/config: # Host repo # Port 1863 -- cgit v1.2.2 From f5663f08d44091ca16c7f53c492c2594202ba7e5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 16:52:57 -0500 Subject: update to the new devtools --- src/chroot-tools/makechrootpkg.sh.patch | 95 ++++++++++++++++----------------- src/lib/common.sh.top | 2 + 2 files changed, 47 insertions(+), 50 deletions(-) diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch index 4dd1146..672da83 100644 --- a/src/chroot-tools/makechrootpkg.sh.patch +++ b/src/chroot-tools/makechrootpkg.sh.patch @@ -1,5 +1,5 @@ ---- makechrootpkg.sh.in 2013-10-26 14:53:57.000000000 -0400 -+++ makechrootpkg.sh.ugly 2013-11-16 15:14:04.000000000 -0500 +--- makechrootpkg.sh.in 2014-01-05 00:02:08.650446097 -0500 ++++ makechrootpkg.sh.ugly 2014-01-05 00:20:01.914448010 -0500 @@ -12,6 +12,7 @@ shopt -s nullglob @@ -38,9 +38,9 @@ if [[ ${copy:0:1} = / ]]; then copydir=$copy else -@@ -110,30 +110,47 @@ - repack=true - fi +@@ -115,30 +115,48 @@ + esac + done -if [[ -n $SUDO_USER ]]; then +if [[ -n ${SUDO_USER:-} ]]; then @@ -54,8 +54,9 @@ +# Usage: load_vars $makepkg_conf +# Globals: +# - SRCDEST -+# - LOGDEST ++# - SRCPKGDEST +# - PKGDEST ++# - LOGDEST +# - MAKEFLAGS +# - PACKAGER load_vars() { @@ -63,7 +64,7 @@ [[ -f $makepkg_conf ]] || return 1 - for var in {SRC,PKG,LOG}DEST MAKEFLAGS PACKAGER; do + for var in {SRC,SRCPKG,PKG,LOG}DEST MAKEFLAGS PACKAGER; do - [[ -z ${!var} ]] && eval $(grep "^${var}=" "$makepkg_conf") + [[ -z ${!var:-} ]] && eval $(grep "^${var}=" "$makepkg_conf") done @@ -92,7 +93,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,11 +171,16 @@ +@@ -159,11 +177,16 @@ # Drop the read lock again lock_close 8 @@ -112,7 +113,7 @@ if [[ "$chroottype" == btrfs ]]; then btrfs subvolume delete "$copydir" >/dev/null || die "Unable to delete subvolume %s" "$copydir" -@@ -173,9 +195,14 @@ +@@ -178,9 +201,14 @@ stat_done } @@ -127,7 +128,7 @@ for install_pkg in "${install_pkgs[@]}"; do pkgname="${install_pkg##*/}" cp "$install_pkg" "$copydir/$pkgname" -@@ -188,11 +215,19 @@ +@@ -193,11 +221,19 @@ rm "$copydir/$pkgname" done @@ -149,9 +150,9 @@ $repack || rm -rf "$copydir/build" mkdir -p "$copydir/build" -@@ -226,12 +261,12 @@ +@@ -236,12 +272,12 @@ - chown -R nobody "$copydir"/{build,pkgdest,logdest,srcdest,startdir} + chown -R nobody "$copydir"/{build,pkgdest,srcpkgdest,logdest,srcdest,startdir} - if [[ -n $MAKEFLAGS ]]; then + if [[ -n ${MAKEFLAGS:-} ]]; then @@ -164,7 +165,7 @@ sed -i '/^PACKAGER=/d' "$copydir/etc/makepkg.conf" echo "PACKAGER='${PACKAGER}'" >> "$copydir/etc/makepkg.conf" fi -@@ -244,20 +279,38 @@ +@@ -254,20 +290,38 @@ chmod 440 "$copydir/etc/sudoers.d/nobody-pacman" fi @@ -179,11 +180,10 @@ + # This is a little gross, but this way the script is recreated every time in the # working copy -- printf $'#!/bin/bash\n%s\n_chrootbuild %q "$@"' "$(declare -f _chrootbuild)" \ -+ printf '#!/bin/bash\n%s\n_chrootprepare "$@"' "$(declare -f _chrootprepare)" \ ++ printf $'#!/bin/bash\n%s\n_chrootprepare "$@"' "$(declare -f _chrootprepare)" \ + > "$copydir/chrootprepare" + chmod +x "$copydir/chrootprepare" -+ printf '#!/bin/bash\n%s\n_chrootbuild %q "$@"' "$(declare -f _chrootbuild)" \ + printf $'#!/bin/bash\n%s\n_chrootbuild %q "$@"' "$(declare -f _chrootbuild)" \ "$run_namcap" >"$copydir/chrootbuild" chmod +x "$copydir/chrootbuild" } @@ -206,7 +206,7 @@ makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o else ( export SRCDEST BUILDDIR="$builddir" -@@ -267,20 +320,15 @@ +@@ -277,20 +331,18 @@ (( $? != 0 )) && die "Could not download sources." # Clean up garbage from verifysource @@ -221,28 +221,19 @@ - local run_namcap="$1"; shift - local makepkg_args=("$@") - -- . /etc/profile -- export HOME=/build -- shopt -s nullglob + . /etc/profile + export HOME=/build + shopt -s nullglob # XXX: Workaround makepkg disliking read-only dirs + rm -rf -- /srcdest/* /startdir/* ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* -@@ -295,15 +343,27 @@ - done - done - -- cd /startdir -- - # XXX: Keep PKGBUILD writable for pkgver() -- rm PKGBUILD* -- cp /startdir_host/PKGBUILD* . -- chown nobody PKGBUILD* -+ rm /startdir/PKGBUILD* -+ cp /startdir_host/PKGBUILD* /startdir -+ chown nobody /startdir/PKGBUILD* +@@ -313,9 +365,23 @@ + rm PKGBUILD* + cp /startdir_host/PKGBUILD* . + chown nobody PKGBUILD* +} + +_chrootbuild() { @@ -263,7 +254,7 @@ echo "Can't write to PKGBUILD!" exit 1 fi -@@ -321,12 +381,24 @@ +@@ -333,12 +399,24 @@ exit 0 } @@ -286,9 +277,9 @@ + local l for l in "$copydir"/logdest/*; do + [[ $l == */logpipe.* ]] && continue chown "$src_owner" "$l" - mv "$l" "$LOGDEST" -@@ -334,6 +406,10 @@ +@@ -352,6 +430,10 @@ } # }}} @@ -299,25 +290,23 @@ umask 0022 load_vars /etc/makepkg.conf -@@ -344,17 +420,25 @@ - [[ -d $SRCDEST ]] || SRCDEST=$PWD - [[ -d $LOGDEST ]] || LOGDEST=$PWD +@@ -363,30 +445,45 @@ + [[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD + [[ -d $LOGDEST ]] || LOGDEST=$PWD -create_chroot +# Lock the chroot we want to use. We'll keep this lock until we exit. +lock 9 "$copydir.lock" "Locking chroot copy [%s]" "$copy" - --$update_first && arch-nspawn "$copydir" \ -- "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \ -- pacman -Syu --noconfirm ++ +if [[ ! -d $copydir ]] || $clean_first; then + sync_chroot "$chrootdir" "$copy" +fi --[[ -n ${install_pkgs[*]} ]] && install_packages -+$update_first && arch-nspawn "$copydir" pacman -Syu --noconfirm + $update_first && arch-nspawn "$copydir" \ + "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \ + pacman -Syu --noconfirm --prepare_chroot +-[[ -n ${install_pkgs[*]} ]] && install_packages +if [[ -n ${install_pkgs[*]:-} ]]; then + install_packages "$copydir" "${install_pkgs[@]}" + ret=$? @@ -325,15 +314,21 @@ + [[ -f PKGBUILD ]] || exit $ret +fi --download_sources +-prepare_chroot +prepare_chroot "$copydir" "$USER_HOME" "$repack" -+ + +-download_sources +download_sources "$copydir" "$src_owner" if arch-nspawn "$copydir" \ --bind-ro="$PWD:/startdir_host" \ -@@ -362,12 +446,12 @@ + --bind-ro="$SRCDEST:/srcdest_host" \ "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \ ++ /chrootprepare && ++ arch-nspawn "$copydir" \ ++ --bind-ro="$PWD:/startdir_host" \ ++ --bind-ro="$SRCDEST:/srcdest_host" \ ++ "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \ /chrootbuild "${makepkg_args[@]}" then - move_products @@ -347,7 +342,7 @@ if (( ret != 0 )); then if $temp_chroot; then -@@ -378,3 +462,4 @@ +@@ -397,3 +494,4 @@ else true fi diff --git a/src/lib/common.sh.top b/src/lib/common.sh.top index 054301b..625ea05 100644 --- a/src/lib/common.sh.top +++ b/src/lib/common.sh.top @@ -13,6 +13,8 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. +shopt -s extglob + if [[ -z ${_INCLUDE_COMMON_SH:-} ]]; then _INCLUDE_COMMON_SH=true -- cgit v1.2.2 From 56384e572d419a48439a90b9481a715a13a109c8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 17:09:11 -0500 Subject: src/lib/: set TEXTDOMAIN differently for internal messages This allows us to fix the long-standing bug that libremessages forces TEXTDOMAIN=libretools --- src/lib/Makefile | 8 +++++++- src/lib/common.sh.top | 8 ++++++-- src/lib/conf.sh | 4 ++-- src/lib/libreblacklist | 8 +++++--- src/lib/librelib | 29 +++++++++++++++++++++-------- src/lib/libremessages | 2 +- src/lib/libremessages.1.ronn | 6 ------ 7 files changed, 42 insertions(+), 23 deletions(-) diff --git a/src/lib/Makefile b/src/lib/Makefile index 4f24ad3..4ed5e4f 100644 --- a/src/lib/Makefile +++ b/src/lib/Makefile @@ -14,7 +14,13 @@ common.sh: %: %.in %.top Makefile @{ \ cat '$*.top' && \ echo && \ - sed -r -e '/encoding problem/d;/LANG=/d' -e 's/mesg=\$$(.)/mesg="$$(_ "$$\1")"/' '$*.in' && \ + sed -r \ + -e '/encoding problem/d;/LANG=/d' \ + -e 's/mesg=\$$(.)/mesg="$$(_ "$$\1")"/' \ + -e 's/gettext /_l _ /g' \ + -e "s/^(\s+)(msg|error) '/\1_l \2 '/" \ + -e 's|lock\(\)\s*\{|lock()\n{|' \ + '$*.in' && \ echo && \ cat '$*.bottom' && \ :; } > '$@' diff --git a/src/lib/common.sh.top b/src/lib/common.sh.top index 625ea05..9c4ba2e 100644 --- a/src/lib/common.sh.top +++ b/src/lib/common.sh.top @@ -18,11 +18,15 @@ shopt -s extglob if [[ -z ${_INCLUDE_COMMON_SH:-} ]]; then _INCLUDE_COMMON_SH=true -export TEXTDOMAIN='libretools' -export TEXTDOMAINDIR='/usr/share/locale' +[[ -n ${TEXTDOMAIN:-} ]] || export TEXTDOMAIN='libretools' +[[ -n ${TEXTDOMAINDIR:-} ]] || export TEXTDOMAINDIR='/usr/share/locale' if type gettext &>/dev/null; then _() { gettext "$@"; } else _() { echo "$@"; } fi + +_l() { + TEXTDOMAIN='librelib' TEXTDOMAINDIR='/usr/share/locale' "$@" +} diff --git a/src/lib/conf.sh b/src/lib/conf.sh index 0a6fb89..4445bef 100644 --- a/src/lib/conf.sh +++ b/src/lib/conf.sh @@ -122,10 +122,10 @@ check_vars() { if [[ -z ${!VAR:-} ]]; then type print &>/dev/null || . libremessages if [[ $(list_files $slug|wc -l) -gt 1 ]]; then - print "Configure '%s' in one of:" "$VAR" + _l print "Configure '%s' in one of:" "$VAR" list_files $slug | sed 's/./ -> &/' else - print "Configure '%s' in '%s'" "$VAR" "$(list_files $slug)" + _l print "Configure '%s' in '%s'" "$VAR" "$(list_files $slug)" fi ret=1 fi diff --git a/src/lib/libreblacklist b/src/lib/libreblacklist index 5db1a3f..267d32d 100755 --- a/src/lib/libreblacklist +++ b/src/lib/libreblacklist @@ -48,7 +48,7 @@ blacklist-update() ( local remote_blacklist="$BLACKLIST" local local_blacklist="$XDG_CACHE_HOME/libretools/blacklist.txt" - stat_busy "Downloading blacklist of proprietary software packages" + _l stat_busy "Downloading blacklist of proprietary software packages" mkdir -p "${local_blacklist%/*}" if wget -N -q -O "${local_blacklist}.part" "$remote_blacklist" 2>/dev/null; then @@ -58,9 +58,9 @@ blacklist-update() ( stat_done rm "${local_blacklist}.part" if [[ -e "$local_blacklist" ]]; then - warning "Using local copy of blacklist" + _l warning "Using local copy of blacklist" else - error "Download failed, exiting" + _l error "Download failed, exiting" return 1 fi @@ -109,6 +109,8 @@ if [[ "${0##*/}" == libreblacklist ]]; then sed 's/\r/\n/g'<<<"$1"|sed -e '/^$/d' -e 's/^# //' } usage() { + export TEXTDOMAIN='librelib' + export TEXTDOMAINDIR='/usr/share/locale' . $(librelib messages) if [[ $# -eq 0 ]]; then print "Usage: %s [-h] COMMAND [ARGUMENTS]" "${0##*/}" diff --git a/src/lib/librelib b/src/lib/librelib index a58f5d3..3b05e37 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -16,18 +16,31 @@ default_libdir=/usr/lib/libretools -if ! type gettext &>/dev/null; then - gettext() { echo "$@"; } +if type gettext &>/dev/null; then + _() { gettext "$@"; } +else + _() { echo "$@"; } fi +_l() { + TEXTDOMAIN='librelib' TEXTDOMAINDIR='/usr/share/locale' "$@" +} + print() { - mesg=$1 + local mesg="$(_ "$1")" shift - printf -- "$(gettext "$mesg")\n" "$@" + printf -- "$mesg\n" "$@" +} + +_html_whitespace_collapse() { + [[ $# == 0 ]] || panic + tr '\n' ' ' | sed -r -e 's/\t/ /g' -e 's/ +/ /g' } prose() { - print "$@" | fmt -su + [[ $# -ge 1 ]] || panic + local mesg="$(_ "$(_html_whitespace_collapse <<<"$1")")"; shift + printf -- "$mesg" "$@" | fmt -u } cmd=${0##*/} @@ -54,11 +67,11 @@ usage() { main() { if [[ $# != 1 ]]; then - usage >&2 + _l usage >&2 return 2 fi if [[ $1 == '-h' ]]; then - usage + _l usage return 0; fi @@ -76,7 +89,7 @@ main() { return 0; fi done - print '%s: could not find library: %s' "$cmd" "$lib" >> /dev/stderr + _l print '%s: could not find library: %s' "$cmd" "$lib" >> /dev/stderr return 1 } diff --git a/src/lib/libremessages b/src/lib/libremessages index c6d08e2..8766578 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -36,7 +36,7 @@ ################################################################################ panic() { - echo "$(_ 'panic: malformed call to internal function')" >&2 + echo "$(_l _ 'panic: malformed call to internal function')" >&2 exit 1 } diff --git a/src/lib/libremessages.1.ronn b/src/lib/libremessages.1.ronn index b91a958..30314c8 100644 --- a/src/lib/libremessages.1.ronn +++ b/src/lib/libremessages.1.ronn @@ -188,12 +188,6 @@ These routines relate to `makepkg`(8). ## BUGS -libremessages sets to `libretools` unconditionally, -making it generally unsuitable for use outside of libretools. If you -override after loading the library, that should work, but -you will also have to provide translations for libremessage's internal -messages (such as "ERROR" or "Warning"). - Generating `.pot` files for the prose functions is a pain. The libretools Makefiles have rules to do it, but it might make sense to pull it into a separate program. -- cgit v1.2.2 From b07f84783a9b3e4e799e93173977882de6c16fa8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 17:09:30 -0500 Subject: src/lib/: misc touch-up --- src/lib/conf.sh | 4 ++-- src/lib/libremessages | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lib/conf.sh b/src/lib/conf.sh index 4445bef..6b1ab49 100644 --- a/src/lib/conf.sh +++ b/src/lib/conf.sh @@ -112,7 +112,7 @@ load_files() { # Check whether the variables listed are properly set. # If not, it prints a message saying to set them in the configuration file(s) # for $slug. -check_vars() { +check_vars() ( local slug=$1; shift local ret=0 @@ -134,7 +134,7 @@ check_vars() { if [[ $ret != 0 ]]; then return 1 fi -} +) # Usage: get_var # Does not work with arrays diff --git a/src/lib/libremessages b/src/lib/libremessages index 8766578..8e48c3b 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -88,8 +88,6 @@ bullet() { # bullet. flag() { [[ $# == 2 ]] || panic - local n=' -' local flag=$1 local desc="$(_ "$(_html_whitespace_collapse <<<"$2")")" @@ -99,7 +97,7 @@ flag() { done local lines - IFS=$n lines=($(fmt -u -w $((73-indent)) <<<"$desc")) + IFS=$'\n' lines=($(fmt -u -w $((73-indent)) <<<"$desc")) local line for line in "${lines[@]}"; do printf " %-${indent}s %s\n" "$flag" "$line" -- cgit v1.2.2 From fa6e7ccf3914081504681679645fd7cfd803cfdd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 18:39:47 -0500 Subject: test/: re-jigger the chroot tests to be fast on btrfs --- test/librechroot-test.sh | 24 ++++++++++++++---------- test/libremakepkg-test.sh | 22 ++++++++++++---------- test/test-common.sh | 23 +++++++++++++++++++++++ 3 files changed, 49 insertions(+), 20 deletions(-) diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index 5ca1b37..442abed 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -4,30 +4,34 @@ describe librechroot . ./test-common.sh +_setup_chrootdir + before() { _before librechroot + mkdir -p "$XDG_CONFIG_HOME"/libretools - echo "CHROOTDIR='$tmpdir/chrootdir'" > "$XDG_CONFIG_HOME"/libretools/chroot.conf + + echo "CHROOTDIR='${chrootdir}'" > "$XDG_CONFIG_HOME"/libretools/chroot.conf echo "CHROOT='default'" >> "$XDG_CONFIG_HOME"/libretools/chroot.conf echo "CHROOTEXTRAPKG=()" >> "$XDG_CONFIG_HOME"/libretools/chroot.conf } -after() { +after() ( _after_sudo -} +) it_creates_repo_for_new_chroots() { require network sudo || return 0 libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty - testsudo librechroot run test -r /repo/repo.db + testsudo librechroot -l "$roundup_test_name" run test -r /repo/repo.db } it_cleans_the_local_repo_correctly() { require network sudo || return 0 libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty - testsudo librechroot make - testsudo librechroot clean-repo - testsudo librechroot run test -r /repo/repo.db + testsudo librechroot -l "$roundup_test_name" make + testsudo librechroot -l "$roundup_test_name" clean-repo + testsudo librechroot -l "$roundup_test_name" run test -r /repo/repo.db # TODO: inspect /repo/* more } @@ -36,7 +40,7 @@ it_respects_exit_status_if_out_isnt_a_tty() ( set -o pipefail libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty r=0 - { testsudo librechroot run exit 3 | cat; } || r=$? + { testsudo librechroot -l "$roundup_test_name" run exit 3 | cat; } || r=$? [[ $r == 3 ]] ) @@ -49,7 +53,7 @@ it_displays_help_as_normal_user() { } it_otherwise_fails_as_normal_user() { - librechroot run true >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? + librechroot -l "$roundup_test_name" run true >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] empty $tmpdir/stdout @@ -57,7 +61,7 @@ it_otherwise_fails_as_normal_user() { } it_displays_help_and_fails_with_0_args() { - LC_ALL=C librechroot >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? + LC_ALL=C librechroot -l "$roundup_test_name" >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] empty $tmpdir/stdout diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh index e684f18..9f3bed3 100644 --- a/test/libremakepkg-test.sh +++ b/test/libremakepkg-test.sh @@ -4,6 +4,8 @@ describe libremakepkg . ./test-common.sh +_setup_chrootdir + before() { _before libremakepkg @@ -11,7 +13,7 @@ before() { echo "BLACKLIST=https://repo.parabolagnulinux.org/docs/blacklist.txt" >"$XDG_CONFIG_HOME"/libretools/libretools.conf - echo "CHROOTDIR='$tmpdir/chrootdir'" > "$XDG_CONFIG_HOME"/libretools/chroot.conf + echo "CHROOTDIR='${chrootdir}'" > "$XDG_CONFIG_HOME"/libretools/chroot.conf echo "CHROOT='default'" >> "$XDG_CONFIG_HOME"/libretools/chroot.conf echo "CHROOTEXTRAPKG=()" >> "$XDG_CONFIG_HOME"/libretools/chroot.conf } @@ -26,7 +28,7 @@ it_builds_a_trivial_package() { cd "$tmpdir" libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty - testsudo libremakepkg + testsudo libremakepkg -l "$roundup_test_name" [[ -f $(echo libretools-hello-1.0-1-any.pkg.tar.?z) ]] } @@ -50,13 +52,13 @@ it_cleans_the_chroot_before_building() { libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty cd "$tmpdir/1" - testsudo libremakepkg &> "$tmpdir/out" || { r=$?; tail "$tmpdir/out"|cat -v; return $r; } + testsudo libremakepkg -l "$roundup_test_name" &> "$tmpdir/out" || { r=$?; tail "$tmpdir/out"|cat -v; return $r; } cd "$tmpdir/2" - testsudo libremakepkg &> "$tmpdir/out" || { r=$?; tail "$tmpdir/out"|cat -v; return $r; } - testsudo librechroot run libretools-testpkg1 'first time, pass' + testsudo libremakepkg -l "$roundup_test_name" &> "$tmpdir/out" || { r=$?; tail "$tmpdir/out"|cat -v; return $r; } + testsudo librechroot -l "$roundup_test_name" run libretools-testpkg1 'first time, pass' cd "$tmpdir/3" - testsudo libremakepkg &> "$tmpdir/out" || { r=$?; tail "$tmpdir/out"|cat -v; return $r; } - ! testsudo librechroot run libretools-testpkg1 'second time, fail' + testsudo libremakepkg -l "$roundup_test_name" &> "$tmpdir/out" || { r=$?; tail "$tmpdir/out"|cat -v; return $r; } + ! testsudo librechroot -l "$roundup_test_name" run libretools-testpkg1 'second time, fail' } it_handles_PKGDEST_not_existing() { @@ -65,14 +67,14 @@ it_handles_PKGDEST_not_existing() { cd "$tmpdir" libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty - testsudo env PKGDEST="$tmpdir/dest/pkgdest" libremakepkg + testsudo env PKGDEST="$tmpdir/dest/pkgdest" libremakepkg -l "$roundup_test_name" [[ -f $(echo dest/pkgdest/libretools-hello-1.0-1-any.pkg.tar.?z) ]] } it_displays_help_as_normal_user() { rm -rf "$XDG_CONFIG_HOME" - LC_ALL=C libremakepkg -h >$tmpdir/stdout 2>$tmpdir/stderr + LC_ALL=C libremakepkg -l "$roundup_test_name" -h >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] empty $tmpdir/stderr @@ -83,7 +85,7 @@ it_otherwise_fails_as_normal_user() { cp libremakepkg.d/PKGBUILD-hello "$tmpdir/PKGBUILD" cd "$tmpdir" - libremakepkg >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? + libremakepkg -l "$roundup_test_name" >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] empty $tmpdir/stdout diff --git a/test/test-common.sh b/test/test-common.sh index aadd8f2..46e584d 100644 --- a/test/test-common.sh +++ b/test/test-common.sh @@ -26,6 +26,29 @@ _after_sudo() { fi } +_setup_chrootdir() { + if [[ -z "$chrootdir" ]]; then + export chrootdir="$(mktemp -d --tmpdir "test-chrootdir.XXXXXXXXXXXX")" + trap "$(printf '_cleanup_chrootdir %q' "$chrootdir")" EXIT + fi +} + +_cleanup_chrootdir() ( + chrootdir=$1 + shopt -s nullglob + if [[ $SUDO ]]; then + for copydir in "$chrootdir"/*/*/; do + local chroottype=$(stat -f -c %T "$copydir") + if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; then + sudo btrfs subvolume delete "$copydir" >/dev/null + fi + done + sudo rm -rf -- "$chrootdir" + else + rm -rf -- "$chrootdir" + fi +) + require() ( set +x local missing=() -- cgit v1.2.2 From 257a3fbfc839be9d056b38b6a1110a1550253d79 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 18:53:16 -0500 Subject: chroot-tools: make patch not reject new bugfix in devtools-par --- src/chroot-tools/makechrootpkg.sh.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch index 672da83..d6c96f9 100644 --- a/src/chroot-tools/makechrootpkg.sh.patch +++ b/src/chroot-tools/makechrootpkg.sh.patch @@ -1,5 +1,5 @@ ---- makechrootpkg.sh.in 2014-01-05 00:02:08.650446097 -0500 -+++ makechrootpkg.sh.ugly 2014-01-05 00:20:01.914448010 -0500 +--- makechrootpkg.sh.in 2014-01-05 18:51:41.463720929 -0500 ++++ makechrootpkg.sh.ugly 2014-01-05 18:52:41.624501065 -0500 @@ -12,6 +12,7 @@ shopt -s nullglob @@ -110,7 +110,7 @@ + local chroottype=$(stat -f -c %T "$copydir") + + stat_busy "Removing chroot copy [%s]" "$copy" - if [[ "$chroottype" == btrfs ]]; then + if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; then btrfs subvolume delete "$copydir" >/dev/null || die "Unable to delete subvolume %s" "$copydir" @@ -178,9 +201,14 @@ -- cgit v1.2.2 From e6a70164f89ee5e8571b6b485fda9262a9d16991 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 20:17:13 -0500 Subject: test/libremakepkg: don't use -l in tests that don't require sudo It confuses check() when building the package --- test/libremakepkg-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh index 9f3bed3..7b64dc0 100644 --- a/test/libremakepkg-test.sh +++ b/test/libremakepkg-test.sh @@ -74,7 +74,7 @@ it_handles_PKGDEST_not_existing() { it_displays_help_as_normal_user() { rm -rf "$XDG_CONFIG_HOME" - LC_ALL=C libremakepkg -l "$roundup_test_name" -h >$tmpdir/stdout 2>$tmpdir/stderr + LC_ALL=C libremakepkg -h >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] empty $tmpdir/stderr @@ -85,7 +85,7 @@ it_otherwise_fails_as_normal_user() { cp libremakepkg.d/PKGBUILD-hello "$tmpdir/PKGBUILD" cd "$tmpdir" - libremakepkg -l "$roundup_test_name" >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? + libremakepkg >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] empty $tmpdir/stdout -- cgit v1.2.2 From 0ab5354f379e27ad863903953044a41382ad50a6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 20:43:41 -0500 Subject: librefetch: parse an '--' argument correctly --- src/librefetch/librefetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 819a51a..c723721 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -208,6 +208,7 @@ parse_options() { -P|--print) mode=print;; -p) BUILDFILE="$(readlink -m -- "$opt")";; -h|--help) mode=help;; + --) shift; break;; -*) if in_array "${arg}" "${makepkg_argall[@]}"; then makepkg_opts+=("$arg") @@ -217,7 +218,6 @@ parse_options() { return 1 fi ;; - --) shift; break;; *) extra_opts+=("$arg");; esac shift -- cgit v1.2.2 From 59633ede257e3ebbc81a55e191fee2e83400d477 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 20:58:57 -0500 Subject: librestage: fix staging generated sources --- src/abslibre-tools/librestage | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index aa7f600..96fee8b 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -114,14 +114,16 @@ main() { srcpath='' for path in "./$srcname" "${SRCDEST:-.}/$srcname"; do - if [[ -f "path" ]]; then + if [[ -f "$path" ]]; then srcpath="$path" break fi done if [[ -n "$srcpath" ]]; then msg "Found generated source file: %s" "$srcname" - if cp "$srcpath" "${WORKDIR}/staging/other/${srcurl##"$mirror"}"; then + dest="${WORKDIR}/staging/other/${srcurl##"$mirror"}" + mkdir -p -- "${dest%/*}" + if cp "$srcpath" "$dest"; then msg2 "%s staged on [%s]" "$srcname" other staged=true else -- cgit v1.2.2 From 9b235734a1810e415acfea2eefaeff008a8073a6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 21:14:32 -0500 Subject: librerelease: list staged source files in a sane way --- src/abslibre-tools/librerelease | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index b77b6ec..1e07638 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -181,10 +181,11 @@ main() { # The different modes (sans 'usage') ########################################### pretty_print_packages() { - find "$WORKDIR/staging/" -mindepth 1 -type d -not -empty -printf '%f\n' | sort | - while read -r repo; do - msg2 "$repo" - find -L "${WORKDIR}/staging/${repo}" -type f -printf "%f\n" | sort + find "$WORKDIR/staging/" -mindepth 1 -maxdepth 1 -type d -not -empty | sort | + while read -r path; do + msg2 "${path##*/}" + cd "$path" + find -L . -type f | sed 's|^\./| |' | sort done } -- cgit v1.2.2 From 7f3842777aeed4bd7b7ec28ef59c56c489a0831f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 21:20:04 -0500 Subject: update test/librerelease-test.sh --- test/librerelease-test.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/librerelease-test.sh b/test/librerelease-test.sh index c395bc6..a44b150 100644 --- a/test/librerelease-test.sh +++ b/test/librerelease-test.sh @@ -34,20 +34,22 @@ it_displays_usage_text() { it_lists_all_files() { WORKDIR="$tmpdir/workdir" - mkdir -p "$WORKDIR/staging/repo1" "$WORKDIR/staging/repo2" + mkdir -p "$WORKDIR/staging/repo1" "$WORKDIR/staging/repo2/sub" touch \ "$WORKDIR/staging/repo1/file1" \ "$WORKDIR/staging/repo1/file2" \ - "$WORKDIR/staging/repo2/file with spaces" + "$WORKDIR/staging/repo2/file with spaces" \ + "$WORKDIR/staging/repo2/sub/subfolder" unset WORKDIR LC_ALL=C librerelease -l &>"$tmpdir/list" cat > "$tmpdir/list-correct" < repo1 -file1 -file2 + file1 + file2 -> repo2 -file with spaces + file with spaces + sub/subfolder EOF diff "$tmpdir/list-correct" "$tmpdir/list" -- cgit v1.2.2 From a5dadc1f833f06f5cfa655fabfa37b54b6c168db Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 22:13:47 -0500 Subject: librerelease: don't clean non-package files --- src/abslibre-tools/librerelease | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index 1e07638..70ed128 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -101,13 +101,6 @@ sign_packages() { done } -# Remove everything that's not a package or a signature -clean_non_packages() { - find $WORKDIR/staging/ -type f \ - \! -iname "*.pkg.tar.?z" -a \! -iname "*.pkg.tar.?z.sig" \ - -delete -} - # Clean everything if not on dry-run mode clean_files() { local file_list=$1 @@ -212,7 +205,6 @@ release_packages() { lock 10 "${WORKDIR}/staging.lock" \ 'Waiting for an exclusive lock on the staging directory' - clean_non_packages sign_packages || return 1 # Make the permissions of the packages 644 otherwise the user will get access -- cgit v1.2.2 From 8c52811113e58289daec68289a503aee29ee1380 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 22:17:01 -0500 Subject: librefetch: handle "empty" situations better --- src/abslibre-tools/librerelease | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index 70ed128..06a26e8 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -53,9 +53,9 @@ readonly rsync_flags=( # Functions #################################################################### -list0_files() { - find -L "${WORKDIR}/staging" -type f -print0 | xargs -0 realpath -z --relative-to="${WORKDIR}/staging" -} +list0_files() ( + cd "$WORKDIR" && find -L 'staging' -type f -print0 +) # This function is taken almost verbatim from makepkg create_signature() { @@ -111,7 +111,9 @@ clean_files() { fi msg "Removing files from local staging directory" - cd "${WORKDIR}/staging" && xargs -0 -a "$file_list" "${rmcmd[@]}" + cd "${WORKDIR}/staging" && xargs -0r -a "$file_list" "${rmcmd[@]}" + cd "${WORKDIR}/staging" && find . -mindepth 1 -type d -empty \ + -exec rmdir -p {} + 2>/dev/null } ################################################################################ @@ -221,7 +223,7 @@ release_packages() { msg "%s to upload" "$(cd "${WORKDIR}/staging" && du -hc --files0-from="$file_list" | sed -n '$s/\t.*//p')" msg "Uploading packages..." - xargs -0 -a "$file_list" dirname -z | ssh ${REPODEST%%:*} "$(printf 'mkdir -p -- %q && cd %q && xargs -0 mkdir -pv --' "${REPODEST#*:}" "${REPODEST#*:}")" + xargs -0r -a "$file_list" dirname -z | ssh ${REPODEST%%:*} "$(printf 'mkdir -p -- %q && cd %q && xargs -0r mkdir -pv --' "${REPODEST#*:}" "${REPODEST#*:}")" if ! rsync ${dryrun} "${rsync_flags[@]}" \ -0 --files-from="$file_list" \ ${WORKDIR}/staging \ -- cgit v1.2.2 From 39b13f63d0fd89bfa3cae1feb8744fb100eb5651 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 23:21:44 -0500 Subject: librerelease: fix --- src/abslibre-tools/librerelease | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index 06a26e8..aca8fef 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -53,9 +53,10 @@ readonly rsync_flags=( # Functions #################################################################### -list0_files() ( - cd "$WORKDIR" && find -L 'staging' -type f -print0 -) +list0_files() { + find -L "${WORKDIR}/staging" -type f \ + -exec realpath -z --relative-to="${WORKDIR}/staging" {} + +} # This function is taken almost verbatim from makepkg create_signature() { @@ -84,19 +85,19 @@ sign_packages() { 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 - if [[ -f "${package}.sig" ]]; then - msg2 "Package signature found, verifying..." + for file in $(find "${WORKDIR}/staging/" -type f -not -iname '*.sig'); do + if [[ -f "${file}.sig" ]]; then + msg2 "File signature found, verifying..." # Verify that the signature is correct, else remove for re-signing - if ! gpg --quiet --verify "${package}.sig" >/dev/null 2>&1; then + if ! gpg --quiet --verify "${file}.sig" >/dev/null 2>&1; then error "Failed! Re-signing..." - rm -f "${package}.sig" + rm -f "${file}.sig" fi fi - if ! [[ -f "${package}.sig" ]]; then - create_signature "$package" || return 2 + if ! [[ -f "${file}.sig" ]]; then + create_signature "$file" || return 2 fi done } -- cgit v1.2.2 From 0d1aabe28efaabc910dcbca4508bb7bbc97b23df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Tue, 7 Jan 2014 10:13:49 -0300 Subject: First test version of dagpkg, a topologically sorted recursive abs builder --- dagpkg | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100755 dagpkg diff --git a/dagpkg b/dagpkg new file mode 100755 index 0000000..d3fb723 --- /dev/null +++ b/dagpkg @@ -0,0 +1,154 @@ +#!/usr/bin/env bash +set -e + +# Source variables from makepkg +source /etc/makepkg.conf +source $XDG_CONFIG_HOME/.makepkg.conf &>/dev/null || true + +# Source variables from libretools +source /etc/libretools.conf +source $XDG_CONFIG_HOME/libretools/libretools.conf &>/dev/null || true + +# End inmediately but print an useful message +trap_exit() { + term_title "error!" + error "($(basename $0)) $@ (leftovers on ${temp_dir})" + exit 1 +} + +# Trap signals from makepkg +trap 'trap_exit "TERM signal caught. Exiting..."' TERM HUP QUIT +trap 'trap_exit "Aborted by user! Exiting..."' INT +trap 'trap_exit "An unknown error has occurred. Exiting..."' ERR + +# Source this PKGBUILD, if it doesn't exist, exit +if ! source PKGBUILD &>/dev/null ; then + error "No PKGBUILD in %s" "$PWD" + exit 1 +fi + +# This is the name of the package +name="${pkgbase:-${pkgname[0]}}" + +# The name of the previous package +prev="${3}" +depth="${2:-0}" +let next=${depth}+1 || true + +# A temporary work dir and log file +temp_dir="${1:-$(mktemp -d /tmp/${name}-testpkg-XXXX)}" +log="${temp_dir}/buildorder" + +# Generate the full version with epoch +get_fullver() { + if [ $1 -eq 0 ]; then +# zero epoch case, don't include it in version + echo $2-$3 + else + echo $1:$2-$3 + fi + +} + +# If it's already built we don't bother +is_built ${pkgname[0]} $(get_fullver ${epoch:-0} ${pkgver} ${pkgrel}) && +exit + +# If the envvar I contains this package, ignore it and exit +echo "$I" | grep -q "$name" && exit + +msg "%s(%d)" $name $depth + +build=false +if [ ! -z "${1}" -a ${depth} -eq 0 ]; then + build=true +fi + + # If we specified a work dir on the cli it means we want to skip + # dependency graph creation and jump to build whatever is there + if ! ${build}; then + + # Export a pair of current and previous package to get a list of graph + # edges + echo -e "${name}\t${prev:--}" | tee -a ${log} + + # Recurse into dependencies + for d in ${depends[@]} ${makedepends[@]}; do + # Cleanup dependency versions + d=$(echo $d | sed "s/[<>=].*//") + # Where's the pkgbuild? + w=$(toru-where $d) + + # Skip if not available + test -z "$w" && continue + + # Go to this dir + pushd $w &>/dev/null + + # Infinite loop detection, if the inverted pair current+prev was + # already seen, skip + if grep -q "${prev}[[:space:]]${d}" ${log} ; then + msg2 "infinite loop %s<->%s" $d $prev + continue + fi + + # Edge detection + if grep -q "^${d}[[:space:]]" ${log} ; then + msg2 "edge %s already visited" ${d} + continue + fi + + # Run this same command giving work dir, depth and previous package + $0 ${temp_dir} ${next} ${name} + + popd &>/dev/null + done +else + msg "Resuming build..." +fi + +# end here if we're not the first package +test ${depth} -ne 0 && exit + + +# enter work dir +pushd "${temp_dir}" &>/dev/null +tsort ${log} | head -n-1 | tac | nl | tac | while read order pkg; do + # skip if already built + test -f "${pkg}/built_ok" && continue + + # where's this package? + w="$(toru-where "$pkg")" + test -z "$w" && continue + + # copy to work dir if not already + test -d "$pkg" || cp -r "$w" "$pkg" + pushd "$pkg" &>/dev/null + + term_title "$pkg($order)" + + msg "Building %s" ${pkg} + + # upgrade the system + sudo -E pacman -Syu --noconfirm + + # run the pre build command from libretools.conf + ${HOOKPREBUILD} + + # run the build command + ${FULLBUILDCMD} + + # Run local release hook with $1 = $repo + ${HOOKLOCALRELEASE} "$(basename "$(dirname "$w")")" + + # it's built! + touch built_ok + + popd &>/dev/null +done + +popd &>/dev/null +# cleanup +rm -rf ${log} "${temp_dir}" + +term_title "done" -- cgit v1.2.2 From 2d127aeaab734b41ba6387a9cf352f488d1ecd1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Wed, 8 Jan 2014 13:07:19 -0300 Subject: dagpkg: working version * check if package is ported * discover edges for same pkgbase but different pkgnames * general commentary and tips --- dagpkg | 92 +++++++++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 68 insertions(+), 24 deletions(-) diff --git a/dagpkg b/dagpkg index d3fb723..578203e 100755 --- a/dagpkg +++ b/dagpkg @@ -1,18 +1,38 @@ #!/usr/bin/env bash +# +# dagpkg - create a directed graph of package dependencies and build +# them in topological order +# +# (c) 2014 Nicolás Reynolds +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . set -e -# Source variables from makepkg -source /etc/makepkg.conf -source $XDG_CONFIG_HOME/.makepkg.conf &>/dev/null || true - # Source variables from libretools source /etc/libretools.conf source $XDG_CONFIG_HOME/libretools/libretools.conf &>/dev/null || true +# Source variables from makepkg +source /etc/makepkg.conf +source $XDG_CONFIG_HOME/.makepkg.conf &>/dev/null || true + # End inmediately but print an useful message trap_exit() { term_title "error!" - error "($(basename $0)) $@ (leftovers on ${temp_dir})" + test ${depth} -eq 0 && + error "(%s) %s (leftovers on %s)" \ + "${0##*/}" "$@" "${temp_dir}" exit 1 } @@ -27,6 +47,16 @@ if ! source PKGBUILD &>/dev/null ; then exit 1 fi +# Save resources +unset pkgdesc arch license groups backup install md5sums sha1sums \ + sha256sums source options &>/dev/null + +unset build package &>/dev/null + +for _pkg in ${pkgname[@]}; do + unset package_${_pkg} &>/dev/null || true +done + # This is the name of the package name="${pkgbase:-${pkgname[0]}}" @@ -54,50 +84,59 @@ get_fullver() { is_built ${pkgname[0]} $(get_fullver ${epoch:-0} ${pkgver} ${pkgrel}) && exit +echo "${arch[@]}" | grep -qw "$CARCH" || warning "%s isn't ported to %s yet" ${name} ${CARCH} + # If the envvar I contains this package, ignore it and exit -echo "$I" | grep -q "$name" && exit +echo "$I" | grep -qw "$name" && +msg2 "%s ignored" ${name} && +exit -msg "%s(%d)" $name $depth +msg "%s (%s)" ${name} ${prev} build=false if [ ! -z "${1}" -a ${depth} -eq 0 ]; then build=true fi - # If we specified a work dir on the cli it means we want to skip - # dependency graph creation and jump to build whatever is there - if ! ${build}; then +# If we specified a work dir on the cli it means we want to skip +# dependency graph creation and jump to build whatever is there +if ! ${build}; then # Export a pair of current and previous package to get a list of graph # edges - echo -e "${name}\t${prev:--}" | tee -a ${log} + echo -e "${name}\t${prev:--}" >>${log} + + # Infinite loop detection, if the inverted pair current+prev was + # already seen, skip + if grep -q "${prev}[[:space:]]${name}" ${log} ; then + msg2 "infinite loop %s<->%s" $name $prev + exit + fi # Recurse into dependencies for d in ${depends[@]} ${makedepends[@]}; do # Cleanup dependency versions d=$(echo $d | sed "s/[<>=].*//") + # Where's the pkgbuild? w=$(toru-where $d) # Skip if not available test -z "$w" && continue - # Go to this dir - pushd $w &>/dev/null - - # Infinite loop detection, if the inverted pair current+prev was - # already seen, skip - if grep -q "${prev}[[:space:]]${d}" ${log} ; then - msg2 "infinite loop %s<->%s" $d $prev - continue - fi - - # Edge detection - if grep -q "^${d}[[:space:]]" ${log} ; then + # revisited edge detection + # we use the basename of the package dir as pkgbase to avoid + # recalling an edge using one of the other pkgname's + if grep -q "^${w##*/}[[:space:]]" ${log} ; then msg2 "edge %s already visited" ${d} + # add edge anyway but avoid reprocessing + echo -e "${w##*/}\t${name}" >>${log} continue fi + # Go to this dir + pushd $w &>/dev/null + # Run this same command giving work dir, depth and previous package $0 ${temp_dir} ${next} ${name} @@ -110,9 +149,9 @@ fi # end here if we're not the first package test ${depth} -ne 0 && exit - # enter work dir pushd "${temp_dir}" &>/dev/null +# TODO do something when loops are discovered (fail? skip?) tsort ${log} | head -n-1 | tac | nl | tac | while read order pkg; do # skip if already built test -f "${pkg}/built_ok" && continue @@ -122,6 +161,9 @@ tsort ${log} | head -n-1 | tac | nl | tac | while read order pkg; do test -z "$w" && continue # copy to work dir if not already + # this means you can make modifications to the pkgbuild during the + # graph build or remove the dir after a build failure and let dagpkg + # copy a new version test -d "$pkg" || cp -r "$w" "$pkg" pushd "$pkg" &>/dev/null @@ -130,6 +172,8 @@ tsort ${log} | head -n-1 | tac | nl | tac | while read order pkg; do msg "Building %s" ${pkg} # upgrade the system + # this would probably have to go on HOOKPREBUILD if you're working + # outside chroots sudo -E pacman -Syu --noconfirm # run the pre build command from libretools.conf -- cgit v1.2.2 From e574f9574a984545d76ed05c361ba92deabe873b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Wed, 8 Jan 2014 13:26:52 -0300 Subject: dagpkg: lukeshu's suggestions --- dagpkg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dagpkg b/dagpkg index 578203e..b4ef9e1 100755 --- a/dagpkg +++ b/dagpkg @@ -42,7 +42,7 @@ trap 'trap_exit "Aborted by user! Exiting..."' INT trap 'trap_exit "An unknown error has occurred. Exiting..."' ERR # Source this PKGBUILD, if it doesn't exist, exit -if ! source PKGBUILD &>/dev/null ; then +if ! source ./PKGBUILD &>/dev/null ; then error "No PKGBUILD in %s" "$PWD" exit 1 fi @@ -66,7 +66,7 @@ depth="${2:-0}" let next=${depth}+1 || true # A temporary work dir and log file -temp_dir="${1:-$(mktemp -d /tmp/${name}-testpkg-XXXX)}" +temp_dir="${1:-$(mktemp -dt ${name}-testpkg-XXXX)}" log="${temp_dir}/buildorder" # Generate the full version with epoch -- cgit v1.2.2 From fb5ee96054490596e4febdf459e5f5bd1b70e807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= Date: Thu, 9 Jan 2014 00:49:21 -0300 Subject: dagpkg: implement a better sorting algorithm --- dagpkg | 127 +++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 65 insertions(+), 62 deletions(-) diff --git a/dagpkg b/dagpkg index b4ef9e1..290c775 100755 --- a/dagpkg +++ b/dagpkg @@ -4,6 +4,7 @@ # them in topological order # # (c) 2014 Nicolás Reynolds +# Michał Masłowski # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,7 +31,6 @@ source $XDG_CONFIG_HOME/.makepkg.conf &>/dev/null || true # End inmediately but print an useful message trap_exit() { term_title "error!" - test ${depth} -eq 0 && error "(%s) %s (leftovers on %s)" \ "${0##*/}" "$@" "${temp_dir}" exit 1 @@ -41,29 +41,28 @@ trap 'trap_exit "TERM signal caught. Exiting..."' TERM HUP QUIT trap 'trap_exit "Aborted by user! Exiting..."' INT trap 'trap_exit "An unknown error has occurred. Exiting..."' ERR -# Source this PKGBUILD, if it doesn't exist, exit -if ! source ./PKGBUILD &>/dev/null ; then - error "No PKGBUILD in %s" "$PWD" - exit 1 -fi +source_pkgbuild() { + # Source this PKGBUILD, if it doesn't exist, exit + if ! source ./PKGBUILD &>/dev/null ; then + error "No PKGBUILD in %s" "$PWD" + exit 1 + fi -# Save resources -unset pkgdesc arch license groups backup install md5sums sha1sums \ - sha256sums source options &>/dev/null + # Save resources + unset pkgdesc arch license groups backup install md5sums sha1sums \ + sha256sums source options &>/dev/null -unset build package &>/dev/null + unset build package &>/dev/null -for _pkg in ${pkgname[@]}; do - unset package_${_pkg} &>/dev/null || true -done + for _pkg in ${pkgname[@]}; do + unset package_${_pkg} &>/dev/null || true + done -# This is the name of the package -name="${pkgbase:-${pkgname[0]}}" + # This is the name of the package + name="${pkgbase:-${pkgname[0]}}" +} -# The name of the previous package -prev="${3}" -depth="${2:-0}" -let next=${depth}+1 || true +source_pkgbuild # A temporary work dir and log file temp_dir="${1:-$(mktemp -dt ${name}-testpkg-XXXX)}" @@ -80,38 +79,42 @@ get_fullver() { } -# If it's already built we don't bother -is_built ${pkgname[0]} $(get_fullver ${epoch:-0} ${pkgver} ${pkgrel}) && -exit +# Mark array for DFS-based topological sort. See +# https://en.wikipedia.org/wiki/Topological_sort for an explanation of +# the algorithm. Key: package name, value: 0 for unvisited package, 1 +# during visit, 2 after visit. +declare -A marks -echo "${arch[@]}" | grep -qw "$CARCH" || warning "%s isn't ported to %s yet" ${name} ${CARCH} +# Visit a PKGBUILD for graph building. +visit_pkgbuild() { + # The name of the previous package + prev="${1}" -# If the envvar I contains this package, ignore it and exit -echo "$I" | grep -qw "$name" && -msg2 "%s ignored" ${name} && -exit + local name + source_pkgbuild -msg "%s (%s)" ${name} ${prev} + # Detect cycle or already visited package + case "${marks[$name]:-0}" in + 1) msg2 "cycle found with %s depending on %s" $prev $name + exit 1;; + 2) return;; + esac -build=false -if [ ! -z "${1}" -a ${depth} -eq 0 ]; then - build=true -fi + # If it's already built we don't bother + is_built ${pkgname[0]} $(get_fullver ${epoch:-0} ${pkgver} ${pkgrel}) && + return -# If we specified a work dir on the cli it means we want to skip -# dependency graph creation and jump to build whatever is there -if ! ${build}; then + echo "${arch[@]}" | grep -qw "$CARCH" || warning "%s isn't ported to %s yet" ${name} ${CARCH} - # Export a pair of current and previous package to get a list of graph - # edges - echo -e "${name}\t${prev:--}" >>${log} + # If the envvar I contains this package, ignore it and exit + echo "$I" | grep -qw "$name" && + msg2 "%s ignored" ${name} && + return - # Infinite loop detection, if the inverted pair current+prev was - # already seen, skip - if grep -q "${prev}[[:space:]]${name}" ${log} ; then - msg2 "infinite loop %s<->%s" $name $prev - exit - fi + msg "%s (%s)" ${name} ${prev} + + # Mark the package as being visited + marks[$name]=1 # Recurse into dependencies for d in ${depends[@]} ${makedepends[@]}; do @@ -124,37 +127,37 @@ if ! ${build}; then # Skip if not available test -z "$w" && continue - # revisited edge detection - # we use the basename of the package dir as pkgbase to avoid - # recalling an edge using one of the other pkgname's - if grep -q "^${w##*/}[[:space:]]" ${log} ; then - msg2 "edge %s already visited" ${d} - # add edge anyway but avoid reprocessing - echo -e "${w##*/}\t${name}" >>${log} - continue - fi - # Go to this dir pushd $w &>/dev/null - # Run this same command giving work dir, depth and previous package - $0 ${temp_dir} ${next} ${name} + visit_pkgbuild "$name" popd &>/dev/null done + + # Mark the package as finished + marks[$name]=2 + # Append it to the reversed list of packages to build. + echo "$name" >> "${log}" +} + +# If we specified a work dir on the cli it means we want to skip +# dependency graph creation and jump to build whatever is there +if [ -z "${1}" ]; then + # Visit the root PKGBUILD to make the graph. + visit_pkgbuild "" else msg "Resuming build..." fi -# end here if we're not the first package -test ${depth} -ne 0 && exit - # enter work dir pushd "${temp_dir}" &>/dev/null -# TODO do something when loops are discovered (fail? skip?) -tsort ${log} | head -n-1 | tac | nl | tac | while read order pkg; do +nl ${log} | while read order pkg; do # skip if already built - test -f "${pkg}/built_ok" && continue + if test -f "${pkg}/built_ok"; then + warning "tried to build %s twice" "%{pkg}" + continue + fi # where's this package? w="$(toru-where "$pkg")" -- cgit v1.2.2 From 3fababaa704ea9cd0ed06c62a9af1b83301b9302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Thu, 9 Jan 2014 00:50:19 -0300 Subject: dagpkg: correctly handle variables --- dagpkg | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/dagpkg b/dagpkg index 290c775..49d6ef1 100755 --- a/dagpkg +++ b/dagpkg @@ -43,13 +43,15 @@ trap 'trap_exit "An unknown error has occurred. Exiting..."' ERR source_pkgbuild() { # Source this PKGBUILD, if it doesn't exist, exit + unset pkgbase pkgname depends makedepends + unset pkgrel pkgver epoch if ! source ./PKGBUILD &>/dev/null ; then error "No PKGBUILD in %s" "$PWD" exit 1 fi # Save resources - unset pkgdesc arch license groups backup install md5sums sha1sums \ + unset pkgdesc license groups backup install md5sums sha1sums \ sha256sums source options &>/dev/null unset build package &>/dev/null @@ -93,6 +95,10 @@ visit_pkgbuild() { local name source_pkgbuild + # If it's already built we don't bother + is_built ${pkgname[0]} $(get_fullver ${epoch:-0} ${pkgver} ${pkgrel}) && + return + # Detect cycle or already visited package case "${marks[$name]:-0}" in 1) msg2 "cycle found with %s depending on %s" $prev $name @@ -100,19 +106,16 @@ visit_pkgbuild() { 2) return;; esac - # If it's already built we don't bother - is_built ${pkgname[0]} $(get_fullver ${epoch:-0} ${pkgver} ${pkgrel}) && - return + msg "%s (%s)" ${name} ${prev} - echo "${arch[@]}" | grep -qw "$CARCH" || warning "%s isn't ported to %s yet" ${name} ${CARCH} + echo "${arch[@]}" | grep -qw "$CARCH" || + warning "%s isn't ported to %s yet" ${name} ${CARCH} # If the envvar I contains this package, ignore it and exit echo "$I" | grep -qw "$name" && msg2 "%s ignored" ${name} && return - msg "%s (%s)" ${name} ${prev} - # Mark the package as being visited marks[$name]=1 -- cgit v1.2.2 From f9da2708dc3611473f2ffd17b525dc282726b75a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 18 Jan 2014 12:46:26 -0500 Subject: I went comma-happy when writing librechroot:usage() --- 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 5e16587..1c8ec4c 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -96,9 +96,9 @@ usage() { printf ' rootdir : %s\n' "${rootdir:-$(_ 'ERROR')}" printf ' copydir : %s\n' "${copydir:-$(_ 'ERROR')}" echo - prose 'If the chroot, or copy does not exist, it will be created + prose 'If the chroot or copy does not exist, it will be created automatically. A chroot by default contains the packages in the - group "base-devel", and any packages named in $CHROOTEXTRAPKG. + group "base-devel" and any packages named in $CHROOTEXTRAPKG. Unless the `-C` or `-M` flags are used, the configuration files that this program installs are the stock versions supplied in the packages, not the versions from your host system. Other tools -- cgit v1.2.2 From ca879723bef3b0f638a2e6262f1fc869cf2b14be Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 18 Jan 2014 12:47:01 -0500 Subject: Update libremessages.1.ronn --- src/lib/libremessages.1.ronn | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/libremessages.1.ronn b/src/lib/libremessages.1.ronn index 30314c8..bf052bd 100644 --- a/src/lib/libremessages.1.ronn +++ b/src/lib/libremessages.1.ronn @@ -104,7 +104,7 @@ For each of these, is fed through `gettext` automatically. 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. +any arguments. Each of these print to stderr, not stdout. For each of these, is fed through `gettext` automatically. @@ -178,6 +178,13 @@ these, you could end up deleting a lot of someone's work. These routines relate to `makepkg`(8). + * `find_cached_package` [-: + Searches for a localy built copy of the specified package, in + and the current working directory. If is not + specified, any value will match. If multiple matching files are + found (not counting duplicate links), then an error is printed to + stderr and nothing is prented to stdout. + * `get_full_version` []: Inspects variables that are set, and prints the full version spec, including if necessary, , and . By -- cgit v1.2.2 From 27274846fa112b3309a5cebe6afa2753d641a992 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 18 Jan 2014 12:47:18 -0500 Subject: librechroot: fix comment --- 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 1c8ec4c..64c3a46 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -151,7 +151,7 @@ readonly commands=( run enter clean-repo help ) -# set $rootdir and $copydir; blank them on error +# Print code to set $rootdir and $copydir; blank them on error calculate_directories() { # Don't assume that CHROOTDIR or CHROOT are set, # but assume that COPY is set. -- cgit v1.2.2 From 0fd1e7b1333b8793c1cc448c2a00cb085544cc8c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 18 Jan 2014 20:30:08 -0500 Subject: libremakepkg: support -r and -w flags, same as librechroot Feature request: https://labs.parabola.nu/issues/458 --- src/chroot-tools/libremakepkg | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index fc6418c..dbeeb81 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -148,8 +148,12 @@ usage() { the documentation there.' echo print 'Options:' + print ' %s options:' librechroot flag "-n <$(_ CHROOT)>" 'Name of the chroot to use' flag "-l <$(_ COPY)>" 'Name of, or absolute path to, the chroot copy to use' + flag "-w <$(_ 'PATH[:PATH]')>" 'Bind mount a file or directory, read/write' + flag "-r <$(_ 'PATH[:PATH]')>" 'Bind mount a file or directory, read-only' + print ' %s options:' libremakepkg flag '-N' "Don't disable networking during build() and package(). PLEASE don't use this unless you have a special reason, its use is a violation @@ -173,10 +177,14 @@ main() { local chroot='' # Parse command line options ########################################### - while getopts 'n:l:NRh' flag ; do + while getopts 'n:l:wrNRh' flag ; do case "${flag}" in - n) if $INCHROOT; then err_chflag "$flag"; else chroot=$OPTARG; fi;; - l) if $INCHROOT; then err_chflag "$flag"; else copy=$OPTARG; fi;; + n) if $INCHROOT; then err_chflag "$flag"; else + chroot=$OPTARG; fi;; + l) if $INCHROOT; then err_chflag "$flag"; else + copy=$OPTARG; fi;; + w|r) if $INCHROOT; then err_chflag "$flag"; else + librechroot_flags+=(-$flag "$OPTARG"); fi;; N) NONET=false;; R) repack=true; makepkg_args+=(-R);; h) usage; return 0;; @@ -226,7 +234,7 @@ main() { MAKEFLAGS="$(get_var makepkg MAKEFLAGS '')" PACKAGER="$(get_var makepkg PACKAGER '')" - librechroot_flags=( + librechroot_flags+=( -r "$PWD:/startdir_host" -r "$SRCDEST:/srcdest_host" -n "$CHROOT" -- cgit v1.2.2 From 83a55baf27a6e6f3fa3e6772a6f1b63f4c5138d7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jan 2014 10:00:18 -0500 Subject: libremakepkg: actually support SRCPKGDEST, document LOGDEST support --- src/chroot-tools/libremakepkg | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index dbeeb81..dcc495c 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -33,7 +33,7 @@ umask 0022 readonly _indent="$(librelib chroot/indent)" readonly INCHROOT=$([[ -f /.arch-chroot ]] && echo true || echo false) NONET=true # can be changed with the -N flag -# {SRC,LOG,PKG}DEST set at runtime by makepkg.conf +# {PKG,SRC,SRCPKG,LOG}DEST set at runtime by makepkg.conf # MAKEFLAGS, PACKAGER set at runtime by makepkg.conf # LIBREUSER, LIBREHOME are set by conf.sh librechroot_flags=() @@ -132,7 +132,7 @@ usage() { prose 'If run from outside of a chroot, command will make the following configuration changes in the chroot:' bullet 'whatever changes `librechroot` makes.' - bullet 'set `PKGDEST` and `SRCDEST` in `/etc/makepkg.conf`' + bullet 'set `{PKG,SRC,SRCPKG,LOG}DEST` in `/etc/makepkg.conf`' bullet 'set `PACKAGER` in `/etc/makepkg.conf` to reflect the value outside of the chroot.' bullet '(maybe) delete `/build/.makepkg.conf`' @@ -227,10 +227,11 @@ main() { # Load makepkg configuration ########################################### # Note that all of these are globals - SRCDEST="$(get_var makepkg SRCDEST "$PWD")" PKGDEST="$(get_var makepkg PKGDEST "$PWD")" + SRCDEST="$(get_var makepkg SRCDEST "$PWD")" + SRCPKGDEST="$(get_var makepkg SRCPKGDEST "$PWD")" LOGDEST="$(get_var makepkg LOGDEST "$PWD")" - mkdir -p "$SRCDEST" "$PKGDEST" "$LOGDEST" + mkdir -p -- "$PKGDEST" "$SRCDEST" "$SRCPKGDEST" "$LOGDEST" MAKEFLAGS="$(get_var makepkg MAKEFLAGS '')" PACKAGER="$(get_var makepkg PACKAGER '')" -- cgit v1.2.2 From 897a0084bdd96b06198e699f9851ce0b89de409d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jan 2014 10:45:19 -0500 Subject: libremakepkg: fix getopts string (I'm a dummy) --- src/chroot-tools/libremakepkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index dcc495c..f2dc537 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -177,7 +177,7 @@ main() { local chroot='' # Parse command line options ########################################### - while getopts 'n:l:wrNRh' flag ; do + while getopts 'n:l:w:r:NRh' flag ; do case "${flag}" in n) if $INCHROOT; then err_chflag "$flag"; else chroot=$OPTARG; fi;; -- cgit v1.2.2 From 0315f5fce3353ffb86009578f58e21583a37a826 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jan 2014 10:58:42 -0500 Subject: distcc-tool: get rid of string interpolation in usage() --- src/chroot-tools/distcc-tool | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chroot-tools/distcc-tool b/src/chroot-tools/distcc-tool index 7633029..7524e15 100755 --- a/src/chroot-tools/distcc-tool +++ b/src/chroot-tools/distcc-tool @@ -50,7 +50,7 @@ print() { } usage() { - print "Usage: $0 COMMAND [COMMAND-ARGS]" + print "Usage: %s COMMAND [COMMAND-ARGS]" "$0" print "Tool for using distcc within a networkless chroot" echo print "Commands:" -- cgit v1.2.2 From ec4ae3a3f632979f446366067ba5a9738644bdc0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jan 2014 11:00:09 -0500 Subject: distcc-tool: Fix quoting when embeddint a value in a string --- src/chroot-tools/distcc-tool | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/chroot-tools/distcc-tool b/src/chroot-tools/distcc-tool index 7524e15..5d21a0a 100755 --- a/src/chroot-tools/distcc-tool +++ b/src/chroot-tools/distcc-tool @@ -32,6 +32,8 @@ if ! type gettext &>/dev/null; then gettext() { echo "$@"; } fi +q0="$(printf '%q' "$0")" # quoted $0 + panic() { echo "$(gettext 'panic: malformed call to internal function')" >&2 exit 1 @@ -50,7 +52,7 @@ print() { } usage() { - print "Usage: %s COMMAND [COMMAND-ARGS]" "$0" + print "Usage: %s COMMAND [COMMAND-ARGS]" "$q0" print "Tool for using distcc within a networkless chroot" echo print "Commands:" @@ -135,7 +137,7 @@ parse_DISTCC_HOSTS() { ;; # ZEROCONF +zeroconf) - error "%s does not support the +zeroconf option" "$0" + error "%s does not support the +zeroconf option" "$q0" exit 1 ;; # TCP_HOST or OLDSTYLE_TCP_HOST @@ -159,7 +161,7 @@ parse_DISTCC_HOSTS() { # set up port forwaring if $forward_ports; then - socat TCP-LISTEN:${newport},fork SYSTEM:"$0 client $HOSTID ${PORT:-3632}" & + socat TCP-LISTEN:${newport},fork SYSTEM:"$q0 client $HOSTID ${PORT:-3632}" & pids+=($!) fi @@ -222,8 +224,8 @@ odaemon() { local chrootpath=$1 umask 111 - socat UNIX-LISTEN:"$chrootpath/socket",fork SYSTEM:"$0 server" & - trap "kill -- $!; rm -f '$chrootpath/socket'" EXIT + socat UNIX-LISTEN:"$chrootpath/socket",fork SYSTEM:"$q0 server" & + trap "kill -- $!; rm -f -- $(printf '%q' "$chrootpath/socket")" EXIT wait } -- cgit v1.2.2 From 25f149bfbf340c63bdae2a3156214be67814ec7a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jan 2014 14:53:29 -0500 Subject: distcc-tool: fix a typo in a comment --- src/chroot-tools/distcc-tool | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chroot-tools/distcc-tool b/src/chroot-tools/distcc-tool index 5d21a0a..29f0128 100755 --- a/src/chroot-tools/distcc-tool +++ b/src/chroot-tools/distcc-tool @@ -127,7 +127,7 @@ parse_DISTCC_HOSTS() { *@*) # SSH_HOST doesn't allow custom port numbers, and even if it # did, ssh would complain about MITM. Instead, we'll count on - # ssh ProxyCommand being configured to used `client`. + # ssh ProxyCommand being configured to use `client`. newhosts+=("$HOSTSPEC") ;; # GLOBAL_OPTION -- cgit v1.2.2 From 8692458d65fc9ce559ad7cd254d7ed3b606da76e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jan 2014 14:13:40 -0500 Subject: libremakepkg: (minor) refactor things to places that make a bit more sense --- src/chroot-tools/libremakepkg | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index f2dc537..1db9f08 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -212,6 +212,15 @@ main() { fi unset chroot + # Load makepkg configuration ########################################### + # Note that all of these are globals + PKGDEST="$(get_var makepkg PKGDEST "$PWD")" + SRCDEST="$(get_var makepkg SRCDEST "$PWD")" + SRCPKGDEST="$(get_var makepkg SRCPKGDEST "$PWD")" + LOGDEST="$(get_var makepkg LOGDEST "$PWD")" + MAKEFLAGS="$(get_var makepkg MAKEFLAGS '')" + PACKAGER="$(get_var makepkg PACKAGER '')" + # Quick sanity check ################################################### if (( EUID )); then @@ -225,22 +234,8 @@ main() { exit 1 fi - # Load makepkg configuration ########################################### - # Note that all of these are globals - PKGDEST="$(get_var makepkg PKGDEST "$PWD")" - SRCDEST="$(get_var makepkg SRCDEST "$PWD")" - SRCPKGDEST="$(get_var makepkg SRCPKGDEST "$PWD")" - LOGDEST="$(get_var makepkg LOGDEST "$PWD")" + # Make sure that the various *DEST directories exist mkdir -p -- "$PKGDEST" "$SRCDEST" "$SRCPKGDEST" "$LOGDEST" - MAKEFLAGS="$(get_var makepkg MAKEFLAGS '')" - PACKAGER="$(get_var makepkg PACKAGER '')" - - librechroot_flags+=( - -r "$PWD:/startdir_host" - -r "$SRCDEST:/srcdest_host" - -n "$CHROOT" - -l "$copy" - ) # OK, we are starting now ############################################## @@ -248,6 +243,13 @@ main() { lock 9 "/build/.lock" \ "Waiting for existing lock on build directory to be released" else + librechroot_flags+=( + -r "$PWD:/startdir_host" + -r "$SRCDEST:/srcdest_host" + -n "$CHROOT" + -l "$copy" + ) + # Obtain a lock on the chroot lock 9 "$copydir.lock" \ "Waiting for existing lock on chroot copy to be released: [%s]" "$copy" -- cgit v1.2.2 From b6e66bce4dadd1a5b9f74a456de3ef5575e648fa Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jan 2014 17:19:04 -0500 Subject: libremakepkg: Check the permissions of the bind-mounted directories --- src/chroot-tools/libremakepkg | 24 ++++++++++++++++++++++++ test/test-common.sh | 1 + 2 files changed, 25 insertions(+) diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 1db9f08..96f86ab 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -54,6 +54,21 @@ indent() { "$_indent" ' | ' } +# Usage: _check_perms_dir $directory +# Make sure that $directory is readable and executable (searchable) by 'nobody' +check_directory_permissions() ( + local dir=$1 + # `cd` to the directory, then test `.`; that way if parent + # directories aren't readable, we aren't testing for that. We + # only need the last element in `$dir`. + cd "$dir" + if ! sudo -u nobody test -r . -a -x .; then + error "Directory '%s' must be readable by user 'nobody'" "$dir" + return 1 + fi + return 0 +) + # Usage: exit_copy $copydir $src_owner # End immediately, but copy log files out exit_copy() { @@ -236,6 +251,15 @@ main() { # Make sure that the various *DEST directories exist mkdir -p -- "$PKGDEST" "$SRCDEST" "$SRCPKGDEST" "$LOGDEST" + # Check the permissions for $startdir and $SRCDEST + ( + declare -i ret=0 + check_directory_permissions "$PWD" || ret=1 + if ! [[ "$PWD" -ef "$SRCDEST" ]]; then + check_directory_permissions "$SRCDEST" || ret=1 + fi + exit $ret + ) # OK, we are starting now ############################################## diff --git a/test/test-common.sh b/test/test-common.sh index 46e584d..3df7107 100644 --- a/test/test-common.sh +++ b/test/test-common.sh @@ -11,6 +11,7 @@ _before() { unset PKGEXT SRCEXT unset GPGKEY PACKAGER tmpdir="$(mktemp -d --tmpdir "test-${roundup_desc//\//-}.XXXXXXXXXXXX")" + chmod 755 "$tmpdir" stat=0 } -- cgit v1.2.2 From 63362d52d3943f40fb96898a2b4e87e17f0adcf4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Jan 2014 00:43:09 -0500 Subject: libremessages: add a setup_traps routine --- src/lib/libremessages | 19 +++++++++++++++++++ src/lib/libremessages.1.ronn | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/src/lib/libremessages b/src/lib/libremessages index 8e48c3b..df0a98a 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -117,6 +117,25 @@ term_title() { printf "$fmt" "$*" } +# Usage: setup_traps +# Sets up traps on TERM, HUP, QUIT and INT signals, as well as the ERR event, +# similar to makepkg +setup_traps() { + _libremessages_trap_exit() { + local signal=$1; shift + echo + error "$@" + trap -- "$signal" + kill "-$signal" "$$" + } + set -E + for signal in TERM HUP QUIT; do + trap "_libremessages_trap_exit $signal '%s signal caught. Exiting...' $signal" $signal + done + trap '_libremessages_trap_exit INT "Aborted by user! Exiting..."' INT + trap '_libremessages_trap_exit USR1 "An unknown error has occurred. Exiting..."' ERR +} + ################################################################################ # Run one of the defined functions if invoked directly # ################################################################################ diff --git a/src/lib/libremessages.1.ronn b/src/lib/libremessages.1.ronn index bf052bd..d4c35fc 100644 --- a/src/lib/libremessages.1.ronn +++ b/src/lib/libremessages.1.ronn @@ -69,6 +69,10 @@ Unless otherwise noted, these do not implicitly call `gettext`. Joins all arguments with whitespace, and sets the terminal title to that. + * `setup_traps`: + Sets traps on TERM, HUP, QUIT and INT signals, as sell as the ERR + event, similar to makepkg. + ### PROSE ROUTINES These routines print to standard output, ande are useful for printing -- cgit v1.2.2 From a6ce111ab2fd71e0c13f5e165addeb18a4125f1e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Jan 2014 00:47:41 -0500 Subject: librefetch: improve error handling --- src/librefetch/librefetch | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index c723721..87a55cd 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -18,12 +18,12 @@ # You should have received a copy of the GNU General Public License # along with Parabola. If not, see . -. $(librelib conf.sh) -. libremessages +. $(librelib conf) +. $(librelib messages) +setup_traps declare -r tempdir="$(mktemp -d --tmpdir ${0##*/}.XXXXXXXXXXX)" -cleanup() { rm -rf -- "$tempdir"; } -trap cleanup EXIT +trap "rm -rf -- $(printf '%q' "$tempdir")" EXIT cmd=${0##*/} usage() { @@ -91,10 +91,15 @@ main() { local BUILDFILEDIR="${BUILDFILE%/*}" if [[ -f "${BUILDFILEDIR}/SRCBUILD" ]]; then BUILDFILE="${BUILDFILEDIR}/SRCBUILD" - srcbuild="$(modified_srcbuild "$BUILDFILE")" - else - srcbuild="$(modified_pkgbuild "$BUILDFILE")" fi + if [[ ! -f "$BUILDFILE" ]]; then + error "%s does not exist." "$BUILDFILE" + exit 1 + fi + case "$BUILDFILE" in + */SRCBUILD) srcbuild="$(modified_srcbuild "$BUILDFILE")";; + *) srcbuild="$(modified_pkgbuild "$BUILDFILE")";; + esac makepkg="$(modified_makepkg "$(which makepkg)")" # Mode: checksums ###################################################### -- cgit v1.2.2 From b129824bfc9c5c85cadf98dfb724405d63dfc6c3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Jan 2014 00:59:48 -0500 Subject: normalize to use >&2 instead of /dev/stderr --- src/abslibre-tools/librerelease | 4 ++-- src/abslibre-tools/librestage | 4 ++-- src/chroot-tools/librechroot | 14 +++++++------- src/lib/libreblacklist | 2 +- src/lib/librelib | 2 +- src/librefetch/librefetch | 12 ++++++------ 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index aca8fef..23a1c2d 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -149,12 +149,12 @@ main() { u) upload_only=true ;; n) dryrun="--dry-run" ;; h) mode=usage ;; - *) usage >/dev/stderr; return 1 ;; + *) usage >&2; return 1 ;; esac done shift $(($OPTIND - 1)) if [[ $# != 0 ]]; then - usage >/dev/stderr + usage >&2 return 1 fi diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index 96fee8b..4ea6edc 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -42,12 +42,12 @@ main() { while getopts 'h' arg; do case $arg in h) usage; return 0;; - *) usage >/dev/stderr; return 1;; + *) usage >&2; return 1;; esac done repos=("$@") if [[ ${#repos[@]} -eq 0 ]]; then - usage >>/dev/stderr + usage >&2 return 1; fi diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 64c3a46..0f0ed10 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -223,19 +223,19 @@ main() { C|M) arch_nspawn_flags+=(-$opt "$OPTARG");; w) sysd_nspawn_flags+=("--bind=$OPTARG");; r) sysd_nspawn_flags+=("--bind-ro=$OPTARG");; - *) usage >/dev/stderr; return 1;; + *) usage >&2; return 1;; esac done shift $(($OPTIND - 1)) if [[ $# -lt 1 ]]; then error "Must specify a command" - usage >/dev/stderr + usage >&2 return 1 fi mode=$1 if ! in_array "$mode" "${commands[@]}"; then error "Unrecognized command: %s" "$mode" - usage >/dev/stderr + usage >&2 return 1 fi shift @@ -243,14 +243,14 @@ main() { noop|make|sync|delete|update|enter|clean-pkgs|clean-repo) if [[ $# -gt 0 ]]; then error 'Command `%s` does not take any arguments: %s' "$mode" "$*" - usage >/dev/stderr + usage >&2 return 1 fi :;; install-file) if [[ $# -lt 1 ]]; then error 'Command `%s` requires at least one file' "$mode" - usage >/dev/stderr + usage >&2 return 1 else local missing=() @@ -269,14 +269,14 @@ main() { install-name) if [[ $# -lt 1 ]]; then error 'Command `%s` requires at least one package name' "$mode" - usage >/dev/stderr + usage >&2 return 1 fi :;; run) if [[ $# -lt 1 ]]; then error 'Command `%s` requires at least one argument' "$mode" - usage >/dev/stderr + usage >&2 return 1 fi :;; diff --git a/src/lib/libreblacklist b/src/lib/libreblacklist index 267d32d..7858611 100755 --- a/src/lib/libreblacklist +++ b/src/lib/libreblacklist @@ -137,7 +137,7 @@ if [[ "${0##*/}" == libreblacklist ]]; then } if [[ $# -eq 0 ]]; then - usage >/dev/stderr + usage >&2 exit 1 fi _blacklist_cmd=$1 diff --git a/src/lib/librelib b/src/lib/librelib index 3b05e37..c21532b 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -89,7 +89,7 @@ main() { return 0; fi done - _l print '%s: could not find library: %s' "$cmd" "$lib" >> /dev/stderr + _l print '%s: could not find library: %s' "$cmd" "$lib" >&2 return 1 } diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 87a55cd..5556ddd 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -161,7 +161,7 @@ main() { dlcmd="${dlcmd//\%o/$(printf '%q' "$dst")}" dlcmd="${dlcmd//\%u/$(printf '%q' "$src")}" - { eval "$dlcmd"; } >> /dev/stderr && return 0 + { eval "$dlcmd"; } >&2 && return 0 fi # Mode: create ######################################################### @@ -173,7 +173,7 @@ main() { export pkg_file=$dst cd "$BUILDFILEDIR" - "$makepkg" "${makepkg_opts[@]}" -p "$srcbuild" >> /dev/stderr || return $? + "$makepkg" "${makepkg_opts[@]}" -p "$srcbuild" >&2 || return $? fi } @@ -235,15 +235,15 @@ parse_options() { :;; checksums|print) # don't take any extra arguments if [[ ${#extra_opts[@]} != 0 ]]; then - print "%s: found extra non-flag arguments: %s" "$cmd" "${extra_opts[*]}" >> /dev/stderr - usage >> /dev/stderr + print "%s: found extra non-flag arguments: %s" "$cmd" "${extra_opts[*]}" >&2 + usage >&2 return 1 fi ;; *download*|*create*) # take 1 or 2 extra arguments if [[ ${#extra_opts[@]} != 1 ]] && [[ ${#extra_opts[@]} != 2 ]]; then - print "%s: %d non-flag arguments found, expected 1 or 2: %s" "$cmd" ${#extra_opts[@]} >> /dev/stderr - usage >> /dev/stderr + print "%s: %d non-flag arguments found, expected 1 or 2: %s" "$cmd" ${#extra_opts[@]} >&2 + usage >&2 return 1 fi ;; -- cgit v1.2.2 From c54c481b5b7a1cb7d4a201fad9450d3abb198742 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Jan 2014 01:11:33 -0500 Subject: fix librechroot test --- test/librechroot-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index 442abed..d458cd9 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -65,7 +65,7 @@ it_displays_help_and_fails_with_0_args() { [[ $stat != 0 ]] empty $tmpdir/stdout - [[ "$(sed 1q $tmpdir/stderr)" =~ Usage:.* ]] + [[ "$(sed -n 2p $tmpdir/stderr)" =~ Usage:.* ]] } # requires sudo so we know it's not failing because it needs root -- cgit v1.2.2 From 904702fba288da6c95044b528911966613e54935 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Jan 2014 11:37:40 -0500 Subject: librefetch: fix the %u bug by deferring variable evaluation until the eval. --- src/librefetch/librefetch | 4 ++-- src/librefetch/librefetch.8.ronn | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 5556ddd..443b4f6 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -158,8 +158,8 @@ main() { local dlcmd="${DOWNLOADER}" [[ $dlcmd = *%u* ]] || dlcmd="$dlcmd %u" - dlcmd="${dlcmd//\%o/$(printf '%q' "$dst")}" - dlcmd="${dlcmd//\%u/$(printf '%q' "$src")}" + dlcmd="${dlcmd//\%o/"\$dst"}" + dlcmd="${dlcmd//\%u/"\$src"}" { eval "$dlcmd"; } >&2 && return 0 fi diff --git a/src/librefetch/librefetch.8.ronn b/src/librefetch/librefetch.8.ronn index c7247d5..7d2dfb3 100644 --- a/src/librefetch/librefetch.8.ronn +++ b/src/librefetch/librefetch.8.ronn @@ -182,11 +182,6 @@ The following modifications are made to makepkg: See `librefetch.conf(5)` for details on configuring librefetch using the `librefetch.conf` file. -## BUGS - -In download mode, if the local download location contains the string -`%u`, it will be replaced by the URL being downloaded from. - ## SEE ALSO librefetch.conf(5), makepkg(8), PKGBUILD(5), SRCBUILD(5) -- cgit v1.2.2 From 641002eff37a30eb2b8237b15b74cc15b4d9f822 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Jan 2014 13:41:28 -0500 Subject: test/librefetch: update the DLAGENTS setting --- test/librefetch-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh index 13ce80f..92f67a1 100644 --- a/test/librefetch-test.sh +++ b/test/librefetch-test.sh @@ -9,7 +9,7 @@ before() { mkdir -p "$HOME" printf '%s\n' \ - "DLAGENTS+=(\"libre::$(which librefetch) -p \\\"\\\$BUILDFILE\\\" %u %o\")" \ + 'DLAGENTS+=({https,libre}'\''::/usr/bin/librefetch -p "$BUILDFILE" -- %u %o'\'')' \ 'BUILDDIR=""' \ > "$HOME/.makepkg.conf" -- cgit v1.2.2 From ea11eca851e1b54e36d310f4d69e099f169191e8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 00:05:22 -0500 Subject: I forgot to bump the copyright year on all the files I've touched this year --- src/abslibre-tools/librerelease | 2 +- src/abslibre-tools/librestage | 2 +- src/aur | 2 +- src/chroot-tools/distcc-tool | 2 +- src/chroot-tools/librechroot | 2 +- src/chroot-tools/libremakepkg | 2 +- src/fullpkg/fullpkg-find | 2 +- src/lib/conf.sh | 2 +- src/lib/libreblacklist | 2 +- src/lib/librelib | 2 +- src/lib/libremessages | 2 +- src/librefetch/librefetch | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index 23a1c2d..558ec37 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -3,7 +3,7 @@ # Uploads packages into [staging] # Copyright 2010 Nicolás Reynolds -# Copyright 2013 Luke Shumaker +# Copyright 2013-2014 Luke Shumaker # For just the create_signature() function: # Copyright (c) 2006-2013 Pacman Development Team # Copyright (c) 2002-2006 by Judd Vinet diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index 4ea6edc..4a21133 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -3,7 +3,7 @@ # Prepares packages for upload # Copyright 2010-2011 Nicolás Reynolds -# Copyright 2013 Luke Shumaker +# Copyright 2013-2014 Luke Shumaker # # This file is part of Parabola. # diff --git a/src/aur b/src/aur index 2d1efbb..a335b04 100755 --- a/src/aur +++ b/src/aur @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Copyright 2010 Joshua Ismael # Copyright 2010 Nicolás Reynolds -# Copyright 2013 Luke Shumaker +# Copyright 2013-2014 Luke Shumaker # # This file is part of Parabola. # diff --git a/src/chroot-tools/distcc-tool b/src/chroot-tools/distcc-tool index 29f0128..e114d11 100755 --- a/src/chroot-tools/distcc-tool +++ b/src/chroot-tools/distcc-tool @@ -2,7 +2,7 @@ # -*- tab-width: 4; sh-basic-offset: 4 -*- # distcc-tool -# Copyright 2013 Luke Shumaker +# Copyright 2013-2014 Luke Shumaker # # This file is part of Parabola. # diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 0f0ed10..73fb6b7 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -4,7 +4,7 @@ set -euE # Copyright 2010 Nicolás Reynolds # Copyright 2011 Joshua Haase -# Copyright 2012-2013 Luke Shumaker +# Copyright 2012-2014 Luke Shumaker # # This file is part of Parabola. # diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 96f86ab..c838288 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -4,7 +4,7 @@ set -euE # Copyright 2010-2011 Nicolás Reynolds # Copyright 2011 Joshua Ismael Haase Hernández -# Copyright 2012-2013 Luke Shumaker +# Copyright 2012-2014 Luke Shumaker # # This file is part of Parabola. # diff --git a/src/fullpkg/fullpkg-find b/src/fullpkg/fullpkg-find index f1b9573..a47717b 100755 --- a/src/fullpkg/fullpkg-find +++ b/src/fullpkg/fullpkg-find @@ -4,7 +4,7 @@ # Copyright (c) 2011-2012 Joshua I. Haase H. (xihh) # Copyright (c) 2011-2012 Nicolás Reynolds # Copyright (c) 2012 Michał Masłowski -# Copyright (c) 2012-2013 Luke Shumaker +# Copyright (c) 2012-2014 Luke Shumaker # # The copy_files() function is taken from makechrootpkg: # Copyright (c) 2007 Armin Luntzer diff --git a/src/lib/conf.sh b/src/lib/conf.sh index 6b1ab49..cdba893 100644 --- a/src/lib/conf.sh +++ b/src/lib/conf.sh @@ -1,7 +1,7 @@ #!/bin/bash # non-executable, but put this there as a hint to text editors # This may be included with or without `set -euE` -# Copyright (c) 2012-2013 by Luke Shumaker +# Copyright (c) 2012-2014 by Luke Shumaker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/lib/libreblacklist b/src/lib/libreblacklist index 7858611..5305896 100755 --- a/src/lib/libreblacklist +++ b/src/lib/libreblacklist @@ -2,7 +2,7 @@ # This may be included with or without `set -euE` # When run directly, it does `set -euE` -# Copyright (c) 2013 by Luke Shumaker +# Copyright (c) 2013-2014 by Luke Shumaker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/lib/librelib b/src/lib/librelib index c21532b..e9c8c8b 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2013 by Luke Shumaker +# Copyright (c) 2013-2014 by Luke Shumaker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/lib/libremessages b/src/lib/libremessages index df0a98a..3ce0243 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -10,7 +10,7 @@ # Copyright (c) 2006 by Andras Voroskoi # Copyright (c) 2006 by Miklos Vajna # Copyright (c) 2011 by Joshua Haase -# Copyright (c) 2012-2013 by Luke Shumaker +# Copyright (c) 2012-2014 by Luke Shumaker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 443b4f6..90c40db 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -1,7 +1,7 @@ #!/usr/bin/env bash # librefetch # -# Copyright 2013 Luke Shumaker +# Copyright 2013-2014 Luke Shumaker # # This file is part of Parabola. # -- cgit v1.2.2 From 001ab1a91d1182d7023329bd2342dbf6ec265554 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 00:06:11 -0500 Subject: Hacking.md: change formatting on sample output a bit --- HACKING.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/HACKING.md b/HACKING.md index 2e5937b..ebe595b 100644 --- a/HACKING.md +++ b/HACKING.md @@ -51,13 +51,13 @@ 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 + print "Usage: %s [OPTIONS] VARS_ARE_UNDERSCORE_AND_CAPITAL" "${program_name}" + print "One line description of program, no period" echo - prose |More details. This is a paragraph. + prose "More details. This is a paragraph." echo - print |Options: - flag | -h Show this message + 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. -- cgit v1.2.2 From c43f0808583070a22e904cd650e8ed17fe781806 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 00:20:19 -0500 Subject: Normalize to use the string "Copyright (C)" --- src/abslibre-tools/createworkdir | 4 ++-- src/abslibre-tools/diff-unfree | 2 +- src/abslibre-tools/librerelease | 32 ++++++++++++------------- src/abslibre-tools/librestage | 4 ++-- src/aur | 6 ++--- src/chroot-tools/chcleanup | 2 +- src/chroot-tools/distcc-tool | 2 +- src/chroot-tools/librechroot | 6 ++--- src/chroot-tools/libremakepkg | 6 ++--- src/fullpkg/fullpkg-find | 52 ++++++++++++++++++++-------------------- src/gitget/gitget | 4 ++-- src/gitget/libregit | 2 +- src/lib/conf.sh | 2 +- src/lib/libreblacklist | 2 +- src/lib/librelib | 2 +- src/lib/libremessages | 18 +++++++------- src/librefetch/librefetch | 2 +- src/pkgbuild-check-nonfree | 10 ++++---- src/treepkg | 2 +- 19 files changed, 80 insertions(+), 80 deletions(-) diff --git a/src/abslibre-tools/createworkdir b/src/abslibre-tools/createworkdir index 4421ae2..27b285c 100755 --- a/src/abslibre-tools/createworkdir +++ b/src/abslibre-tools/createworkdir @@ -3,8 +3,8 @@ set -euE # CreateWorkDir # Creates a dir structure for working with Parabola packages -# Copyright 2010 Nicolás Reynolds -# Copyright 2013 Luke Shumaker +# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2013 Luke Shumaker # ---------- GNU General Public License 3 ---------- diff --git a/src/abslibre-tools/diff-unfree b/src/abslibre-tools/diff-unfree index 1ef0649..af5bbe5 100755 --- a/src/abslibre-tools/diff-unfree +++ b/src/abslibre-tools/diff-unfree @@ -1,7 +1,7 @@ #!/usr/bin/env bash # This script will help you diff a *-libre PKGBUILD against the unfree one # to check for updates. -# Copyright 2010 Nicolás Reynolds +# Copyright (C) 2010 Nicolás Reynolds # ---------- GNU General Public License 3 ---------- diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index 558ec37..8b1e05f 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -2,23 +2,23 @@ # Librerelease # Uploads packages into [staging] -# Copyright 2010 Nicolás Reynolds -# Copyright 2013-2014 Luke Shumaker +# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2013-2014 Luke Shumaker # For just the create_signature() function: -# Copyright (c) 2006-2013 Pacman Development Team -# Copyright (c) 2002-2006 by Judd Vinet -# Copyright (c) 2005 by Aurelien Foret -# Copyright (c) 2006 by Miklos Vajna -# Copyright (c) 2005 by Christian Hamar -# Copyright (c) 2006 by Alex Smith -# Copyright (c) 2006 by Andras Voroskoi -# Copyright (c) 2006-2013 Pacman Development Team -# Copyright (c) 2002-2006 by Judd Vinet -# Copyright (c) 2005 by Aurelien Foret -# Copyright (c) 2006 by Miklos Vajna -# Copyright (c) 2005 by Christian Hamar -# Copyright (c) 2006 by Alex Smith -# Copyright (c) 2006 by Andras Voroskoi +# Copyright (C) 2006-2013 Pacman Development Team +# Copyright (C) 2002-2006 by Judd Vinet +# Copyright (C) 2005 by Aurelien Foret +# Copyright (C) 2006 by Miklos Vajna +# Copyright (C) 2005 by Christian Hamar +# Copyright (C) 2006 by Alex Smith +# Copyright (C) 2006 by Andras Voroskoi +# Copyright (C) 2006-2013 Pacman Development Team +# Copyright (C) 2002-2006 by Judd Vinet +# Copyright (C) 2005 by Aurelien Foret +# Copyright (C) 2006 by Miklos Vajna +# Copyright (C) 2005 by Christian Hamar +# Copyright (C) 2006 by Alex Smith +# Copyright (C) 2006 by Andras Voroskoi # # This file is part of Parabola. # diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index 4a21133..610de50 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -2,8 +2,8 @@ # LibreStage # Prepares packages for upload -# Copyright 2010-2011 Nicolás Reynolds -# Copyright 2013-2014 Luke Shumaker +# Copyright (C) 2010-2011 Nicolás Reynolds +# Copyright (C) 2013-2014 Luke Shumaker # # This file is part of Parabola. # diff --git a/src/aur b/src/aur index a335b04..988d33f 100755 --- a/src/aur +++ b/src/aur @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# Copyright 2010 Joshua Ismael -# Copyright 2010 Nicolás Reynolds -# Copyright 2013-2014 Luke Shumaker +# Copyright (C) 2010 Joshua Ismael +# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2013-2014 Luke Shumaker # # This file is part of Parabola. # diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup index 2ff45f9..9ad121e 100755 --- a/src/chroot-tools/chcleanup +++ b/src/chroot-tools/chcleanup @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eE -# (c) Nicolás Reynolds +# Copyright (C) Nicolás Reynolds # Released under GPLv3 # # Performs chroot cleanup smartly, it only removes the unneeded packages or diff --git a/src/chroot-tools/distcc-tool b/src/chroot-tools/distcc-tool index e114d11..9f78ead 100755 --- a/src/chroot-tools/distcc-tool +++ b/src/chroot-tools/distcc-tool @@ -2,7 +2,7 @@ # -*- tab-width: 4; sh-basic-offset: 4 -*- # distcc-tool -# Copyright 2013-2014 Luke Shumaker +# Copyright (C) 2013-2014 Luke Shumaker # # This file is part of Parabola. # diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 73fb6b7..7b1e4a9 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -2,9 +2,9 @@ set -euE # librechroot -# Copyright 2010 Nicolás Reynolds -# Copyright 2011 Joshua Haase -# Copyright 2012-2014 Luke Shumaker +# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2011 Joshua Haase +# Copyright (C) 2012-2014 Luke Shumaker # # This file is part of Parabola. # diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index c838288..d6db0fd 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -2,9 +2,9 @@ set -euE # libremakepkg -# Copyright 2010-2011 Nicolás Reynolds -# Copyright 2011 Joshua Ismael Haase Hernández -# Copyright 2012-2014 Luke Shumaker +# Copyright (C) 2010-2011 Nicolás Reynolds +# Copyright (C) 2011 Joshua Ismael Haase Hernández +# Copyright (C) 2012-2014 Luke Shumaker # # This file is part of Parabola. # diff --git a/src/fullpkg/fullpkg-find b/src/fullpkg/fullpkg-find index a47717b..8bd630c 100755 --- a/src/fullpkg/fullpkg-find +++ b/src/fullpkg/fullpkg-find @@ -1,34 +1,34 @@ #!/usr/bin/env bash # set -x # uncomment for debug -# Copyright (c) 2011-2012 Joshua I. Haase H. (xihh) -# Copyright (c) 2011-2012 Nicolás Reynolds -# Copyright (c) 2012 Michał Masłowski -# Copyright (c) 2012-2014 Luke Shumaker +# Copyright (C) 2011-2012 Joshua I. Haase H. (xihh) +# Copyright (C) 2011-2012 Nicolás Reynolds +# Copyright (C) 2012 Michał Masłowski +# Copyright (C) 2012-2014 Luke Shumaker # # The copy_files() function is taken from makechrootpkg: -# Copyright (c) 2007 Armin Luntzer -# Copyright (c) 2007 Jason Chu -# Copyright (c) 2007, 2011 Dan McGee -# Copyright (c) 2007-2008 Travis Willard -# Copyright (c) 2007-2009 Aaron Griffin -# Copyright (c) 2008 Simo Leone -# Copyright (c) 2009 Biru Ionut -# Copyright (c) 2009 Biru Ionut -# Copyright (c) 2009 Evangelos Foutras -# Copyright (c) 2009 Francois Charette -# Copyright (c) 2009 Nezmer -# Copyright (c) 2009 Ronald van Haren -# Copyright (c) 2009-2011 Andrea Scarpino -# Copyright (c) 2009-2012 Allan McRae -# Copyright (c) 2009-2012 Eric Bélanger -# Copyright (c) 2009-2012 Pierre Schmitz -# Copyright (c) 2010 Byron Clark -# Copyright (c) 2011 Ionut Biru -# Copyright (c) 2011 Lukas Fleischer -# Copyright (c) 2011-2012 Florian Pritz -# Copyright (c) 2011-2013 Jan Alexander Steffens (heftig) -# Copyright (c) 2013 Sébastien Luttringer +# Copyright (C) 2007 Armin Luntzer +# Copyright (C) 2007 Jason Chu +# Copyright (C) 2007, 2011 Dan McGee +# Copyright (C) 2007-2008 Travis Willard +# Copyright (C) 2007-2009 Aaron Griffin +# Copyright (C) 2008 Simo Leone +# Copyright (C) 2009 Biru Ionut +# Copyright (C) 2009 Biru Ionut +# Copyright (C) 2009 Evangelos Foutras +# Copyright (C) 2009 Francois Charette +# Copyright (C) 2009 Nezmer +# Copyright (C) 2009 Ronald van Haren +# Copyright (C) 2009-2011 Andrea Scarpino +# Copyright (C) 2009-2012 Allan McRae +# Copyright (C) 2009-2012 Eric Bélanger +# Copyright (C) 2009-2012 Pierre Schmitz +# Copyright (C) 2010 Byron Clark +# Copyright (C) 2011 Ionut Biru +# Copyright (C) 2011 Lukas Fleischer +# Copyright (C) 2011-2012 Florian Pritz +# Copyright (C) 2011-2013 Jan Alexander Steffens (heftig) +# Copyright (C) 2013 Sébastien Luttringer # # Because of the code from makechrootpkg, this file is GPLv2, instead of GPLv3 # like most of libretools. diff --git a/src/gitget/gitget b/src/gitget/gitget index 194ec05..3e35cec 100755 --- a/src/gitget/gitget +++ b/src/gitget/gitget @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# Copyright (c) 2012-2013 Pacman Development Team -# Copyright (c) 2012-2013 Luke Shumaker +# Copyright (C) 2012-2013 Pacman Development Team +# Copyright (C) 2012-2013 Luke Shumaker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/gitget/libregit b/src/gitget/libregit index f89a402..95b59ff 100755 --- a/src/gitget/libregit +++ b/src/gitget/libregit @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2012-2013 Luke Shumaker +# Copyright (C) 2012-2013 Luke Shumaker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/lib/conf.sh b/src/lib/conf.sh index cdba893..ee52f6f 100644 --- a/src/lib/conf.sh +++ b/src/lib/conf.sh @@ -1,7 +1,7 @@ #!/bin/bash # non-executable, but put this there as a hint to text editors # This may be included with or without `set -euE` -# Copyright (c) 2012-2014 by Luke Shumaker +# Copyright (C) 2012-2014 by Luke Shumaker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/lib/libreblacklist b/src/lib/libreblacklist index 5305896..5525098 100755 --- a/src/lib/libreblacklist +++ b/src/lib/libreblacklist @@ -2,7 +2,7 @@ # This may be included with or without `set -euE` # When run directly, it does `set -euE` -# Copyright (c) 2013-2014 by Luke Shumaker +# Copyright (C) 2013-2014 by Luke Shumaker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/lib/librelib b/src/lib/librelib index e9c8c8b..d0a06e5 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2013-2014 by Luke Shumaker +# Copyright (C) 2013-2014 by Luke Shumaker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/lib/libremessages b/src/lib/libremessages index 3ce0243..e5b7157 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -2,15 +2,15 @@ # This may be included with or without `set -euE` # When run directly, it does `set -euE` -# Copyright (c) 2002-2006 by Judd Vinet -# Copyright (c) 2006-2010 Pacman Development Team -# Copyright (c) 2005 by Aurelien Foret -# Copyright (c) 2005 by Christian Hamar -# Copyright (c) 2006 by Alex Smith -# Copyright (c) 2006 by Andras Voroskoi -# Copyright (c) 2006 by Miklos Vajna -# Copyright (c) 2011 by Joshua Haase -# Copyright (c) 2012-2014 by Luke Shumaker +# Copyright (C) 2002-2006 by Judd Vinet +# Copyright (C) 2006-2010 Pacman Development Team +# Copyright (C) 2005 by Aurelien Foret +# Copyright (C) 2005 by Christian Hamar +# Copyright (C) 2006 by Alex Smith +# Copyright (C) 2006 by Andras Voroskoi +# Copyright (C) 2006 by Miklos Vajna +# Copyright (C) 2011 by Joshua Haase +# Copyright (C) 2012-2014 by Luke Shumaker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 90c40db..4ecc8fe 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -1,7 +1,7 @@ #!/usr/bin/env bash # librefetch # -# Copyright 2013-2014 Luke Shumaker +# Copyright (C) 2013-2014 Luke Shumaker # # This file is part of Parabola. # diff --git a/src/pkgbuild-check-nonfree b/src/pkgbuild-check-nonfree index 18fac91..7b73745 100755 --- a/src/pkgbuild-check-nonfree +++ b/src/pkgbuild-check-nonfree @@ -2,11 +2,11 @@ # -*- tab-width: 4 ; sh-basic-offset: 4 -*- # pkgbuild-check-nonfree -# Copyright 2010 Haase Hernández -# Copyright 2010 Joseph Graham -# Copyright 2010 Joshua Ismael -# Copyright 2010 Nicolás Reynolds -# Copyright 2012-2013 Luke Shumaker +# Copyright (C) 2010 Haase Hernández +# Copyright (C) 2010 Joseph Graham +# Copyright (C) 2010 Joshua Ismael +# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2012-2013 Luke Shumaker # # This file is part of Parabola. # diff --git a/src/treepkg b/src/treepkg index 8879e54..1826c8f 100755 --- a/src/treepkg +++ b/src/treepkg @@ -1,6 +1,6 @@ #!/usr/bin/env bash #set -x -# (c) 2012 Nicolás Reynolds +# Copyright (C) 2012 Nicolás Reynolds # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- cgit v1.2.2 From 3f0dede97ee6c75c32cefd283eb65be782e4b84b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 01:48:25 -0500 Subject: librechroot: fix setting CHROOTEXTRAPKG --- src/chroot-tools/librechroot | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 7b1e4a9..fcabcff 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -342,10 +342,12 @@ main() { mkdir -p "$copydir/etc/libretools.d" { - if [[ -n ${CHROOTEXTRAPKG[*]:-} ]]; then - declare -p CHROOTEXTRAPKG | sed -r 's/declare( -.)* //' + if [[ ${#CHROOTEXTRAPKG[*]} -eq 0 ]]; then + echo 'CHROOTEXTRAPKG=()' else - printf 'CHROOTEXTRAPKG=()\n' + printf 'CHROOTEXTRAPKG=(' + printf '%q ' "${CHROOTEXTRAPKG[@]}" + printf ')\n' fi } > "$copydir"/etc/libretools.d/chroot.conf -- cgit v1.2.2 From e3108aeb1e38e9d6b243015344c6b4d856221fb4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 04:16:17 -0500 Subject: src/lib/Makefile: fix extra files from being included in libexecs --- src/lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Makefile b/src/lib/Makefile index 4ed5e4f..495abb1 100644 --- a/src/lib/Makefile +++ b/src/lib/Makefile @@ -1,5 +1,5 @@ copy_files = common.sh.in -libexecs = $(filter-out librelib,$(wildcard libre*)) +libexecs = $(filter-out librelib,$(progs)) # include common.sh in libs explicitly, because it might not exist yet # when the wildcard is performed libs = $(sort $(wildcard *.sh) common.sh) -- cgit v1.2.2 From e0b9e3ab07f64b9cbf575f560a25e5712208b8d7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 12:41:52 -0500 Subject: test/librechroot: test the -N flag --- test/librechroot-test.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index d458cd9..ae5dd4b 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -44,6 +44,14 @@ it_respects_exit_status_if_out_isnt_a_tty() ( [[ $r == 3 ]] ) +it_disables_networking_when_requested() { + require network sudo || return 0 + libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty + + testsudo librechroot -l "$roundup_test_name" run curl https://repo.parabolagnulinux.org/ >/dev/null + ! testsudo librechroot -l "$roundup_test_name" -N run curl https://repo.parabolagnulinux.org/ >/dev/null +} + it_displays_help_as_normal_user() { rm -rf "$XDG_CONFIG_HOME" LC_ALL=C librechroot help >$tmpdir/stdout 2>$tmpdir/stderr -- cgit v1.2.2 From 1a7621e6e3ca4ad7c132d1b9d4f7d5dc67fc1a32 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 12:46:01 -0500 Subject: test/librechroot: test CHROOTEXTRAPKG --- test/librechroot-test.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index ae5dd4b..f8dd2ba 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -52,6 +52,20 @@ it_disables_networking_when_requested() { ! testsudo librechroot -l "$roundup_test_name" -N run curl https://repo.parabolagnulinux.org/ >/dev/null } +it_handles_CHROOTEXTRAPKG_correctly() { + requuire network sudo || return 0 + libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty + + ! testsudo librechroot -l "$roundup_test_name" run lsof + echo "CHROOTEXTRAPKG=(lsof)" >> "$XDG_CONFIG_HOME"/libretools/chroot.conf + testsudo librechroot -l "$roundup_test_name" install-name lsof + testsudo librechroot -l "$roundup_test_name" clean-pkgs + testsudo librechroot -l "$roundup_test_name" run lsof + echo "CHROOTEXTRAPKG=()" >> "$XDG_CONFIG_HOME"/libretools/chroot.conf + testsudo librechroot -l "$roundup_test_name" clean-pkgs + ! testsudo librechroot -l "$roundup_test_name" run lsof +} + it_displays_help_as_normal_user() { rm -rf "$XDG_CONFIG_HOME" LC_ALL=C librechroot help >$tmpdir/stdout 2>$tmpdir/stderr -- cgit v1.2.2 From d7dcce53396d32c090e1e175c9c606a78f5cb3d6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 20:18:20 -0500 Subject: mkarchroot: don't let the environment affect pacstrap --- src/chroot-tools/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chroot-tools/Makefile b/src/chroot-tools/Makefile index d08775e..4ecff51 100644 --- a/src/chroot-tools/Makefile +++ b/src/chroot-tools/Makefile @@ -34,7 +34,7 @@ makechrootpkg.sh: %: %.ugly Makefile mkarchroot: mkarchroot.in Makefile @echo '< $< M4_EDIT | SED > $@' - @<'$<' $(edit) | sed 's|arch-nspawn|$$(librelib chroot/&)|' >'$@' || { rm -f -- '$@'; false; } + @<'$<' $(edit) | sed -e 's|arch-nspawn|$$(librelib chroot/&)|' -e 's/pacstrap/env -i &/' >'$@' || { rm -f -- '$@'; false; } @echo 'CHMOD $<'; chmod 755 "$@" || { rm -f -- '$@'; false; } archroot: %: %.in Makefile -- cgit v1.2.2 From e4ccc15cccf46e6265347f4fdee598b0561c4c74 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 20:20:20 -0500 Subject: librechroot-test: check for the existance of ca-certificates.crt --- test/librechroot-test.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index f8dd2ba..3896005 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -44,6 +44,12 @@ it_respects_exit_status_if_out_isnt_a_tty() ( [[ $r == 3 ]] ) +it_creates_ca_certificates() { + require network sudo || return 0 + libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty + testsudo librechroot -l "$roundup_test_name" run test -r /etc/ssl/certs/ca-certificates.crt +} + it_disables_networking_when_requested() { require network sudo || return 0 libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty -- cgit v1.2.2 From 804e5e1093c3aa8258bf9f8c97ff661cdf8407f1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 20:22:24 -0500 Subject: Makefiles: use .DELETE_ON_ERROR: --- common.mk | 6 ++++-- src/chroot-tools/Makefile | 14 +++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/common.mk b/common.mk index ea89de1..deb64c7 100644 --- a/common.mk +++ b/common.mk @@ -81,8 +81,8 @@ build: PHONY $(build_files) ronn --html $(RONNFLAGS) < '$<' > '$@' %: %.in @echo "GEN $@" - @$(edit) <"$<" >"$@" || { rm -f -- '$@'; false; } - @chmod 755 "$@" || { rm -f -- '$@'; false; } + @$(edit) <"$<" >"$@" + @chmod 755 "$@" # Build ######################################################################## @@ -146,3 +146,5 @@ clean-hook: PHONY FORCE: PHONY PHONY: .PHONY: FORCE PHONY + +.DELETE_ON_ERROR: diff --git a/src/chroot-tools/Makefile b/src/chroot-tools/Makefile index 4ecff51..97ca688 100644 --- a/src/chroot-tools/Makefile +++ b/src/chroot-tools/Makefile @@ -27,19 +27,19 @@ makechrootpkg.sh.in: %.sh.in: $(devtoolsdir)/%.in cp $< $@ makechrootpkg.sh.ugly: %.ugly: %.in %.patch Makefile cp $*.in $@ - @echo 'PATCH $@ $*.patch'; patch $@ $*.patch || { rm -f -- '$@'; false; } + @echo 'PATCH $@ $*.patch'; patch $@ $*.patch makechrootpkg.sh: %: %.ugly Makefile - @echo 'EDIT < $< > $@'; $(edit) <'$<' >'$@' || { rm -f -- '$@'; false; } - @echo 'INDENT $@'; $(call indent,$@) || { rm -f -- '$@'; false; } + @echo 'EDIT < $< > $@'; $(edit) <'$<' >'$@' + @echo 'INDENT $@'; $(call indent,$@) mkarchroot: mkarchroot.in Makefile @echo '< $< M4_EDIT | SED > $@' - @<'$<' $(edit) | sed -e 's|arch-nspawn|$$(librelib chroot/&)|' -e 's/pacstrap/env -i &/' >'$@' || { rm -f -- '$@'; false; } - @echo 'CHMOD $<'; chmod 755 "$@" || { rm -f -- '$@'; false; } + @<'$<' $(edit) | sed -e 's|arch-nspawn|$$(librelib chroot/&)|' -e 's/pacstrap/env -i &/' >'$@' + @echo 'CHMOD $<'; chmod 755 "$@" archroot: %: %.in Makefile @echo "GEN $@" - @$(edit) <"$<" >"$@" || { rm -f -- '$@'; false; } - @chmod 755 "$@" || { rm -f -- '$@'; false; } + @$(edit) <"$<" >"$@" + @chmod 755 "$@" distcc-tool.pot: xgettext-keywords-sh+=--keyword=errusage -- cgit v1.2.2 From ef7a330eae68da2f47c617502b28a2f8c9eeb792 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 20:54:07 -0500 Subject: libremakepkg-test: test the -N flag --- test/libremakepkg-test.sh | 25 +++++++++++++++++++++++++ test/libremakepkg.d/PKGBUILD-netbuild | 16 ++++++++++++++++ test/libremakepkg.d/PKGBUILD-netpackage | 12 ++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 test/libremakepkg.d/PKGBUILD-netbuild create mode 100644 test/libremakepkg.d/PKGBUILD-netpackage diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh index 7b64dc0..06cf695 100644 --- a/test/libremakepkg-test.sh +++ b/test/libremakepkg-test.sh @@ -33,6 +33,31 @@ it_builds_a_trivial_package() { [[ -f $(echo libretools-hello-1.0-1-any.pkg.tar.?z) ]] } + +it_disables_networking_during_build() { + require network sudo || return 0 + cp libremakepkg.d/PKGBUILD-netbuild "$tmpdir/PKGBUILD" + cd "$tmpdir" + + libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty + ! testsudo libremakepkg -l "$roundup_test_name" + ! [[ -f $(echo libretools-netbuild-1.0-1-any.pkg.tar.?z) ]] + testsudo libremakepkg -l "$roundup_test_name" -N + [[ -f $(echo libretools-netbuild-1.0-1-any.pkg.tar.?z) ]] +} + +it_disables_networking_during_package() { + require network sudo || return 0 + cp libremakepkg.d/PKGBUILD-netpackage "$tmpdir/PKGBUILD" + cd "$tmpdir" + + libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty + ! testsudo libremakepkg -l "$roundup_test_name" + ! [[ -f $(echo libretools-netpackage-1.0-1-any.pkg.tar.?z) ]] + testsudo libremakepkg -l "$roundup_test_name" -N + [[ -f $(echo libretools-netpackage-1.0-1-any.pkg.tar.?z) ]] +} + it_cleans_the_chroot_before_building() { require network sudo || return 0 # 1. First, we build testpkg1 diff --git a/test/libremakepkg.d/PKGBUILD-netbuild b/test/libremakepkg.d/PKGBUILD-netbuild new file mode 100644 index 0000000..c1335a6 --- /dev/null +++ b/test/libremakepkg.d/PKGBUILD-netbuild @@ -0,0 +1,16 @@ +pkgname='libretools-netbuild' +pkgver=1.0 +license=('GPL') +url='https://parabolagnulinux.org' + +pkgrel=1 +arch=(any) + +build() { + curl https://repo.parabolagnulinux.org/ > index.html +} + +package() { + cd "$srcdir" + install -Dm644 index.html "$pkgdir"/usr/share/$pkgname/index.html +} diff --git a/test/libremakepkg.d/PKGBUILD-netpackage b/test/libremakepkg.d/PKGBUILD-netpackage new file mode 100644 index 0000000..cbefe8f --- /dev/null +++ b/test/libremakepkg.d/PKGBUILD-netpackage @@ -0,0 +1,12 @@ +pkgname='libretools-netpackage' +pkgver=1.0 +license=('GPL') +url='https://parabolagnulinux.org' + +pkgrel=1 +arch=(any) + +package() { + install -d "$pkgdir"/usr/share/$pkgname + curl https://repo.parabolagnulinux.org/ > "$pkgdir"/usr/share/$pkgname/index.html +} -- cgit v1.2.2 From 6fb2295a25ee4a24b38f4fce1b652a60cedd1b64 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 22:24:28 -0500 Subject: test: `! true` doesn't trip `set -e`, do subshell magic --- test/aur-test.sh | 2 +- test/is_built-test.sh | 2 +- test/lib-blacklist-test.sh | 10 +++++----- test/lib-messages-test.sh | 4 ++-- test/librechroot-test.sh | 14 +++++++------- test/librelib-test.sh | 4 ++-- test/libremakepkg-test.sh | 12 ++++++------ test/librestage-test.sh | 4 ++-- test/pkgbuild-check-nonfree-test.sh | 10 +++++----- test/test-common.sh | 6 ++++++ 10 files changed, 37 insertions(+), 31 deletions(-) diff --git a/test/aur-test.sh b/test/aur-test.sh index 8bcb5ef..5de590b 100644 --- a/test/aur-test.sh +++ b/test/aur-test.sh @@ -24,7 +24,7 @@ it_fails_with_0_args() { [[ $stat != 0 ]] empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr } # TODO: Actually test diff --git a/test/is_built-test.sh b/test/is_built-test.sh index af754dc..f7f6c65 100644 --- a/test/is_built-test.sh +++ b/test/is_built-test.sh @@ -24,7 +24,7 @@ it_fails_with_0_args() { [[ $stat -gt 1 ]] empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr } it_succeeds_with_1_arg() { diff --git a/test/lib-blacklist-test.sh b/test/lib-blacklist-test.sh index 640ed77..9dfd5da 100644 --- a/test/lib-blacklist-test.sh +++ b/test/lib-blacklist-test.sh @@ -53,7 +53,7 @@ it_fails_update_with_no_blacklist_or_network() { [[ $stat != 0 ]] empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr } it_fails_cat_with_no_blacklist_or_network() { @@ -64,7 +64,7 @@ it_fails_cat_with_no_blacklist_or_network() { [[ $stat != 0 ]] empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr } it_fails_update_when_BLACKLIST_is_unset() { @@ -75,7 +75,7 @@ it_fails_update_when_BLACKLIST_is_unset() { [[ $stat != 0 ]] empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr } it_fails_cat_when_syntax_error_in_conf() { @@ -87,7 +87,7 @@ it_fails_cat_when_syntax_error_in_conf() { [[ $stat != 0 ]] empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr } it_downloads_the_blacklist_as_needed() { @@ -97,7 +97,7 @@ it_downloads_the_blacklist_as_needed() { libreblacklist cat >$tmpdir/stdout 2>$tmpdir/stderr - ! empty $tmpdir/stdout + not empty $tmpdir/stdout } it_downloads_the_blacklist_repeatedly() { diff --git a/test/lib-messages-test.sh b/test/lib-messages-test.sh index fffff36..3fcac63 100644 --- a/test/lib-messages-test.sh +++ b/test/lib-messages-test.sh @@ -31,14 +31,14 @@ it_works_with_no_color_and_set_euE() ( ) >$tmpdir/stdout 2>$tmpdir/stderr empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr ) it_can_be_called_without_including() { libremessages msg Foo >$tmpdir/stdout 2>$tmpdir/stderr empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr } it_fails_with_msg_and_no_args() { diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index 3896005..c22ac58 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -54,22 +54,22 @@ it_disables_networking_when_requested() { require network sudo || return 0 libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty - testsudo librechroot -l "$roundup_test_name" run curl https://repo.parabolagnulinux.org/ >/dev/null - ! testsudo librechroot -l "$roundup_test_name" -N run curl https://repo.parabolagnulinux.org/ >/dev/null + testsudo librechroot -l "$roundup_test_name" run curl https://repo.parabolagnulinux.org/ >/dev/null + not testsudo librechroot -l "$roundup_test_name" -N run curl https://repo.parabolagnulinux.org/ >/dev/null } it_handles_CHROOTEXTRAPKG_correctly() { requuire network sudo || return 0 libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty - ! testsudo librechroot -l "$roundup_test_name" run lsof + not testsudo librechroot -l "$roundup_test_name" run lsof echo "CHROOTEXTRAPKG=(lsof)" >> "$XDG_CONFIG_HOME"/libretools/chroot.conf testsudo librechroot -l "$roundup_test_name" install-name lsof testsudo librechroot -l "$roundup_test_name" clean-pkgs testsudo librechroot -l "$roundup_test_name" run lsof echo "CHROOTEXTRAPKG=()" >> "$XDG_CONFIG_HOME"/libretools/chroot.conf testsudo librechroot -l "$roundup_test_name" clean-pkgs - ! testsudo librechroot -l "$roundup_test_name" run lsof + not testsudo librechroot -l "$roundup_test_name" run lsof } it_displays_help_as_normal_user() { @@ -85,7 +85,7 @@ it_otherwise_fails_as_normal_user() { [[ $stat != 0 ]] empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr } it_displays_help_and_fails_with_0_args() { @@ -103,7 +103,7 @@ it_fails_for_unknown_commands() { [[ $stat != 0 ]] empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr } # requires sudo so we know it's not failing because it needs root @@ -113,5 +113,5 @@ it_fails_for_unknown_flags() { [[ $stat != 0 ]] empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr } diff --git a/test/librelib-test.sh b/test/librelib-test.sh index 23c38dc..a74ce0a 100644 --- a/test/librelib-test.sh +++ b/test/librelib-test.sh @@ -26,7 +26,7 @@ it_fails_with_2_args() { librelib a b >$tmpdir/stdout 2>$tmpdir/stderr || ret=$? empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr [[ $ret != 0 ]] } @@ -68,6 +68,6 @@ it_fails_to_find_phony() { librelib phony >$tmpdir/stdout 2>$tmpdir/stderr || ret=$? empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr [[ $ret != 0 ]] } diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh index 06cf695..811c8ed 100644 --- a/test/libremakepkg-test.sh +++ b/test/libremakepkg-test.sh @@ -40,8 +40,8 @@ it_disables_networking_during_build() { cd "$tmpdir" libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty - ! testsudo libremakepkg -l "$roundup_test_name" - ! [[ -f $(echo libretools-netbuild-1.0-1-any.pkg.tar.?z) ]] + not testsudo libremakepkg -l "$roundup_test_name" + not [[ -f $(echo libretools-netbuild-1.0-1-any.pkg.tar.?z) ]] testsudo libremakepkg -l "$roundup_test_name" -N [[ -f $(echo libretools-netbuild-1.0-1-any.pkg.tar.?z) ]] } @@ -52,8 +52,8 @@ it_disables_networking_during_package() { cd "$tmpdir" libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty - ! testsudo libremakepkg -l "$roundup_test_name" - ! [[ -f $(echo libretools-netpackage-1.0-1-any.pkg.tar.?z) ]] + not testsudo libremakepkg -l "$roundup_test_name" + not [[ -f $(echo libretools-netpackage-1.0-1-any.pkg.tar.?z) ]] testsudo libremakepkg -l "$roundup_test_name" -N [[ -f $(echo libretools-netpackage-1.0-1-any.pkg.tar.?z) ]] } @@ -83,7 +83,7 @@ it_cleans_the_chroot_before_building() { testsudo librechroot -l "$roundup_test_name" run libretools-testpkg1 'first time, pass' cd "$tmpdir/3" testsudo libremakepkg -l "$roundup_test_name" &> "$tmpdir/out" || { r=$?; tail "$tmpdir/out"|cat -v; return $r; } - ! testsudo librechroot -l "$roundup_test_name" run libretools-testpkg1 'second time, fail' + not testsudo librechroot -l "$roundup_test_name" run libretools-testpkg1 'second time, fail' } it_handles_PKGDEST_not_existing() { @@ -114,5 +114,5 @@ it_otherwise_fails_as_normal_user() { [[ $stat != 0 ]] empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr } diff --git a/test/librestage-test.sh b/test/librestage-test.sh index 6728143..460eb58 100644 --- a/test/librestage-test.sh +++ b/test/librestage-test.sh @@ -34,7 +34,7 @@ it_fails_with_0_args() { [[ $stat != 0 ]] empty "$tmpdir/stdout" - ! empty "$tmpdir/stderr" + not empty "$tmpdir/stderr" } it_fails_with_invalid_args() { @@ -42,7 +42,7 @@ it_fails_with_invalid_args() { [[ $stat != 0 ]] empty "$tmpdir/stdout" - ! empty "$tmpdir/stderr" + not empty "$tmpdir/stderr" } # This was an actual bug I hit with md/emacs-mdmua a long time ago; solution was diff --git a/test/pkgbuild-check-nonfree-test.sh b/test/pkgbuild-check-nonfree-test.sh index 6463d64..2af2669 100644 --- a/test/pkgbuild-check-nonfree-test.sh +++ b/test/pkgbuild-check-nonfree-test.sh @@ -39,7 +39,7 @@ it_succeeds_for_free_depends() { $pcn $pcn.d/PKGBUILD.free >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr [[ $stat == 0 ]] } @@ -47,7 +47,7 @@ it_succeeds_for_nonfree_depend_with_replacement() { $pcn $pcn.d/PKGBUILD.nonfree-replacement >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr [[ $stat == 0 ]] } @@ -55,14 +55,14 @@ it_fails_for_nonfree_depend() { $pcn $pcn.d/PKGBUILD.nonfree >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr local pcn_stat=$stat $psn $pcn_stat >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr } it_fails_when_there_is_no_blacklist() { @@ -73,6 +73,6 @@ it_fails_when_there_is_no_blacklist() { $pcn $pcn.d/PKGBUILD.free >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? empty $tmpdir/stdout - ! empty $tmpdir/stderr + not empty $tmpdir/stderr [[ $stat != 0 ]] && [[ $stat != 15 ]] } diff --git a/test/test-common.sh b/test/test-common.sh index 3df7107..c525dd8 100644 --- a/test/test-common.sh +++ b/test/test-common.sh @@ -70,3 +70,9 @@ empty() ( set +x [[ $(stat -c %s "$1") -eq 0 ]] ) + +# Just using '!' doesn't trip `set -e` +not() ( + set +x + ! eval "$@" +) -- cgit v1.2.2 From 9f28b8f1d7ecc211e4df9f4a16a04960ed1bd582 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 22:34:00 -0500 Subject: libremakepkg: fix network handling --- src/chroot-tools/libremakepkg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index d6db0fd..a459009 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -121,14 +121,14 @@ build() ( local copydir=$1; shift local repack=$1; shift - local netflag='' local run=() if $INCHROOT; then - ! $NONET || netflag='-N' run=(unshare) + if $NONET; then run+=('-n'); fi else - ! $NONET || netflag='-n' - run=(librechroot "${librechroot_flags[@]}" run) + run=(librechroot "${librechroot_flags[@]}") + if $NONET; then run+=('-N'); fi + run+=(run) fi prepare_chroot "$copydir" "$LIBREHOME" "$repack" false -- cgit v1.2.2 From 965371ef3f70120555d957a0d0703016f8df8307 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Feb 2014 16:01:51 -0500 Subject: librechroot update: correctly handle 'filesystem' upgrades --- 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 fcabcff..dcf8488 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -381,7 +381,7 @@ main() { arch-nspawn "$copydir" pacman -Sy "$@" ;; update) - arch-nspawn "$copydir" pacman -Syu --noconfirm + arch-nspawn "$copydir" bash -c 'pacman -Syw --noconfirm && umount /etc/resolv.conf && pacman -Su --noconfirm' ;; clean-pkgs) trap "rm -f '$copydir'/bin/chcleanup '$copydir'/chrootexec" EXIT -- cgit v1.2.2 From c55053b00f34a90e27dff3d92ae6bbcdac0edaf4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Feb 2014 19:38:24 -0500 Subject: libremakepkg: fix installing dependencies that aren't in the paccache I can't figure out a reliable way to test this, as it depends on the host pacman cache. --- src/chroot-tools/libremakepkg | 17 +++++++++-------- src/chroot-tools/makechrootpkg.sh.patch | 27 +++++++++++++-------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index a459009..26080bc 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -121,21 +121,22 @@ build() ( local copydir=$1; shift local repack=$1; shift - local run=() + local run_ynet=() + local run_nnet=() if $INCHROOT; then - run=(unshare) - if $NONET; then run+=('-n'); fi + run_ynet=(unshare) + run_nnet=(unshare -n) else - run=(librechroot "${librechroot_flags[@]}") - if $NONET; then run+=('-N'); fi - run+=(run) + run_ynet=(librechroot "${librechroot_flags[@]}" run) + run_nnet=(librechroot "${librechroot_flags[@]}" -N run) fi + $NONET || run_nnet=("${run_ynet[@]}") prepare_chroot "$copydir" "$LIBREHOME" "$repack" false - "${run[@]}" /chrootprepare "$@" |& indent + "${run_ynet[@]}" /chrootprepare false "$@" |& indent run_hook pre_build "$copydir" trap "run_hook post_build '$copydir'" EXIT - "${run[@]}" /chrootbuild "$@" |& indent + "${run_nnet[@]}" /chrootbuild false "$@" |& indent ) # The main program ############################################################# diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch index d6c96f9..817eaa5 100644 --- a/src/chroot-tools/makechrootpkg.sh.patch +++ b/src/chroot-tools/makechrootpkg.sh.patch @@ -1,5 +1,5 @@ --- makechrootpkg.sh.in 2014-01-05 18:51:41.463720929 -0500 -+++ makechrootpkg.sh.ugly 2014-01-05 18:52:41.624501065 -0500 ++++ makechrootpkg.sh.ugly 2014-02-05 19:01:17.583560384 -0500 @@ -12,6 +12,7 @@ shopt -s nullglob @@ -206,7 +206,7 @@ makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o else ( export SRCDEST BUILDDIR="$builddir" -@@ -277,20 +331,18 @@ +@@ -277,10 +331,10 @@ (( $? != 0 )) && die "Could not download sources." # Clean up garbage from verifysource @@ -218,11 +218,8 @@ +_chrootprepare() { # This function isn't run in makechrootpkg, # so no global variables -- local run_namcap="$1"; shift -- local makepkg_args=("$@") -- - . /etc/profile - export HOME=/build + local run_namcap="$1"; shift +@@ -291,6 +345,7 @@ shopt -s nullglob # XXX: Workaround makepkg disliking read-only dirs @@ -230,10 +227,12 @@ ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* -@@ -313,9 +365,23 @@ - rm PKGBUILD* +@@ -314,8 +369,25 @@ cp /startdir_host/PKGBUILD* . chown nobody PKGBUILD* + ++ # Sync deps now, as networking may be disabled during _chrootbuild ++ sudo -u nobody makepkg "${makepkg_args[@]}" -eo +} + +_chrootbuild() { @@ -247,14 +246,14 @@ + shopt -s nullglob + + cd /startdir - ++ # Safety check if [[ ! -w PKGBUILD ]]; then + # XXX: internationalize this message echo "Can't write to PKGBUILD!" exit 1 fi -@@ -333,12 +399,24 @@ +@@ -333,12 +405,24 @@ exit 0 } @@ -279,7 +278,7 @@ for l in "$copydir"/logdest/*; do [[ $l == */logpipe.* ]] && continue chown "$src_owner" "$l" -@@ -352,6 +430,10 @@ +@@ -352,6 +436,10 @@ } # }}} @@ -290,7 +289,7 @@ umask 0022 load_vars /etc/makepkg.conf -@@ -363,30 +445,45 @@ +@@ -363,30 +451,45 @@ [[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD [[ -d $LOGDEST ]] || LOGDEST=$PWD @@ -342,7 +341,7 @@ if (( ret != 0 )); then if $temp_chroot; then -@@ -397,3 +494,4 @@ +@@ -397,3 +500,4 @@ else true fi -- cgit v1.2.2 From 93276b1059c6bce3aa6e400f70160b8b89cab007 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Feb 2014 20:05:13 -0500 Subject: libremakepkg: make sure the local repository exists before syncing pkgs --- src/chroot-tools/makechrootpkg.sh.patch | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch index 817eaa5..8c42089 100644 --- a/src/chroot-tools/makechrootpkg.sh.patch +++ b/src/chroot-tools/makechrootpkg.sh.patch @@ -1,5 +1,5 @@ --- makechrootpkg.sh.in 2014-01-05 18:51:41.463720929 -0500 -+++ makechrootpkg.sh.ugly 2014-02-05 19:01:17.583560384 -0500 ++++ makechrootpkg.sh.ugly 2014-02-05 19:59:10.991879605 -0500 @@ -12,6 +12,7 @@ shopt -s nullglob @@ -227,11 +227,12 @@ ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* -@@ -314,8 +369,25 @@ +@@ -314,8 +369,26 @@ cp /startdir_host/PKGBUILD* . chown nobody PKGBUILD* + # Sync deps now, as networking may be disabled during _chrootbuild ++ cp /repo/repo.db /var/lib/pacman/sync/repo.db + sudo -u nobody makepkg "${makepkg_args[@]}" -eo +} + @@ -253,7 +254,7 @@ echo "Can't write to PKGBUILD!" exit 1 fi -@@ -333,12 +405,24 @@ +@@ -333,12 +406,24 @@ exit 0 } @@ -278,7 +279,7 @@ for l in "$copydir"/logdest/*; do [[ $l == */logpipe.* ]] && continue chown "$src_owner" "$l" -@@ -352,6 +436,10 @@ +@@ -352,6 +437,10 @@ } # }}} @@ -289,7 +290,7 @@ umask 0022 load_vars /etc/makepkg.conf -@@ -363,30 +451,45 @@ +@@ -363,30 +452,45 @@ [[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD [[ -d $LOGDEST ]] || LOGDEST=$PWD @@ -341,7 +342,7 @@ if (( ret != 0 )); then if $temp_chroot; then -@@ -397,3 +500,4 @@ +@@ -397,3 +501,4 @@ else true fi -- cgit v1.2.2 From 39a5bee5b060a092cbc6f9b40295bb8853e760a9 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Feb 2014 14:20:07 -0500 Subject: librefetch: touch symlinks correctly, don't be tricked by files that look like flags --- src/librefetch/librefetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 4ecc8fe..82c8703 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -264,7 +264,7 @@ makepkg_modify=' /tidy_install\(\) \{/,/^\}$/ { /for .*PURGE_TARGETS/itidy_install_purge /for .*PURGE_TARGETS/,/done/d - /^\}$/ifind . -exec touch --date="1990-01-01 0:0:0 +0" {} + + /^\}$/ifind . -exec touch --no-dereference --date="1990-01-01 0:0:0 +0" -- {} + } /download_sources\(\) \{/ { -- cgit v1.2.2 From dd8c9b738c811a03c5e9ccd57ec73beccc5c1eeb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Feb 2014 20:10:01 -0500 Subject: fix `librechroot update` --- src/chroot-tools/librechroot | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index dcf8488..051148d 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -381,7 +381,9 @@ main() { arch-nspawn "$copydir" pacman -Sy "$@" ;; update) - arch-nspawn "$copydir" bash -c 'pacman -Syw --noconfirm && umount /etc/resolv.conf && pacman -Su --noconfirm' + # umount resolv.conf so that it can be upgraded, if nescessary + # this disables DNS, so fetch everything first + arch-nspawn "$copydir" bash -c 'pacman -Syuw --noconfirm && umount /etc/resolv.conf && pacman -Su --noconfirm' ;; clean-pkgs) trap "rm -f '$copydir'/bin/chcleanup '$copydir'/chrootexec" EXIT -- cgit v1.2.2 From 5065c3b8cda743decc6d1c8bf963640a7ed49018 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Feb 2014 20:22:38 -0500 Subject: libremakepkg: extract the source (prepare()) while the network is still on --- src/chroot-tools/makechrootpkg.sh.patch | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch index 8c42089..540e6ba 100644 --- a/src/chroot-tools/makechrootpkg.sh.patch +++ b/src/chroot-tools/makechrootpkg.sh.patch @@ -1,5 +1,5 @@ --- makechrootpkg.sh.in 2014-01-05 18:51:41.463720929 -0500 -+++ makechrootpkg.sh.ugly 2014-02-05 19:59:10.991879605 -0500 ++++ makechrootpkg.sh.ugly 2014-02-09 20:20:25.021630727 -0500 @@ -12,6 +12,7 @@ shopt -s nullglob @@ -227,13 +227,19 @@ ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* -@@ -314,8 +369,26 @@ - cp /startdir_host/PKGBUILD* . - chown nobody PKGBUILD* +@@ -316,11 +371,29 @@ + # Safety check + if [[ ! -w PKGBUILD ]]; then ++ # XXX: internationalize this message + echo "Can't write to PKGBUILD!" + exit 1 + fi + +- sudo -u nobody makepkg "${makepkg_args[@]}" || exit 1 + # Sync deps now, as networking may be disabled during _chrootbuild + cp /repo/repo.db /var/lib/pacman/sync/repo.db -+ sudo -u nobody makepkg "${makepkg_args[@]}" -eo ++ sudo -u nobody makepkg "${makepkg_args[@]}" -o +} + +_chrootbuild() { @@ -248,12 +254,10 @@ + + cd /startdir + - # Safety check - if [[ ! -w PKGBUILD ]]; then -+ # XXX: internationalize this message - echo "Can't write to PKGBUILD!" - exit 1 - fi ++ sudo -u nobody makepkg "${makepkg_args[@]}" -e || exit 1 + + if $run_namcap; then + pacman -S --needed --noconfirm namcap @@ -333,12 +406,24 @@ exit 0 } -- cgit v1.2.2 From 696c05516039b7b93381811451d393b16a8653d1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Feb 2014 20:42:54 -0500 Subject: add a test for the last commit (enabling networking during prepare()) --- test/libremakepkg-test.sh | 9 +++++++++ test/libremakepkg.d/PKGBUILD-netbuild | 1 + test/libremakepkg.d/PKGBUILD-netprepare | 17 +++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 test/libremakepkg.d/PKGBUILD-netprepare diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh index 811c8ed..4d8a7c5 100644 --- a/test/libremakepkg-test.sh +++ b/test/libremakepkg-test.sh @@ -33,6 +33,15 @@ it_builds_a_trivial_package() { [[ -f $(echo libretools-hello-1.0-1-any.pkg.tar.?z) ]] } +it_enables_networking_during_prepare() { + require network sudo || return 0 + cp libremakepkg.d/PKGBUILD-netprepare "$tmpdir/PKGBUILD" + cd "$tmpdir" + + libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty + testsudo libremakepkg -l "$roundup_test_name" + [[ -f $(echo libretools-netprepare-1.0-1-any.pkg.tar.?z) ]] +} it_disables_networking_during_build() { require network sudo || return 0 diff --git a/test/libremakepkg.d/PKGBUILD-netbuild b/test/libremakepkg.d/PKGBUILD-netbuild index c1335a6..7be896b 100644 --- a/test/libremakepkg.d/PKGBUILD-netbuild +++ b/test/libremakepkg.d/PKGBUILD-netbuild @@ -7,6 +7,7 @@ pkgrel=1 arch=(any) build() { + cd "$srcdir" curl https://repo.parabolagnulinux.org/ > index.html } diff --git a/test/libremakepkg.d/PKGBUILD-netprepare b/test/libremakepkg.d/PKGBUILD-netprepare new file mode 100644 index 0000000..90f3e82 --- /dev/null +++ b/test/libremakepkg.d/PKGBUILD-netprepare @@ -0,0 +1,17 @@ +pkgname='libretools-netprepare' +pkgver=1.0 +license=('GPL') +url='https://parabolagnulinux.org' + +pkgrel=1 +arch=(any) + +prepare() { + cd "$srcdir" + curl https://repo.parabolagnulinux.org/ > index.html +} + +package() { + cd "$srcdir" + install -Dm644 index.html "$pkgdir"/usr/share/$pkgname/index.html +} -- cgit v1.2.2 From 6963eb95d8d29b84d9dc8a1f6b4095ebe1317a68 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 09:59:59 -0500 Subject: touch up treepkg --- src/treepkg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/treepkg b/src/treepkg index 73ef93b..bfe2163 100755 --- a/src/treepkg +++ b/src/treepkg @@ -114,7 +114,7 @@ BUILD=${B:-true} CLEANUP=${C:-true} # Skip BUILDORDER creation and build anything on BUILDDIR BUILDNOW=${N:-false} -IGNORE=${I:-} +IGNORE=(${I}) if [[ ! -z $1 ]] && [[ $DEPTH -eq 0 ]]; then BUILDNOW=true @@ -220,7 +220,7 @@ if [[ ${DEPTH} -eq 0 ]]; then ${VERBOSE} || echo "${BUILDORDER}" || true fi - if (( CLEANUP )) ; then + if ${CLEANUP} ; then msg2 "Removing %s" "${BUILDDIR}" rm -rf "${BUILDDIR}" fi -- cgit v1.2.2 From 4c6bb6654ac5a2b4d62bc2129e2d030663b76674 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 10:15:22 -0500 Subject: dagpkg: use tab indent --- src/dagpkg | 202 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/src/dagpkg b/src/dagpkg index 49d6ef1..090d45d 100755 --- a/src/dagpkg +++ b/src/dagpkg @@ -30,10 +30,10 @@ source $XDG_CONFIG_HOME/.makepkg.conf &>/dev/null || true # End inmediately but print an useful message trap_exit() { - term_title "error!" - error "(%s) %s (leftovers on %s)" \ - "${0##*/}" "$@" "${temp_dir}" - exit 1 + term_title "error!" + error "(%s) %s (leftovers on %s)" \ + "${0##*/}" "$@" "${temp_dir}" + exit 1 } # Trap signals from makepkg @@ -42,26 +42,26 @@ trap 'trap_exit "Aborted by user! Exiting..."' INT trap 'trap_exit "An unknown error has occurred. Exiting..."' ERR source_pkgbuild() { - # Source this PKGBUILD, if it doesn't exist, exit - unset pkgbase pkgname depends makedepends - unset pkgrel pkgver epoch - if ! source ./PKGBUILD &>/dev/null ; then - error "No PKGBUILD in %s" "$PWD" - exit 1 - fi - - # Save resources - unset pkgdesc license groups backup install md5sums sha1sums \ - sha256sums source options &>/dev/null - - unset build package &>/dev/null - - for _pkg in ${pkgname[@]}; do - unset package_${_pkg} &>/dev/null || true - done - - # This is the name of the package - name="${pkgbase:-${pkgname[0]}}" + # Source this PKGBUILD, if it doesn't exist, exit + unset pkgbase pkgname depends makedepends + unset pkgrel pkgver epoch + if ! source ./PKGBUILD &>/dev/null ; then + error "No PKGBUILD in %s" "$PWD" + exit 1 + fi + + # Save resources + unset pkgdesc license groups backup install md5sums sha1sums \ + sha256sums source options &>/dev/null + + unset build package &>/dev/null + + for _pkg in ${pkgname[@]}; do + unset package_${_pkg} &>/dev/null || true + done + + # This is the name of the package + name="${pkgbase:-${pkgname[0]}}" } source_pkgbuild @@ -72,12 +72,12 @@ log="${temp_dir}/buildorder" # Generate the full version with epoch get_fullver() { - if [ $1 -eq 0 ]; then -# zero epoch case, don't include it in version - echo $2-$3 - else - echo $1:$2-$3 - fi + if [ $1 -eq 0 ]; then + # zero epoch case, don't include it in version + echo $2-$3 + else + echo $1:$2-$3 + fi } @@ -89,112 +89,112 @@ declare -A marks # Visit a PKGBUILD for graph building. visit_pkgbuild() { - # The name of the previous package - prev="${1}" + # The name of the previous package + prev="${1}" - local name - source_pkgbuild + local name + source_pkgbuild - # If it's already built we don't bother - is_built ${pkgname[0]} $(get_fullver ${epoch:-0} ${pkgver} ${pkgrel}) && - return + # If it's already built we don't bother + is_built ${pkgname[0]} $(get_fullver ${epoch:-0} ${pkgver} ${pkgrel}) && + return - # Detect cycle or already visited package - case "${marks[$name]:-0}" in - 1) msg2 "cycle found with %s depending on %s" $prev $name - exit 1;; - 2) return;; - esac + # Detect cycle or already visited package + case "${marks[$name]:-0}" in + 1) msg2 "cycle found with %s depending on %s" $prev $name + exit 1;; + 2) return;; + esac - msg "%s (%s)" ${name} ${prev} + msg "%s (%s)" ${name} ${prev} - echo "${arch[@]}" | grep -qw "$CARCH" || - warning "%s isn't ported to %s yet" ${name} ${CARCH} + echo "${arch[@]}" | grep -qw "$CARCH" || + warning "%s isn't ported to %s yet" ${name} ${CARCH} - # If the envvar I contains this package, ignore it and exit - echo "$I" | grep -qw "$name" && - msg2 "%s ignored" ${name} && - return + # If the envvar I contains this package, ignore it and exit + echo "$I" | grep -qw "$name" && + msg2 "%s ignored" ${name} && + return - # Mark the package as being visited - marks[$name]=1 + # Mark the package as being visited + marks[$name]=1 - # Recurse into dependencies - for d in ${depends[@]} ${makedepends[@]}; do - # Cleanup dependency versions - d=$(echo $d | sed "s/[<>=].*//") + # Recurse into dependencies + for d in ${depends[@]} ${makedepends[@]}; do + # Cleanup dependency versions + d=$(echo $d | sed "s/[<>=].*//") - # Where's the pkgbuild? - w=$(toru-where $d) + # Where's the pkgbuild? + w=$(toru-where $d) - # Skip if not available - test -z "$w" && continue + # Skip if not available + test -z "$w" && continue - # Go to this dir - pushd $w &>/dev/null + # Go to this dir + pushd $w &>/dev/null - visit_pkgbuild "$name" + visit_pkgbuild "$name" - popd &>/dev/null - done + popd &>/dev/null + done - # Mark the package as finished - marks[$name]=2 - # Append it to the reversed list of packages to build. - echo "$name" >> "${log}" + # Mark the package as finished + marks[$name]=2 + # Append it to the reversed list of packages to build. + echo "$name" >> "${log}" } # If we specified a work dir on the cli it means we want to skip # dependency graph creation and jump to build whatever is there if [ -z "${1}" ]; then - # Visit the root PKGBUILD to make the graph. - visit_pkgbuild "" + # Visit the root PKGBUILD to make the graph. + visit_pkgbuild "" else - msg "Resuming build..." + msg "Resuming build..." fi # enter work dir pushd "${temp_dir}" &>/dev/null nl ${log} | while read order pkg; do - # skip if already built - if test -f "${pkg}/built_ok"; then - warning "tried to build %s twice" "%{pkg}" - continue - fi + # skip if already built + if test -f "${pkg}/built_ok"; then + warning "tried to build %s twice" "%{pkg}" + continue + fi - # where's this package? - w="$(toru-where "$pkg")" - test -z "$w" && continue + # where's this package? + w="$(toru-where "$pkg")" + test -z "$w" && continue - # copy to work dir if not already - # this means you can make modifications to the pkgbuild during the - # graph build or remove the dir after a build failure and let dagpkg - # copy a new version - test -d "$pkg" || cp -r "$w" "$pkg" - pushd "$pkg" &>/dev/null + # copy to work dir if not already + # this means you can make modifications to the pkgbuild during the + # graph build or remove the dir after a build failure and let dagpkg + # copy a new version + test -d "$pkg" || cp -r "$w" "$pkg" + pushd "$pkg" &>/dev/null - term_title "$pkg($order)" + term_title "$pkg($order)" - msg "Building %s" ${pkg} + msg "Building %s" ${pkg} - # upgrade the system - # this would probably have to go on HOOKPREBUILD if you're working - # outside chroots - sudo -E pacman -Syu --noconfirm + # upgrade the system + # this would probably have to go on HOOKPREBUILD if you're working + # outside chroots + sudo -E pacman -Syu --noconfirm - # run the pre build command from libretools.conf - ${HOOKPREBUILD} + # run the pre build command from libretools.conf + ${HOOKPREBUILD} - # run the build command - ${FULLBUILDCMD} + # run the build command + ${FULLBUILDCMD} - # Run local release hook with $1 = $repo - ${HOOKLOCALRELEASE} "$(basename "$(dirname "$w")")" + # Run local release hook with $1 = $repo + ${HOOKLOCALRELEASE} "$(basename "$(dirname "$w")")" - # it's built! - touch built_ok + # it's built! + touch built_ok - popd &>/dev/null + popd &>/dev/null done popd &>/dev/null -- cgit v1.2.2 From 64b427c2449eb45ec945afd09cced57c8a7d7e4e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 10:53:45 -0500 Subject: treepkg: make HOOK* settings optional, update documentation on the HOOK*s --- src/libretools.conf | 15 +++++++-------- src/treepkg | 13 ++++++++++--- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/libretools.conf b/src/libretools.conf index 4b1973a..12c4392 100644 --- a/src/libretools.conf +++ b/src/libretools.conf @@ -48,22 +48,21 @@ HOOKPRERELEASE="ssh -fN ${REPODEST%%:*}" HOOKPOSTRELEASE="sudo librechroot clean-repo" ################################################################################ -# fullpkg/treepkg # +# dagpkg/fullpkg/treepkg # ################################################################################ -# Note: fullpkg accepts HOOK* settings not being set, treepkg requires them to -# be set. +# Note: Not being set is valid for any of the HOOK* settings. +# Run a command to modify ./PKGBUILD before building # NOTE: fullpkg ONLY #HOOKPKGBUILDMOD="mips-add" -# Run a command before running FULLBUILDCMD, usually to cleanup uneeded packages -# Note: Recent versions of libremakepkg run chcleanup for you. -# NOTE: treepkg ONLY -HOOKPREBUILD=":" -#HOOKPREBUILD="chcleanup" +# Run a command before running FULLBUILDCMD +# NOTE: IGNORED by fullpkg +#HOOKPREBUILD="" ## Uncomment one of those or make one of your choice +# NOTE: fullpkg passes this to eval(1bash), where the others run it directly. # Normal FULLBUILDCMD="sudo libremakepkg" # Cross compiling diff --git a/src/treepkg b/src/treepkg index bfe2163..4dc29dc 100755 --- a/src/treepkg +++ b/src/treepkg @@ -19,7 +19,9 @@ source libremessages source $(librelib conf.sh) load_files libretools -check_vars libretools HOOKPREBUILD FULLBUILDCMD HOOKLOCALRELEASE || exit 1 +check_vars libretools FULLBUILDCMD || exit 1 +# The following variables are actually optional +#check_vars libretools HOOKPREBUILD HOOKLOCALRELEASE || exit 1 load_files makepkg term_title "${0##*/}" @@ -205,11 +207,16 @@ if [[ ${DEPTH} -eq 0 ]]; then pushd "${BUILDDIR}/${_pkg}" >/dev/null sudo -E pacman -Syu --noconfirm - ${HOOKPREBUILD} + if [[ -n "${HOOKPREBUILD:-}" ]]; then + ${HOOKPREBUILD} + fi ${FULLBUILDCMD} + # Run local release hook with $1 = $repo - ${HOOKLOCALRELEASE} $(egrep ";${_pkg#*_};" "${BUILDORDER}" | cut -d';' -f6) + if [[ -n "${HOOKLOCALRELEASE:-}" ]]; then + ${HOOKLOCALRELEASE} $(egrep ";${_pkg#*_};" "${BUILDORDER}" | cut -d';' -f6) + fi touch built_ok popd >/dev/null -- cgit v1.2.2 From 74f68d0149f2a94780c860b0775d1e880dbe9225 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 10:57:57 -0500 Subject: teach libremessages:setup_traps to be able to use a custom signal handler --- src/lib/libremessages | 31 ++++++++++++++++++++++--------- src/lib/libremessages.1.ronn | 9 +++++++-- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/lib/libremessages b/src/lib/libremessages index e5b7157..162c8fb 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -117,17 +117,30 @@ term_title() { printf "$fmt" "$*" } -# Usage: setup_traps +# Usage: setup_traps [handler] # Sets up traps on TERM, HUP, QUIT and INT signals, as well as the ERR event, -# similar to makepkg +# similar to makepkg. +# +# If `handler` is specified, instead of using the default handler +# (which is good for most purposes), it will call the command handler +# with the arguments: +# +# ${handler} SIGNAL_NAME MESSAGE_FMT [MESSAGE_PARAMS...] +# +# where MESSAGE_* are printf-like stuff. setup_traps() { - _libremessages_trap_exit() { - local signal=$1; shift - echo - error "$@" - trap -- "$signal" - kill "-$signal" "$$" - } + [[ $# -le 1 ]] || panic + if [[ $# == 1 ]]; then + eval "_libremessages_trap_exit() { $1 \"\$@\"; }" + else + _libremessages_trap_exit() { + local signal=$1; shift + echo + error "$@" + trap -- "$signal" + kill "-$signal" "$$" + } + fi set -E for signal in TERM HUP QUIT; do trap "_libremessages_trap_exit $signal '%s signal caught. Exiting...' $signal" $signal diff --git a/src/lib/libremessages.1.ronn b/src/lib/libremessages.1.ronn index d4c35fc..d39dad0 100644 --- a/src/lib/libremessages.1.ronn +++ b/src/lib/libremessages.1.ronn @@ -69,9 +69,14 @@ Unless otherwise noted, these do not implicitly call `gettext`. Joins all arguments with whitespace, and sets the terminal title to that. - * `setup_traps`: + * `setup_traps` []: Sets traps on TERM, HUP, QUIT and INT signals, as sell as the ERR - event, similar to makepkg. + event, similar to makepkg. If is specified, instead of + using the default handler (which is good for most purposes), it + will call with the arguments + ` [...]`, where + is a `printf`(1)-formatted string, and + are its arguments. ### PROSE ROUTINES -- cgit v1.2.2 From 19896860cab0ecee691bf336c98c2c2b18ea5e20 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 11:20:14 -0500 Subject: dagpkg: Do a couple things the librelib way --- src/dagpkg | 71 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/src/dagpkg b/src/dagpkg index 090d45d..1e13114 100755 --- a/src/dagpkg +++ b/src/dagpkg @@ -3,8 +3,8 @@ # dagpkg - create a directed graph of package dependencies and build # them in topological order # -# (c) 2014 Nicolás Reynolds -# Michał Masłowski +# Copyright (C) 2014 Nicolás Reynolds +# Copyright (C) 2014 Michał Masłowski # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,37 +20,42 @@ # along with this program. If not, see . set -e +source $(librelib conf) + # Source variables from libretools -source /etc/libretools.conf -source $XDG_CONFIG_HOME/libretools/libretools.conf &>/dev/null || true +load_files libretools +check_vars libretools FULLBUILDCMD || exit 1 +#check_vars libretools HOOKPREBUILD HOOKLOCALRELEASE || exit 1 # optional # Source variables from makepkg -source /etc/makepkg.conf -source $XDG_CONFIG_HOME/.makepkg.conf &>/dev/null || true +load_files makepkg +check_vars makepkg CARCH || exit 1 + # End inmediately but print an useful message trap_exit() { + local signal=$1; shift + local msg=("$@") term_title "error!" + echo error "(%s) %s (leftovers on %s)" \ - "${0##*/}" "$@" "${temp_dir}" - exit 1 + "${0##*/}" "$(print "${msg[@]}")" "${temp_dir}" + trap -- "$signal" + kill "-$signal" "$$" } -# Trap signals from makepkg -trap 'trap_exit "TERM signal caught. Exiting..."' TERM HUP QUIT -trap 'trap_exit "Aborted by user! Exiting..."' INT -trap 'trap_exit "An unknown error has occurred. Exiting..."' ERR +setup_traps trap_exit source_pkgbuild() { # Source this PKGBUILD, if it doesn't exist, exit - unset pkgbase pkgname depends makedepends - unset pkgrel pkgver epoch - if ! source ./PKGBUILD &>/dev/null ; then + if ! load_PKGBUILD &>/dev/null; then error "No PKGBUILD in %s" "$PWD" exit 1 fi # Save resources + # This is intentionally less exhaustive than unset_PKGBUILD() + # XXX: document which things we actually *want* to not be unset. unset pkgdesc license groups backup install md5sums sha1sums \ sha256sums source options &>/dev/null @@ -70,17 +75,6 @@ source_pkgbuild temp_dir="${1:-$(mktemp -dt ${name}-testpkg-XXXX)}" log="${temp_dir}/buildorder" -# Generate the full version with epoch -get_fullver() { - if [ $1 -eq 0 ]; then - # zero epoch case, don't include it in version - echo $2-$3 - else - echo $1:$2-$3 - fi - -} - # Mark array for DFS-based topological sort. See # https://en.wikipedia.org/wiki/Topological_sort for an explanation of # the algorithm. Key: package name, value: 0 for unvisited package, 1 @@ -96,8 +90,9 @@ visit_pkgbuild() { source_pkgbuild # If it's already built we don't bother - is_built ${pkgname[0]} $(get_fullver ${epoch:-0} ${pkgver} ${pkgrel}) && - return + if is_built "${pkgname[0]}" "$(get_full_version "${pkgname[0]}")"; then + return + fi # Detect cycle or already visited package case "${marks[$name]:-0}" in @@ -108,13 +103,15 @@ visit_pkgbuild() { msg "%s (%s)" ${name} ${prev} - echo "${arch[@]}" | grep -qw "$CARCH" || - warning "%s isn't ported to %s yet" ${name} ${CARCH} + if ! in_array "${CARCH}" "${arch[@]}"; then + warning "%s isn't ported to %s yet" ${name} ${CARCH} + fi # If the envvar I contains this package, ignore it and exit - echo "$I" | grep -qw "$name" && - msg2 "%s ignored" ${name} && - return + if in_array "$name" $I; then + msg2 "%s ignored" ${name} + return + fi # Mark the package as being visited marks[$name]=1 @@ -183,13 +180,17 @@ nl ${log} | while read order pkg; do sudo -E pacman -Syu --noconfirm # run the pre build command from libretools.conf - ${HOOKPREBUILD} + if [[ -n "$HOOKPREBUILD" ]]; then + ${HOOKPREBUILD} + fi # run the build command ${FULLBUILDCMD} # Run local release hook with $1 = $repo - ${HOOKLOCALRELEASE} "$(basename "$(dirname "$w")")" + if [[ -n "$HOOKLOCALRELEASE" ]]; then + ${HOOKLOCALRELEASE} "$(basename "$(dirname "$w")")" + fi # it's built! touch built_ok -- cgit v1.2.2 From cb9e36694cb02b7190d806fc41e7e3927aabedbd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 11:28:04 -0500 Subject: dagpkg: be more careful with variables --- src/dagpkg | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/dagpkg b/src/dagpkg index 1e13114..5c38495 100755 --- a/src/dagpkg +++ b/src/dagpkg @@ -31,6 +31,18 @@ check_vars libretools FULLBUILDCMD || exit 1 load_files makepkg check_vars makepkg CARCH || exit 1 +# Globals: +# - temp_dir +# - log +# - name (sort of, it's also local to visit_pkgbuild() ) +# - prev +# - I +# - marks +# - various PKGBUILD variables: +# - pkgbase/pkgname +# - epoch/pkgver/pkgrel +# - arch +# - {,make,check}depends # End inmediately but print an useful message trap_exit() { @@ -61,8 +73,9 @@ source_pkgbuild() { unset build package &>/dev/null - for _pkg in ${pkgname[@]}; do - unset package_${_pkg} &>/dev/null || true + local _pkg + for _pkg in "${pkgname[@]}"; do + unset "package_${_pkg}" &>/dev/null || true done # This is the name of the package @@ -117,12 +130,13 @@ visit_pkgbuild() { marks[$name]=1 # Recurse into dependencies - for d in ${depends[@]} ${makedepends[@]}; do + local d + for d in "${depends[@]}" "${makedepends[@]}" "${checkdepends[@]}"; do # Cleanup dependency versions d=$(echo $d | sed "s/[<>=].*//") # Where's the pkgbuild? - w=$(toru-where $d) + local w=$(toru-where $d) # Skip if not available test -z "$w" && continue @@ -160,7 +174,7 @@ nl ${log} | while read order pkg; do fi # where's this package? - w="$(toru-where "$pkg")" + local w="$(toru-where "$pkg")" test -z "$w" && continue # copy to work dir if not already -- cgit v1.2.2 From 15ba4736d7888b41b74e7f683a0ee0521b7681f7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 11:36:36 -0500 Subject: repo-diff: use libremessages --- src/repo-diff | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/repo-diff b/src/repo-diff index bfa1968..e15080a 100755 --- a/src/repo-diff +++ b/src/repo-diff @@ -1,15 +1,19 @@ #!/usr/bin/env bash # Shows a diff between repo databases -if test $# -eq 0; then - printf "$(gettext "Compares two repo databases using distro/repo/architecture format - -Usage: -\t%s arch/core/i686 parabola/core/i686 +. libremessages + +usage() { + print "Usage: %s arch/core/i686 parabola/core/i686" "${0##*/}" + print "Compares two repo databases using distro/repo/architecture format." + echo + print 'Shortcuts:' + flag 'arch' 'expands to Arch Linux repo url' + flag 'parabola' 'expands to Parabola GNU/Linux-libre repo url' +} -Shortcuts: -\tarch \texpands to archlinux repo url repo -\tparabola\texpands to parabola repo url\n")" ${0##*/} +if test $# -eq 0; then + usage exit 0 fi @@ -44,11 +48,11 @@ done { printf "$(gettext "Difference between %s and %s")\n---\n" $1 $2 - which diffstat &>/dev/null && diff -auN ${d[@]} | diffstat + which diffstat &>/dev/null && diff -auN "${d[@]}" | diffstat diff -auN "${d[@]}" } >../${n}.diff popd >/dev/null rm -r ${0##*/}.$$ -printf "$(gettext "Difference save on %s")\n" ${n}.diff +print "Difference save on %s" "${n}.diff" -- cgit v1.2.2 From b799bc5422ae1bc411e1725b5bb081a21f7afaef Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 11:51:50 -0500 Subject: dagpkg: load libremessages --- src/dagpkg | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dagpkg b/src/dagpkg index 5c38495..8e997a6 100755 --- a/src/dagpkg +++ b/src/dagpkg @@ -20,6 +20,7 @@ # along with this program. If not, see . set -e +source libremessages source $(librelib conf) # Source variables from libretools -- cgit v1.2.2 From f046abd2a4d169e71ebe8eda14f01789b0bafdb0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 18:03:58 -0500 Subject: fix the librefetch unit tests --- test/librefetch-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh index 92f67a1..7642f91 100644 --- a/test/librefetch-test.sh +++ b/test/librefetch-test.sh @@ -9,7 +9,7 @@ before() { mkdir -p "$HOME" printf '%s\n' \ - 'DLAGENTS+=({https,libre}'\''::/usr/bin/librefetch -p "$BUILDFILE" -- %u %o'\'')' \ + "DLAGENTS+=({https,libre}'::$(which librefetch) -p \"\$BUILDFILE\" -- %u %o')" \ 'BUILDDIR=""' \ > "$HOME/.makepkg.conf" -- cgit v1.2.2 From 5656c9706cf6f96e0646e9594750d8239e5fcbea Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 18:09:37 -0500 Subject: Fix librefetch tests more. I should not be committing code this tired. --- test/librefetch-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh index 7642f91..43b7a69 100644 --- a/test/librefetch-test.sh +++ b/test/librefetch-test.sh @@ -15,7 +15,7 @@ before() { mkdir -p "$XDG_CONFIG_HOME/libretools" printf '%s\n' \ - 'MIRROR="phony://example.com/dir/"' \ + 'MIRRORS=("phony://example.com/dir/")' \ 'DOWNLOADER=/usr/bin/false' \ > "$XDG_CONFIG_HOME/libretools/librefetch.conf" } -- cgit v1.2.2 From 8cbd5fc2e616785d97e84f7e17b845b74a6ccfd1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 6 Mar 2014 12:16:33 -0500 Subject: Update for the new version of systemd --- src/chroot-tools/indent | 4 +--- src/chroot-tools/librechroot | 22 ++-------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/chroot-tools/indent b/src/chroot-tools/indent index 0e2d0e0..5a7f654 100755 --- a/src/chroot-tools/indent +++ b/src/chroot-tools/indent @@ -19,9 +19,7 @@ while (1) { $c = substr($buffer, $_, 1); if ($c eq "\n") { syswrite(STDOUT, $indent) if ($print_indent); - # XXX: SYSTEMD-STDOUT HACK - #syswrite(STDOUT, $c, 1); - syswrite(STDOUT, "\r\n", 2); + syswrite(STDOUT, $c, 1); $print_indent = 1; } elsif ($c eq "\r") { syswrite(STDOUT, $c, 1); diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 051148d..f449f0d 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -186,23 +186,7 @@ arch_nspawn_flags=() sysd_nspawn_flags=() arch-nspawn() { local copydir=$1; shift - # XXX: SYSTEMD-STDOUT HACK - if [[ -t 1 ]]; then - cmd=("$@") - else - # 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; -while(1) { - $size=sysread(STDIN, $buffer, 40); - last if ($size < 1); - $buffer =~ s/\n/\r\n/g; - syswrite(STDOUT, $buffer); -}' - cmd=(bash --noprofile --norc -c "set -o pipefail; $(printf '%q ' "$@") |& perl -e $(printf '%q' "$perlcmd")") - fi + local cmd=("$@") set +u # if an array is empty, it counts as unbound "$_arch_nspawn" "${arch_nspawn_flags[@]}" "$copydir" "${sysd_nspawn_flags[@]}" -- "${cmd[@]}" @@ -381,9 +365,7 @@ main() { arch-nspawn "$copydir" pacman -Sy "$@" ;; update) - # umount resolv.conf so that it can be upgraded, if nescessary - # this disables DNS, so fetch everything first - arch-nspawn "$copydir" bash -c 'pacman -Syuw --noconfirm && umount /etc/resolv.conf && pacman -Su --noconfirm' + arch-nspawn "$copydir" bash -c 'pacman -Syu --noconfirm' ;; clean-pkgs) trap "rm -f '$copydir'/bin/chcleanup '$copydir'/chrootexec" EXIT -- cgit v1.2.2 From 089c60a05e95bee1ab3c506069f8e0e75eb43657 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 20 Mar 2014 16:27:41 -0400 Subject: Generalize the patching mechanism in the build system. --- common.mk | 28 ++++++++++++++++++++++++---- src/chroot-tools/.gitignore | 3 +-- src/chroot-tools/Makefile | 24 +----------------------- src/devtools/.gitignore | 1 + 4 files changed, 27 insertions(+), 29 deletions(-) diff --git a/common.mk b/common.mk index deb64c7..ea0c588 100644 --- a/common.mk +++ b/common.mk @@ -10,6 +10,13 @@ pkglibexecdir ?= $(libexecdir)/libretools # This is used when using sources grabbed from devtools edit = sed -e 's|m4_include(lib/\(.*\))|. $$(librelib \1)|' +# Usage: $(call indent,FILENAME) +# Command to auto-indent a file. +indent = emacs --batch $1 \ + --eval '(setq sh-basic-offset 8)' \ + --eval '(indent-region (point-min) (point-max) nil)' \ + -f save-buffer &>/dev/null + # Usage OUTPUT # Normalize a .po(t) file pofmt = msguniq -Fi @@ -53,7 +60,7 @@ install_files += $(addprefix $(DESTDIR)$(bindir)/,$(progs)) \ $(addprefix $(DESTDIR)$(mandir)/man6/,$(filter %.6,$(mans))) \ $(addprefix $(DESTDIR)$(mandir)/man7/,$(filter %.7,$(mans))) \ $(addprefix $(DESTDIR)$(mandir)/man8/,$(filter %.8,$(mans))) -clean_files += $(patsubst %.in,%,$(copy_files)) $(copy_files) $(mans) $(wildcard *.pot) +clean_files += $(patsubst %.in,%,$(copy_files)) $(copy_files) $(mans) $(wildcard *.pot *.ugly* *~) pots += $(filter-out $(no-pots) ,$(progs)) pot_files += $(addsuffix .pot,$(pots)) @@ -79,10 +86,23 @@ build: PHONY $(build_files) ronn --roff $(RONNFLAGS) < '$<' > '$@' %.html: %.ronn ronn --html $(RONNFLAGS) < '$<' > '$@' + + +# If we have a .patch file, the flow is: +# $(devtoolsdir)/%.in -> %.in + %.patch -> %.ugly -> % +_do_patch = $(filter $(patsubst %.patch,%,$(wildcard *.patch)),$(patsubst %.in,%,$(copy_files))) +%.ugly: %.in %.patch Makefile + cp $*.in $@ + @echo 'PATCH $@ $*.patch'; patch $@ $*.patch +$(_do_patch): %: %.ugly Makefile + @echo 'EDIT < $< > $@'; $(edit) <'$<' >'$@' + @echo 'INDENT $@'; $(call indent,$@) + $(if $(filter-out %.sh,$@),chmod 755 "$@") +# Otherwise, the flow is just +# $(devtoolsdir)/%.in -> %.in -> % %: %.in - @echo "GEN $@" - @$(edit) <"$<" >"$@" - @chmod 755 "$@" + @echo 'EDIT < $< > $@'; $(edit) <"$<" >"$@" + $(if $(filter-out %.sh,$@),chmod 755 "$@") # Build ######################################################################## diff --git a/src/chroot-tools/.gitignore b/src/chroot-tools/.gitignore index 80e1000..3f46ed2 100644 --- a/src/chroot-tools/.gitignore +++ b/src/chroot-tools/.gitignore @@ -1,5 +1,4 @@ makechrootpkg.sh* -!makechrootpkg.sh.patch - arch-nspawn* mkarchroot* +!*.patch diff --git a/src/chroot-tools/Makefile b/src/chroot-tools/Makefile index 97ca688..c49c4ac 100644 --- a/src/chroot-tools/Makefile +++ b/src/chroot-tools/Makefile @@ -9,37 +9,15 @@ libs = makechrootpkg.sh $(wildcard hooks-*.sh) pots = $(libexecs) $(libs) pkglibexecdir = $(libexecdir)/libretools/chroot -clean_files = makechrootpkg.sh.ugly* *~ include ../../common.mk -# Usage: $(call indent,FILENAME) -# Command to auto-indent a file. -indent = emacs --batch $1 \ - --eval '(setq sh-basic-offset 8)' \ - --eval '(indent-region (point-min) (point-max) nil)' \ - -f save-buffer &>/dev/null - -# makechrootpkg.sh is special, we patch it and do fancy stuff -# The flow is: -# $(devtoolsdir)/*.in -> *.sh.in + *.sh.patch -> *.sh.ugly -> *.sh - +# makechrootpkg.sh is created from a command, not a library makechrootpkg.sh.in: %.sh.in: $(devtoolsdir)/%.in cp $< $@ -makechrootpkg.sh.ugly: %.ugly: %.in %.patch Makefile - cp $*.in $@ - @echo 'PATCH $@ $*.patch'; patch $@ $*.patch -makechrootpkg.sh: %: %.ugly Makefile - @echo 'EDIT < $< > $@'; $(edit) <'$<' >'$@' - @echo 'INDENT $@'; $(call indent,$@) mkarchroot: mkarchroot.in Makefile @echo '< $< M4_EDIT | SED > $@' @<'$<' $(edit) | sed -e 's|arch-nspawn|$$(librelib chroot/&)|' -e 's/pacstrap/env -i &/' >'$@' @echo 'CHMOD $<'; chmod 755 "$@" -archroot: %: %.in Makefile - @echo "GEN $@" - @$(edit) <"$<" >"$@" - @chmod 755 "$@" - distcc-tool.pot: xgettext-keywords-sh+=--keyword=errusage diff --git a/src/devtools/.gitignore b/src/devtools/.gitignore index 097fcde..d669bbd 100644 --- a/src/devtools/.gitignore +++ b/src/devtools/.gitignore @@ -1,3 +1,4 @@ * !Makefile !.gitignore +!*.patch -- cgit v1.2.2 From d17d1d82349f7f4cb60574f7d9c2f786eec3cc93 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 20 Mar 2014 17:16:36 -0400 Subject: Fix issue #487; obey proxy settings when creating a chroot. https://labs.parabola.nu/issues/487 --- src/chroot-tools/Makefile | 5 ----- src/chroot-tools/mkarchroot.patch | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 src/chroot-tools/mkarchroot.patch diff --git a/src/chroot-tools/Makefile b/src/chroot-tools/Makefile index c49c4ac..e44ad5f 100644 --- a/src/chroot-tools/Makefile +++ b/src/chroot-tools/Makefile @@ -15,9 +15,4 @@ include ../../common.mk makechrootpkg.sh.in: %.sh.in: $(devtoolsdir)/%.in cp $< $@ -mkarchroot: mkarchroot.in Makefile - @echo '< $< M4_EDIT | SED > $@' - @<'$<' $(edit) | sed -e 's|arch-nspawn|$$(librelib chroot/&)|' -e 's/pacstrap/env -i &/' >'$@' - @echo 'CHMOD $<'; chmod 755 "$@" - distcc-tool.pot: xgettext-keywords-sh+=--keyword=errusage diff --git a/src/chroot-tools/mkarchroot.patch b/src/chroot-tools/mkarchroot.patch new file mode 100644 index 0000000..a0ea0f0 --- /dev/null +++ b/src/chroot-tools/mkarchroot.patch @@ -0,0 +1,23 @@ +--- mkarchroot.in 2014-01-05 18:51:15.231500986 -0500 ++++ mkarchroot 2014-03-20 15:05:06.885086610 -0400 +@@ -65,6 +65,11 @@ + chmod 0755 "$working_dir" + fi + ++_env=() ++while read -r varname; do ++ _env+=("$varname=${!varname}") ++done < { declare -x | sed -r 's/^declare -x ([^=]*)=.*/\1/' | grep -i '_proxy$'; } ++env -i "${_env[@]}" \ + pacstrap -GMcd ${pac_conf:+-C "$pac_conf"} "$working_dir" \ + "${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages' + +@@ -72,7 +77,7 @@ + echo 'LANG=C' > "$working_dir/etc/locale.conf" + echo "$CHROOT_VERSION" > "$working_dir/.arch-chroot" + +-exec arch-nspawn \ ++exec $(librelib chroot/arch-nspawn) \ + ${pac_conf:+-C "$pac_conf"} \ + ${makepkg_conf:+-M "$makepkg_conf"} \ + ${cache_dir:+-c "$cache_dir"} \ -- cgit v1.2.2 From ada82c54e5948ae6353d7024151dcc429665a070 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 21 Mar 2014 00:36:23 -0400 Subject: Add usage text to the commands in src/devtools --- src/devtools/checkpkg.patch | 43 ++++++++++++++++++++++++++++++++++++++ src/devtools/find-libdeps.patch | 46 +++++++++++++++++++++++++++++++++++++++++ src/devtools/finddeps.patch | 33 +++++++++++++++++++++++++++++ src/devtools/lddd.patch | 27 ++++++++++++++++++++++++ 4 files changed, 149 insertions(+) create mode 100644 src/devtools/checkpkg.patch create mode 100644 src/devtools/find-libdeps.patch create mode 100644 src/devtools/finddeps.patch create mode 100644 src/devtools/lddd.patch diff --git a/src/devtools/checkpkg.patch b/src/devtools/checkpkg.patch new file mode 100644 index 0000000..fe9568e --- /dev/null +++ b/src/devtools/checkpkg.patch @@ -0,0 +1,43 @@ +--- checkpkg.in 2014-03-20 15:55:50.091249246 -0400 ++++ checkpkg 2014-03-21 00:27:07.318339210 -0400 +@@ -2,7 +2,28 @@ + + shopt -s extglob + +-m4_include(lib/common.sh) ++. $(librelib messages) ++ ++usage() { ++ print 'Usage: %s [-h]' "${0##*/}" ++ print 'Compare a locally built a package with the one in the repositories.' ++ echo ++ prose 'This should be run from a directory containing a ++ PKGBUILD. It searches for a locally built package ++ corresponding to the PKGBUILD, and downloads the last ++ version of that package from the pacman repositories. ++ It then compares the list of .so files provided by each ++ version of the package. It does this for each part of ++ a split package.' ++} ++ ++if [[ $1 = '-h' ]]; then ++ usage ++ exit 0 ++elif [[ $# -gt 0 ]]; then ++ usage >&2 ++ exit 1 ++fi + + # Source makepkg.conf; fail if it is not found + if [[ -r '/etc/makepkg.conf' ]]; then +@@ -17,7 +38,9 @@ + fi + + if [[ ! -f PKGBUILD ]]; then +- die 'This must be run in the directory of a built package.' ++ error 'This must be run in the directory of a built package.' ++ usage >&2 ++ exit 1 + fi + + . ./PKGBUILD diff --git a/src/devtools/find-libdeps.patch b/src/devtools/find-libdeps.patch new file mode 100644 index 0000000..2b2ce2a --- /dev/null +++ b/src/devtools/find-libdeps.patch @@ -0,0 +1,46 @@ +--- find-libdeps.in 2014-03-20 15:55:50.107915156 -0400 ++++ find-libdeps 2014-03-21 00:09:03.855031377 -0400 +@@ -1,6 +1,6 @@ + #!/bin/bash + +-m4_include(lib/common.sh) ++. $(librelib messages) + + set -e + shopt -s extglob +@@ -19,12 +19,32 @@ + *) die "Unknown mode %s" "$script_mode" ;; + esac + ++usage() { ++ print "Usage: find-lib(deps|provides) [options] " ++ print "Find library dependencies or provides of a package." ++ echo ++ prose 'Prints a list of library dependencies in the format:' ++ echo ++ print ' =-' ++ echo ++ prose 'Where is the shared library version, or ++ repeated if there is no version attached; and ++ is the architecture of the library (either `32` ++ or `64`, based on the ELF Class).' ++ echo ++ print "Options:" ++ flag "--ignore-internal" "Ignore internal libraries; libraries ++ without a version attached" ++ flag "-h" "Show this message" ++} + if [[ -z $1 ]]; then +- echo "${0##*/} [options] " +- echo "Options:" +- echo " --ignore-internal ignore internal libraries" ++ usage >&2 + exit 1 + fi ++if [[ $1 = '-h' ]]; then ++ usage ++ exit 0 ++fi + + if [[ -d $1 ]]; then + pushd $1 >/dev/null diff --git a/src/devtools/finddeps.patch b/src/devtools/finddeps.patch new file mode 100644 index 0000000..a960ac1 --- /dev/null +++ b/src/devtools/finddeps.patch @@ -0,0 +1,33 @@ +--- finddeps.in 2014-03-20 15:55:50.121247884 -0400 ++++ finddeps 2014-03-21 00:11:02.573978735 -0400 +@@ -3,18 +3,24 @@ + # finddeps - find packages that depend on a given depname + # + +-m4_include(lib/common.sh) ++. $(librelib messages) + + match=$1 + ++usage() { ++ print 'Usage: %s ' "${0##*/}" ++ print 'Find packages that depend on a given depname.' ++ echo ++ prose 'Run this script from the top-level directory of your ABS tree.' ++} + if [[ -z $match ]]; then +- echo 'Usage: finddeps ' +- echo '' +- echo 'Find packages that depend on a given depname.' +- echo 'Run this script from the top-level directory of your ABS tree.' +- echo '' ++ usage >&2 + exit 1 + fi ++if [[ $match = '-h' ]]; then ++ usage ++ exit 0 ++fi + + find . -type d | while read d; do + if [[ -f "$d/PKGBUILD" ]]; then diff --git a/src/devtools/lddd.patch b/src/devtools/lddd.patch new file mode 100644 index 0000000..7ae1679 --- /dev/null +++ b/src/devtools/lddd.patch @@ -0,0 +1,27 @@ +--- lddd.in 2014-03-20 15:55:50.154579704 -0400 ++++ lddd 2014-03-21 00:35:07.167279204 -0400 +@@ -3,7 +3,23 @@ + # lddd - find broken library links on your machine + # + +-m4_include(lib/common.sh) ++. $(librelib messages) ++ ++usage() { ++ print "Usage: %s [-h]" "${0##*/}" ++ print "Find broken library links on your machine." ++ echo ++ prose 'Scans $PATH and library directories for ELF files with ++ references to missing shared libraries.' ++} ++ ++if [[ $1 = '-h' ]]; then ++ usage ++ exit 0 ++elif [[ $# -gt 0 ]]; then ++ usage >&2 ++ exit 1 ++fi + + ifs=$IFS + IFS="${IFS}:" -- cgit v1.2.2 From d25f30f25ce61367c81133c9cd01fe3169d8f6c0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 21 Mar 2014 14:39:06 -0400 Subject: Do an audit of copyright and license claims --- src/abslibre-tools/createworkdir | 19 +++++++------- src/abslibre-tools/diff-unfree | 13 +++++----- src/abslibre-tools/libreaddiff | 8 ++++-- src/abslibre-tools/librerelease | 29 ++++++++++----------- src/abslibre-tools/librestage | 6 +++-- src/aur | 10 +++++--- src/chroot-tools/arch-nspawn.patch | 9 +++++++ src/chroot-tools/chcleanup | 18 +++++++++++-- src/chroot-tools/distcc-tool | 4 ++- src/chroot-tools/hooks-distcc.sh | 19 ++++++++++++++ src/chroot-tools/indent | 19 ++++++++++++++ src/chroot-tools/librechroot | 8 +++--- src/chroot-tools/libremakepkg | 8 +++--- src/chroot-tools/makechrootpkg.sh.patch | 45 +++++++++++++++++++-------------- src/chroot-tools/mkarchroot.patch | 15 ++++++++--- src/dagpkg | 4 ++- src/devtools/checkpkg.patch | 10 +++++--- src/devtools/find-libdeps.patch | 9 ++++--- src/devtools/finddeps.patch | 8 +++--- src/devtools/lddd.patch | 8 +++--- src/fullpkg/fullpkg | 6 ++++- src/fullpkg/fullpkg-build | 5 ++++ src/fullpkg/fullpkg-find | 11 ++++---- src/gitget/gitget | 2 ++ src/gitget/libregit | 2 ++ src/is_built | 20 +++++++++++++++ src/lib/common.sh.top | 9 +------ src/lib/conf.sh | 4 ++- src/lib/libreblacklist | 4 ++- src/lib/librelib | 4 ++- src/lib/libremessages | 43 ++++++++++++++++++------------- src/librefetch/librefetch | 2 ++ src/mips64el-tools/librebasebuilder | 5 +++- src/mips64el-tools/mipsrelease | 21 +++++++++++++-- src/pkgbuild-check-nonfree | 11 ++++---- src/pkgbuild-summarize-nonfree | 18 +++++++++++++ src/repo-diff | 4 +++ src/toru/toru | 20 ++++++++++++++- src/toru/toru-info | 5 ++++ src/toru/toru-path | 4 +++ src/toru/toru-utils | 5 ++++ src/toru/toru-where | 5 ++++ src/treepkg | 6 +++-- 43 files changed, 354 insertions(+), 131 deletions(-) create mode 100644 src/chroot-tools/arch-nspawn.patch diff --git a/src/abslibre-tools/createworkdir b/src/abslibre-tools/createworkdir index 27b285c..51863e3 100755 --- a/src/abslibre-tools/createworkdir +++ b/src/abslibre-tools/createworkdir @@ -1,28 +1,29 @@ #!/usr/bin/env bash -set -euE # CreateWorkDir # Creates a dir structure for working with Parabola packages -# Copyright (C) 2010 Nicolás Reynolds -# Copyright (C) 2013 Luke Shumaker - -# ---------- GNU General Public License 3 ---------- - +# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2013 Luke Shumaker +# +# License: GNU GPLv3+ +# # This file is part of Parabola. - +# # Parabola is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. - +# # Parabola is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. - +# # You should have received a copy of the GNU General Public License # along with Parabola. If not, see . +set -euE + . libremessages . $(librelib conf.sh) load_files libretools diff --git a/src/abslibre-tools/diff-unfree b/src/abslibre-tools/diff-unfree index af5bbe5..e8c18e6 100755 --- a/src/abslibre-tools/diff-unfree +++ b/src/abslibre-tools/diff-unfree @@ -1,22 +1,23 @@ #!/usr/bin/env bash # This script will help you diff a *-libre PKGBUILD against the unfree one # to check for updates. -# Copyright (C) 2010 Nicolás Reynolds - -# ---------- GNU General Public License 3 ---------- +# Copyright (C) 2010 Nicolás Reynolds +# +# License: GNU GPLv3+ +# # This file is part of Parabola. - +# # Parabola is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. - +# # Parabola is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. - +# # You should have received a copy of the GNU General Public License # along with Parabola. If not, see . diff --git a/src/abslibre-tools/libreaddiff b/src/abslibre-tools/libreaddiff index ebd749d..641f552 100755 --- a/src/abslibre-tools/libreaddiff +++ b/src/abslibre-tools/libreaddiff @@ -1,7 +1,9 @@ #!/usr/bin/env bash -set -e # -*- coding: utf-8 -*- -# Copyright (C) 2011, 2012 Michał Masłowski + +# Copyright (C) 2011-2012 Michał Masłowski +# +# License: GNU GPLv3+ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,6 +18,8 @@ set -e # You should have received a copy of the GNU General Public License # along with this program. If not, see . +set -e + . $(librelib conf.sh) load_files libretools check_vars libretools WORKDIR diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index 8b1e05f..eec62d7 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -2,23 +2,19 @@ # Librerelease # Uploads packages into [staging] -# Copyright (C) 2010 Nicolás Reynolds -# Copyright (C) 2013-2014 Luke Shumaker +# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2013-2014 Luke Shumaker +# # For just the create_signature() function: # Copyright (C) 2006-2013 Pacman Development Team -# Copyright (C) 2002-2006 by Judd Vinet -# Copyright (C) 2005 by Aurelien Foret -# Copyright (C) 2006 by Miklos Vajna -# Copyright (C) 2005 by Christian Hamar -# Copyright (C) 2006 by Alex Smith -# Copyright (C) 2006 by Andras Voroskoi -# Copyright (C) 2006-2013 Pacman Development Team -# Copyright (C) 2002-2006 by Judd Vinet -# Copyright (C) 2005 by Aurelien Foret -# Copyright (C) 2006 by Miklos Vajna -# Copyright (C) 2005 by Christian Hamar -# Copyright (C) 2006 by Alex Smith -# Copyright (C) 2006 by Andras Voroskoi +# Copyright (C) 2002-2006 Judd Vinet +# Copyright (C) 2005 Aurelien Foret +# Copyright (C) 2006 Miklos Vajna +# Copyright (C) 2005 Christian Hamar +# Copyright (C) 2006 Alex Smith +# Copyright (C) 2006 Andras Voroskoi +# +# License: GNU GPLv3+ # # This file is part of Parabola. # @@ -35,6 +31,9 @@ # You should have received a copy of the GNU General Public License # along with Parabola. If not, see . +# create_signature() is taken from pacman:makepkg, which is GPLv2+, +# so we take the '+' to combine it with our GPLv3+. + . libremessages . $(librelib conf.sh) diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index 610de50..6ae0af0 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -2,8 +2,10 @@ # LibreStage # Prepares packages for upload -# Copyright (C) 2010-2011 Nicolás Reynolds -# Copyright (C) 2013-2014 Luke Shumaker +# Copyright (C) 2010-2011 Nicolás Reynolds +# Copyright (C) 2013-2014 Luke Shumaker +# +# License: GNU GPLv3+ # # This file is part of Parabola. # diff --git a/src/aur b/src/aur index 988d33f..72857ed 100755 --- a/src/aur +++ b/src/aur @@ -1,7 +1,9 @@ #!/usr/bin/env bash -# Copyright (C) 2010 Joshua Ismael -# Copyright (C) 2010 Nicolás Reynolds -# Copyright (C) 2013-2014 Luke Shumaker +# Copyright (C) 2010 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2013-2014 Luke Shumaker +# +# License: GNU GPLv3+ # # This file is part of Parabola. # @@ -9,7 +11,7 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. - +# # Parabola is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/src/chroot-tools/arch-nspawn.patch b/src/chroot-tools/arch-nspawn.patch new file mode 100644 index 0000000..afdf51a --- /dev/null +++ b/src/chroot-tools/arch-nspawn.patch @@ -0,0 +1,9 @@ +--- arch-nspawn.in 2014-03-21 13:59:31.812992892 -0400 ++++ arch-nspawn 2014-03-21 14:24:23.520619552 -0400 +@@ -1,4 +1,6 @@ + #!/bin/bash ++# License: GNU GPLv2 ++# + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; version 2 of the License. diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup index 9ad121e..e766117 100755 --- a/src/chroot-tools/chcleanup +++ b/src/chroot-tools/chcleanup @@ -1,13 +1,27 @@ #!/usr/bin/env bash -set -eE # Copyright (C) Nicolás Reynolds -# Released under GPLv3 # +# License: GNU GPLv3 +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + # Performs chroot cleanup smartly, it only removes the unneeded packages or # leaves you with a cleansystem # # See: HOOKPREBUILD +set -eE + DRYRUN=${DRYRUN:-false} ################################################################################ diff --git a/src/chroot-tools/distcc-tool b/src/chroot-tools/distcc-tool index 9f78ead..f2e43dd 100755 --- a/src/chroot-tools/distcc-tool +++ b/src/chroot-tools/distcc-tool @@ -2,7 +2,9 @@ # -*- tab-width: 4; sh-basic-offset: 4 -*- # distcc-tool -# Copyright (C) 2013-2014 Luke Shumaker +# Copyright (C) 2013-2014 Luke Shumaker +# +# License: GNU GPLv3+ # # This file is part of Parabola. # diff --git a/src/chroot-tools/hooks-distcc.sh b/src/chroot-tools/hooks-distcc.sh index d8d708a..445810b 100644 --- a/src/chroot-tools/hooks-distcc.sh +++ b/src/chroot-tools/hooks-distcc.sh @@ -1,4 +1,23 @@ #!/usr/bin/env bash +# Copyright (C) 2013 Luke Shumaker +# +# License: GNU GPLv3+ +# +# This file is part of Parabola. +# +# Parabola is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Parabola is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Parabola. If not, see . + set -euE hook_pre_build+=("distcc_start") diff --git a/src/chroot-tools/indent b/src/chroot-tools/indent index 5a7f654..ffec4d5 100755 --- a/src/chroot-tools/indent +++ b/src/chroot-tools/indent @@ -1,4 +1,23 @@ #!/usr/bin/env perl +# Copyright (C) 2013 Luke Shumaker +# +# License: GNU GPLv3+ +# +# This file is part of Parabola. +# +# Parabola is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Parabola is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Parabola. If not, see . + use warnings; use strict; use constant BUFFER_SIZE => 40; diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index f449f0d..ca29cbb 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -2,9 +2,11 @@ set -euE # librechroot -# Copyright (C) 2010 Nicolás Reynolds -# Copyright (C) 2011 Joshua Haase -# Copyright (C) 2012-2014 Luke Shumaker +# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2012-2014 Luke Shumaker +# +# License: GNU GPLv3+ # # This file is part of Parabola. # diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 26080bc..6050174 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -2,9 +2,11 @@ set -euE # libremakepkg -# Copyright (C) 2010-2011 Nicolás Reynolds -# Copyright (C) 2011 Joshua Ismael Haase Hernández -# Copyright (C) 2012-2014 Luke Shumaker +# Copyright (C) 2010-2011 Nicolás Reynolds +# Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2012-2014 Luke Shumaker +# +# License: GNU GPLv3+ # # This file is part of Parabola. # diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch index 540e6ba..de57aeb 100644 --- a/src/chroot-tools/makechrootpkg.sh.patch +++ b/src/chroot-tools/makechrootpkg.sh.patch @@ -1,6 +1,13 @@ ---- makechrootpkg.sh.in 2014-01-05 18:51:41.463720929 -0500 -+++ makechrootpkg.sh.ugly 2014-02-09 20:20:25.021630727 -0500 -@@ -12,6 +12,7 @@ +--- makechrootpkg.sh.in 2014-03-21 13:59:31.239683366 -0400 ++++ makechrootpkg.sh.ugly 2014-03-21 14:19:20.747789508 -0400 +@@ -1,4 +1,6 @@ + #!/bin/bash ++# License: GNU GPLv2 ++# + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; version 2 of the License. +@@ -12,6 +14,7 @@ shopt -s nullglob @@ -8,7 +15,7 @@ _makepkg_args=(-s --noconfirm -L --holdver) makepkg_args=("${_makepkg_args[@]}") repack=false -@@ -29,9 +30,10 @@ +@@ -29,9 +32,10 @@ bindmounts_rw=() copy=$USER @@ -20,7 +27,7 @@ usage() { echo "Usage: ${0##*/} [options] -r [--] [makepkg args]" -@@ -67,6 +69,7 @@ +@@ -67,6 +71,7 @@ exit 1 } @@ -28,7 +35,7 @@ while getopts 'hcur:I:l:nTD:d:' arg; do case "$arg" in h) usage ;; -@@ -93,9 +96,6 @@ +@@ -93,9 +98,6 @@ [[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" "$passeddir" [[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try using: mkarchroot %s/root base-devel" "$chrootdir" @@ -38,7 +45,7 @@ if [[ ${copy:0:1} = / ]]; then copydir=$copy else -@@ -115,30 +115,48 @@ +@@ -115,30 +117,48 @@ esac done @@ -93,7 +100,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" -@@ -159,11 +177,16 @@ +@@ -159,11 +179,16 @@ # Drop the read lock again lock_close 8 @@ -113,7 +120,7 @@ if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; then btrfs subvolume delete "$copydir" >/dev/null || die "Unable to delete subvolume %s" "$copydir" -@@ -178,9 +201,14 @@ +@@ -178,9 +203,14 @@ stat_done } @@ -128,7 +135,7 @@ for install_pkg in "${install_pkgs[@]}"; do pkgname="${install_pkg##*/}" cp "$install_pkg" "$copydir/$pkgname" -@@ -193,11 +221,19 @@ +@@ -193,11 +223,19 @@ rm "$copydir/$pkgname" done @@ -150,7 +157,7 @@ $repack || rm -rf "$copydir/build" mkdir -p "$copydir/build" -@@ -236,12 +272,12 @@ +@@ -236,12 +274,12 @@ chown -R nobody "$copydir"/{build,pkgdest,srcpkgdest,logdest,srcdest,startdir} @@ -165,7 +172,7 @@ sed -i '/^PACKAGER=/d' "$copydir/etc/makepkg.conf" echo "PACKAGER='${PACKAGER}'" >> "$copydir/etc/makepkg.conf" fi -@@ -254,20 +290,38 @@ +@@ -254,20 +292,38 @@ chmod 440 "$copydir/etc/sudoers.d/nobody-pacman" fi @@ -206,7 +213,7 @@ makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o else ( export SRCDEST BUILDDIR="$builddir" -@@ -277,10 +331,10 @@ +@@ -277,10 +333,10 @@ (( $? != 0 )) && die "Could not download sources." # Clean up garbage from verifysource @@ -219,7 +226,7 @@ # This function isn't run in makechrootpkg, # so no global variables local run_namcap="$1"; shift -@@ -291,6 +345,7 @@ +@@ -291,6 +347,7 @@ shopt -s nullglob # XXX: Workaround makepkg disliking read-only dirs @@ -227,7 +234,7 @@ ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* -@@ -316,11 +371,29 @@ +@@ -316,11 +373,29 @@ # Safety check if [[ ! -w PKGBUILD ]]; then @@ -258,7 +265,7 @@ if $run_namcap; then pacman -S --needed --noconfirm namcap -@@ -333,12 +406,24 @@ +@@ -333,12 +408,24 @@ exit 0 } @@ -283,7 +290,7 @@ for l in "$copydir"/logdest/*; do [[ $l == */logpipe.* ]] && continue chown "$src_owner" "$l" -@@ -352,6 +437,10 @@ +@@ -352,6 +439,10 @@ } # }}} @@ -294,7 +301,7 @@ umask 0022 load_vars /etc/makepkg.conf -@@ -363,30 +452,45 @@ +@@ -363,30 +454,45 @@ [[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD [[ -d $LOGDEST ]] || LOGDEST=$PWD @@ -346,7 +353,7 @@ if (( ret != 0 )); then if $temp_chroot; then -@@ -397,3 +501,4 @@ +@@ -397,3 +503,4 @@ else true fi diff --git a/src/chroot-tools/mkarchroot.patch b/src/chroot-tools/mkarchroot.patch index a0ea0f0..171b38a 100644 --- a/src/chroot-tools/mkarchroot.patch +++ b/src/chroot-tools/mkarchroot.patch @@ -1,6 +1,13 @@ ---- mkarchroot.in 2014-01-05 18:51:15.231500986 -0500 -+++ mkarchroot 2014-03-20 15:05:06.885086610 -0400 -@@ -65,6 +65,11 @@ +--- mkarchroot.in 2014-03-21 13:59:31.593002027 -0400 ++++ mkarchroot.ugly 2014-03-21 14:23:12.027238102 -0400 +@@ -1,4 +1,6 @@ + #!/bin/bash ++# License: GNU GPLv2 ++# + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; version 2 of the License. +@@ -65,6 +67,11 @@ chmod 0755 "$working_dir" fi @@ -12,7 +19,7 @@ pacstrap -GMcd ${pac_conf:+-C "$pac_conf"} "$working_dir" \ "${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages' -@@ -72,7 +77,7 @@ +@@ -72,7 +79,7 @@ echo 'LANG=C' > "$working_dir/etc/locale.conf" echo "$CHROOT_VERSION" > "$working_dir/.arch-chroot" diff --git a/src/dagpkg b/src/dagpkg index 8e997a6..e1487d5 100755 --- a/src/dagpkg +++ b/src/dagpkg @@ -2,10 +2,12 @@ # # dagpkg - create a directed graph of package dependencies and build # them in topological order -# + # Copyright (C) 2014 Nicolás Reynolds # Copyright (C) 2014 Michał Masłowski # +# License: GNU GPLv3+ +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or diff --git a/src/devtools/checkpkg.patch b/src/devtools/checkpkg.patch index fe9568e..2e3bb63 100644 --- a/src/devtools/checkpkg.patch +++ b/src/devtools/checkpkg.patch @@ -1,6 +1,8 @@ ---- checkpkg.in 2014-03-20 15:55:50.091249246 -0400 -+++ checkpkg 2014-03-21 00:27:07.318339210 -0400 -@@ -2,7 +2,28 @@ +--- checkpkg.in 2014-03-21 13:59:31.849658036 -0400 ++++ checkpkg.ugly 2014-03-21 14:20:52.340291982 -0400 +@@ -1,8 +1,30 @@ + #!/bin/bash ++# License: Unspecified shopt -s extglob @@ -30,7 +32,7 @@ # Source makepkg.conf; fail if it is not found if [[ -r '/etc/makepkg.conf' ]]; then -@@ -17,7 +38,9 @@ +@@ -17,7 +39,9 @@ fi if [[ ! -f PKGBUILD ]]; then diff --git a/src/devtools/find-libdeps.patch b/src/devtools/find-libdeps.patch index 2b2ce2a..fe8e2fe 100644 --- a/src/devtools/find-libdeps.patch +++ b/src/devtools/find-libdeps.patch @@ -1,14 +1,15 @@ ---- find-libdeps.in 2014-03-20 15:55:50.107915156 -0400 -+++ find-libdeps 2014-03-21 00:09:03.855031377 -0400 -@@ -1,6 +1,6 @@ +--- find-libdeps.in 2014-03-21 13:59:32.059649315 -0400 ++++ find-libdeps.ugly 2014-03-21 14:21:18.955744982 -0400 +@@ -1,6 +1,7 @@ #!/bin/bash ++# License: Unspecified -m4_include(lib/common.sh) +. $(librelib messages) set -e shopt -s extglob -@@ -19,12 +19,32 @@ +@@ -19,12 +20,32 @@ *) die "Unknown mode %s" "$script_mode" ;; esac diff --git a/src/devtools/finddeps.patch b/src/devtools/finddeps.patch index a960ac1..feae920 100644 --- a/src/devtools/finddeps.patch +++ b/src/devtools/finddeps.patch @@ -1,8 +1,10 @@ ---- finddeps.in 2014-03-20 15:55:50.121247884 -0400 -+++ finddeps 2014-03-21 00:11:02.573978735 -0400 -@@ -3,18 +3,24 @@ +--- finddeps.in 2014-03-21 13:59:32.249641424 -0400 ++++ finddeps.ugly 2014-03-21 14:21:09.949489174 -0400 +@@ -2,19 +2,26 @@ + # # finddeps - find packages that depend on a given depname # ++# License: Unspecified -m4_include(lib/common.sh) +. $(librelib messages) diff --git a/src/devtools/lddd.patch b/src/devtools/lddd.patch index 7ae1679..415b178 100644 --- a/src/devtools/lddd.patch +++ b/src/devtools/lddd.patch @@ -1,8 +1,10 @@ ---- lddd.in 2014-03-20 15:55:50.154579704 -0400 -+++ lddd 2014-03-21 00:35:07.167279204 -0400 -@@ -3,7 +3,23 @@ +--- lddd.in 2014-03-21 13:59:32.419634364 -0400 ++++ lddd.ugly 2014-03-21 14:21:31.538503947 -0400 +@@ -2,8 +2,25 @@ + # # lddd - find broken library links on your machine # ++# License: Unspecified -m4_include(lib/common.sh) +. $(librelib messages) diff --git a/src/fullpkg/fullpkg b/src/fullpkg/fullpkg index 978cf7b..0572ddb 100755 --- a/src/fullpkg/fullpkg +++ b/src/fullpkg/fullpkg @@ -1,8 +1,12 @@ #!/usr/bin/env bash -# set -x # uncomment for debug # Builds packages from ABS recursively. It tries to find dependencies that # aren't built or need update and then makepkg them in order. +# Copyright (C) 2011 Nicolás Reynolds +# Copyright (C) 2011-2012 Joshua Ismael Haase Hernández (xihh) +# +# License: Unspecified + usage() { print "Usage: %s [OPTIONS] [BUILD_DIR]" "${0##*/}" print "A (libre)makepkg wrapper that will also build dependencies" diff --git a/src/fullpkg/fullpkg-build b/src/fullpkg/fullpkg-build index e824c2e..0ffd42a 100755 --- a/src/fullpkg/fullpkg-build +++ b/src/fullpkg/fullpkg-build @@ -3,6 +3,11 @@ # Builds packages from ABS recursively. It tries to find dependencies that # aren't built or need update and then makepkg them in order. +# Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2013 Luke Shumaker +# +# License: Unspecified + # TODO move __build to chroot . libremessages diff --git a/src/fullpkg/fullpkg-find b/src/fullpkg/fullpkg-find index 8bd630c..009bb86 100755 --- a/src/fullpkg/fullpkg-find +++ b/src/fullpkg/fullpkg-find @@ -1,10 +1,10 @@ #!/usr/bin/env bash # set -x # uncomment for debug -# Copyright (C) 2011-2012 Joshua I. Haase H. (xihh) -# Copyright (C) 2011-2012 Nicolás Reynolds +# Copyright (C) 2011-2012 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2011-2012 Nicolás Reynolds # Copyright (C) 2012 Michał Masłowski -# Copyright (C) 2012-2014 Luke Shumaker +# Copyright (C) 2012-2014 Luke Shumaker # # The copy_files() function is taken from makechrootpkg: # Copyright (C) 2007 Armin Luntzer @@ -13,8 +13,7 @@ # Copyright (C) 2007-2008 Travis Willard # Copyright (C) 2007-2009 Aaron Griffin # Copyright (C) 2008 Simo Leone -# Copyright (C) 2009 Biru Ionut -# Copyright (C) 2009 Biru Ionut +# Copyright (C) 2009 Biru Ionut # Copyright (C) 2009 Evangelos Foutras # Copyright (C) 2009 Francois Charette # Copyright (C) 2009 Nezmer @@ -33,6 +32,8 @@ # Because of the code from makechrootpkg, this file is GPLv2, instead of GPLv3 # like most of libretools. # +# License: GNU GPLv2 +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. diff --git a/src/gitget/gitget b/src/gitget/gitget index 3e35cec..bcc528c 100755 --- a/src/gitget/gitget +++ b/src/gitget/gitget @@ -3,6 +3,8 @@ # Copyright (C) 2012-2013 Pacman Development Team # Copyright (C) 2012-2013 Luke Shumaker # +# License: GNU GPLv2+ +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or diff --git a/src/gitget/libregit b/src/gitget/libregit index 95b59ff..25550e5 100755 --- a/src/gitget/libregit +++ b/src/gitget/libregit @@ -2,6 +2,8 @@ # Copyright (C) 2012-2013 Luke Shumaker # +# License: GNU GPLv2+ +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or diff --git a/src/is_built b/src/is_built index ba5f061..21b17d3 100755 --- a/src/is_built +++ b/src/is_built @@ -1,4 +1,24 @@ #!/usr/bin/env bash +# Copyright (C) 2011-2012 Nicolás Reynolds +# Copyright (C) 2011-2012 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2012-2013 Luke Shumaker +# +# License: GNU GPLv3+ +# +# This file is part of Parabola. +# +# Parabola is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Parabola is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Parabola. If not, see . . libremessages diff --git a/src/lib/common.sh.top b/src/lib/common.sh.top index 9c4ba2e..d45a7dd 100644 --- a/src/lib/common.sh.top +++ b/src/lib/common.sh.top @@ -4,14 +4,7 @@ # This file is included by libremessages. # You should probably use libremessages instead of this. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# License: Unspecified shopt -s extglob diff --git a/src/lib/conf.sh b/src/lib/conf.sh index ee52f6f..3e07c11 100644 --- a/src/lib/conf.sh +++ b/src/lib/conf.sh @@ -1,7 +1,9 @@ #!/bin/bash # non-executable, but put this there as a hint to text editors # This may be included with or without `set -euE` -# Copyright (C) 2012-2014 by Luke Shumaker +# Copyright (C) 2012-2014 Luke Shumaker +# +# License: GNU GPLv3+ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/lib/libreblacklist b/src/lib/libreblacklist index 5525098..fdd27f9 100755 --- a/src/lib/libreblacklist +++ b/src/lib/libreblacklist @@ -2,7 +2,9 @@ # This may be included with or without `set -euE` # When run directly, it does `set -euE` -# Copyright (C) 2013-2014 by Luke Shumaker +# Copyright (C) 2013-2014 Luke Shumaker +# +# License: GNU GPLv3+ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/lib/librelib b/src/lib/librelib index d0a06e5..63d9a26 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -1,5 +1,7 @@ #!/usr/bin/env bash -# Copyright (C) 2013-2014 by Luke Shumaker +# Copyright (C) 2013-2014 Luke Shumaker +# +# License: GNU GPLv3+ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/lib/libremessages b/src/lib/libremessages index 162c8fb..71f1636 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -2,28 +2,35 @@ # This may be included with or without `set -euE` # When run directly, it does `set -euE` -# Copyright (C) 2002-2006 by Judd Vinet +# Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2012-2014 Luke Shumaker + +# For just the setup_traps() function: +# Copyright (C) 2002-2006 Judd Vinet # Copyright (C) 2006-2010 Pacman Development Team -# Copyright (C) 2005 by Aurelien Foret -# Copyright (C) 2005 by Christian Hamar -# Copyright (C) 2006 by Alex Smith -# Copyright (C) 2006 by Andras Voroskoi -# Copyright (C) 2006 by Miklos Vajna -# Copyright (C) 2011 by Joshua Haase -# Copyright (C) 2012-2014 by Luke Shumaker +# Copyright (C) 2005 Aurelien Foret +# Copyright (C) 2005 Christian Hamar +# Copyright (C) 2006 Alex Smith +# Copyright (C) 2006 Andras Voroskoi +# Copyright (C) 2006 Miklos Vajna +# +# License: GNU GPLv3+ # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# setup_traps() is based on pacman:makepkg, which is GPLv2+, +# so we take the '+' to combine it with our GPLv3+. ################################################################################ # Inherit most functions from devtools # diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 82c8703..4f2d788 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -3,6 +3,8 @@ # # Copyright (C) 2013-2014 Luke Shumaker # +# License: GNU GPLv3+ +# # This file is part of Parabola. # # Parabola is free software: you can redistribute it and/or modify diff --git a/src/mips64el-tools/librebasebuilder b/src/mips64el-tools/librebasebuilder index 6b8c8bb..34c1027 100755 --- a/src/mips64el-tools/librebasebuilder +++ b/src/mips64el-tools/librebasebuilder @@ -1,6 +1,9 @@ #!/usr/bin/env bash # -*- coding: utf-8 -*- -# Copyright (C) 2012 Michał Masłowski + +# Copyright (C) 2012 Michał Masłowski +# +# License: GNU GPLv3+ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/mips64el-tools/mipsrelease b/src/mips64el-tools/mipsrelease index ea15f85..f8b77a8 100755 --- a/src/mips64el-tools/mipsrelease +++ b/src/mips64el-tools/mipsrelease @@ -1,9 +1,26 @@ #!/usr/bin/env bash -# Lic: GPLv3+ -# Author: Nicolas Reynolds # Local release of mips64el packages + clean ABS sync # Called by HOOKLOCALRELEASE +# Copyright (C) 2011 Nicolás Reynolds +# Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2013 Luke Shumaker +# +# License: GNU GPLv3+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + # $1 repo # $2+ packages diff --git a/src/pkgbuild-check-nonfree b/src/pkgbuild-check-nonfree index 7b73745..aa56d71 100755 --- a/src/pkgbuild-check-nonfree +++ b/src/pkgbuild-check-nonfree @@ -2,11 +2,12 @@ # -*- tab-width: 4 ; sh-basic-offset: 4 -*- # pkgbuild-check-nonfree -# Copyright (C) 2010 Haase Hernández -# Copyright (C) 2010 Joseph Graham -# Copyright (C) 2010 Joshua Ismael -# Copyright (C) 2010 Nicolás Reynolds -# Copyright (C) 2012-2013 Luke Shumaker +# Copyright (C) 2010 Joseph Graham (Xylon) +# Copyright (C) 2010 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2012-2013 Luke Shumaker +# +# License: GNU GPLv3+ # # This file is part of Parabola. # diff --git a/src/pkgbuild-summarize-nonfree b/src/pkgbuild-summarize-nonfree index 7b005d5..cf3be28 100755 --- a/src/pkgbuild-summarize-nonfree +++ b/src/pkgbuild-summarize-nonfree @@ -1,4 +1,22 @@ #!/bin/bash +# Copyright (C) 2013 Luke Shumaker +# +# License: GNU GPLv3+ +# +# This file is part of Parabola. +# +# Parabola is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Parabola is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Parabola. If not, see . . $(librelib messages) diff --git a/src/repo-diff b/src/repo-diff index e15080a..d25983a 100755 --- a/src/repo-diff +++ b/src/repo-diff @@ -1,6 +1,10 @@ #!/usr/bin/env bash # Shows a diff between repo databases +# Copyright (C) 2013 Nicolás Reynolds +# +# License: Unspecified + . libremessages usage() { diff --git a/src/toru/toru b/src/toru/toru index 3c45efd..16ec4af 100755 --- a/src/toru/toru +++ b/src/toru/toru @@ -1,6 +1,24 @@ #!/usr/bin/env bash # Queries the ABS -# License: GPL3 + +# Copyright (C) 2011-2012 Nicolás Reynolds +# Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2012-2013 Michał Masłowski +# Copyright (C) 2013 Luke Shumaker +# +# License: GNU GPLv3 +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . ## TODO # * Add license text diff --git a/src/toru/toru-info b/src/toru/toru-info index d73d2ad..aa84fcf 100755 --- a/src/toru/toru-info +++ b/src/toru/toru-info @@ -1,5 +1,10 @@ #!/usr/bin/env bash # Prints info about a given pkgname + +# Copyright (C) 2012 Nicolás Reynolds +# +# License: Unspecified + . libremessages . $(librelib conf) diff --git a/src/toru/toru-path b/src/toru/toru-path index 6c86e88..407059b 100755 --- a/src/toru/toru-path +++ b/src/toru/toru-path @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# Copyright (C) 2011-2012 Nicolás Reynolds +# +# License: Unspecified + source toru-utils TORUPATH=${T:-${TORUPATH}} diff --git a/src/toru/toru-utils b/src/toru/toru-utils index 96aa35e..2fecfc2 100755 --- a/src/toru/toru-utils +++ b/src/toru/toru-utils @@ -1,5 +1,10 @@ #!/usr/bin/env bash +# Copyright (C) 2011-2012 Nicolás Reynolds +# Copyright (C) 2012 Joshua Ismael Haase Hernández (xihh) +# +# License: Unspecified + . libremessages . $(librelib conf.sh) load_files libretools diff --git a/src/toru/toru-where b/src/toru/toru-where index 4b3ff1b..9d90972 100755 --- a/src/toru/toru-where +++ b/src/toru/toru-where @@ -1,5 +1,10 @@ #!/usr/bin/env bash # Locates a PKGBUILD dir on toru's path cache + +# Copyright (C) 2012 Nicolás Reynolds +# +# License: Unspecified + . $(librelib conf.sh) load_files libretools check_vars libretools TORUPATH || exit 1 diff --git a/src/treepkg b/src/treepkg index 4dc29dc..a23edbf 100755 --- a/src/treepkg +++ b/src/treepkg @@ -1,6 +1,8 @@ #!/usr/bin/env bash -#set -x -# Copyright (C) 2012 Nicolás Reynolds + +# Copyright (C) 2012 Nicolás Reynolds +# +# License: GNU GPLv3+ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- cgit v1.2.2 From 69bdd4ea9459209fe1a7768344b1975bea0a0fd0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 21 Mar 2014 14:39:39 -0400 Subject: Fix a small bug in common.mk --- common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.mk b/common.mk index ea0c588..ec8135f 100644 --- a/common.mk +++ b/common.mk @@ -94,7 +94,7 @@ _do_patch = $(filter $(patsubst %.patch,%,$(wildcard *.patch)),$(patsubst %.in,% %.ugly: %.in %.patch Makefile cp $*.in $@ @echo 'PATCH $@ $*.patch'; patch $@ $*.patch -$(_do_patch): %: %.ugly Makefile +$(sort $(_do_patch)): %: %.ugly Makefile @echo 'EDIT < $< > $@'; $(edit) <'$<' >'$@' @echo 'INDENT $@'; $(call indent,$@) $(if $(filter-out %.sh,$@),chmod 755 "$@") -- cgit v1.2.2 From 4c08929538733d5a76a663f2d48a980103b2223c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 22 Mar 2014 18:14:25 -0400 Subject: Update libremakepkg to work with Bash 4.3 (and still work with 4.2) --- src/chroot-tools/makechrootpkg.sh.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch index de57aeb..5cea39a 100644 --- a/src/chroot-tools/makechrootpkg.sh.patch +++ b/src/chroot-tools/makechrootpkg.sh.patch @@ -182,7 +182,7 @@ +SigLevel = Optional TrustAll +Server = file:///repo +' -+ sed -i "${line}i${ins//$'\n'/\n}" "$copydir/etc/pacman.conf" ++ sed -i "${line}i${ins//$'\n'/\\n}" "$copydir/etc/pacman.conf" + fi + # This is a little gross, but this way the script is recreated every time in the -- cgit v1.2.2 From 9c0e1f70df2de45b6b4d0525b64f517ff2533e1b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 22 Mar 2014 18:34:23 -0400 Subject: Fix librefetch to quote correctly with Bash 4.3 --- src/librefetch/librefetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 4f2d788..fdc7e00 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -160,8 +160,8 @@ main() { local dlcmd="${DOWNLOADER}" [[ $dlcmd = *%u* ]] || dlcmd="$dlcmd %u" - dlcmd="${dlcmd//\%o/"\$dst"}" - dlcmd="${dlcmd//\%u/"\$src"}" + dlcmd="${dlcmd//\%o/\"\$dst\"}" + dlcmd="${dlcmd//\%u/\"\$src\"}" { eval "$dlcmd"; } >&2 && return 0 fi -- cgit v1.2.2 From aaae256525d07aff8d83d4b8ec6332bfd2bb21eb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 22 Mar 2014 18:35:00 -0400 Subject: Makefiles: inhibit emacs from creating *~ files when formatting a file --- common.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common.mk b/common.mk index ec8135f..58366d7 100644 --- a/common.mk +++ b/common.mk @@ -13,6 +13,7 @@ edit = sed -e 's|m4_include(lib/\(.*\))|. $$(librelib \1)|' # Usage: $(call indent,FILENAME) # Command to auto-indent a file. indent = emacs --batch $1 \ + --eval '(setq make-backup-files nil)' \ --eval '(setq sh-basic-offset 8)' \ --eval '(indent-region (point-min) (point-max) nil)' \ -f save-buffer &>/dev/null @@ -60,7 +61,7 @@ install_files += $(addprefix $(DESTDIR)$(bindir)/,$(progs)) \ $(addprefix $(DESTDIR)$(mandir)/man6/,$(filter %.6,$(mans))) \ $(addprefix $(DESTDIR)$(mandir)/man7/,$(filter %.7,$(mans))) \ $(addprefix $(DESTDIR)$(mandir)/man8/,$(filter %.8,$(mans))) -clean_files += $(patsubst %.in,%,$(copy_files)) $(copy_files) $(mans) $(wildcard *.pot *.ugly* *~) +clean_files += $(patsubst %.in,%,$(copy_files)) $(copy_files) $(mans) $(wildcard *.pot *.ugly*) pots += $(filter-out $(no-pots) ,$(progs)) pot_files += $(addsuffix .pot,$(pots)) -- cgit v1.2.2 From c48ac8c89e596e160505bd5678db2b193607493f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 22 Mar 2014 22:00:44 -0400 Subject: Audit the authors and copyright years of files against git logs --- AUTHORS | 12 +++++++++--- src/abslibre-tools/createworkdir | 3 ++- src/abslibre-tools/diff-unfree | 3 ++- src/abslibre-tools/libreaddiff | 1 + src/abslibre-tools/librerelease | 4 +++- src/abslibre-tools/librestage | 3 ++- src/aur | 6 +++--- src/chroot-tools/chcleanup | 3 ++- src/chroot-tools/hooks-chcleanup.sh | 17 +++++++++++++++++ src/chroot-tools/hooks-check.sh | 17 +++++++++++++++++ src/chroot-tools/librechroot | 5 +++-- src/chroot-tools/libremakepkg | 5 +++-- src/fullpkg/fullpkg-build | 1 + src/fullpkg/fullpkg-find | 2 +- src/is_built | 2 +- src/lib/libremessages | 1 + src/mips64el-tools/add-mips64el | 4 ++++ src/mips64el-tools/mips-add | 4 ++++ src/mips64el-tools/mipsrelease | 2 +- src/pkgbuild-check-nonfree | 6 +++--- src/toru/toru-path | 1 + src/treepkg | 3 ++- 22 files changed, 83 insertions(+), 22 deletions(-) diff --git a/AUTHORS b/AUTHORS index 747e012..335eb9c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,9 @@ -Joshua Haase -Nicolás Reynolds -Luke Shumaker +Daniel Molina (lluvia) +Joseph Graham (Xylon) +Joshua Ismael Haase Hernández (xihh) +Luke Shumaker +Michał Masłowski +Nicolás Reynolds + +As well as authors of code taken from Arch Linux's "devtools" and +Pacman's "makepkg". diff --git a/src/abslibre-tools/createworkdir b/src/abslibre-tools/createworkdir index 51863e3..8e5ebcd 100755 --- a/src/abslibre-tools/createworkdir +++ b/src/abslibre-tools/createworkdir @@ -2,7 +2,8 @@ # CreateWorkDir # Creates a dir structure for working with Parabola packages -# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2010-2011 Nicolás Reynolds +# Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) # Copyright (C) 2013 Luke Shumaker # # License: GNU GPLv3+ diff --git a/src/abslibre-tools/diff-unfree b/src/abslibre-tools/diff-unfree index e8c18e6..fc32e77 100755 --- a/src/abslibre-tools/diff-unfree +++ b/src/abslibre-tools/diff-unfree @@ -2,7 +2,8 @@ # This script will help you diff a *-libre PKGBUILD against the unfree one # to check for updates. -# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2010-2011 Nicolás Reynolds +# Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) # # License: GNU GPLv3+ # diff --git a/src/abslibre-tools/libreaddiff b/src/abslibre-tools/libreaddiff index 641f552..16a77b5 100755 --- a/src/abslibre-tools/libreaddiff +++ b/src/abslibre-tools/libreaddiff @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- # Copyright (C) 2011-2012 Michał Masłowski +# Copyright (C) 2012 Daniel Molina (lluvia) # # License: GNU GPLv3+ # diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index eec62d7..03a57e0 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -2,7 +2,9 @@ # Librerelease # Uploads packages into [staging] -# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2010-2012 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2010-2013 Nicolás Reynolds +# Copyright (C) 2013 Michał Masłowski # Copyright (C) 2013-2014 Luke Shumaker # # For just the create_signature() function: diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index 6ae0af0..1e208c9 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -2,7 +2,8 @@ # LibreStage # Prepares packages for upload -# Copyright (C) 2010-2011 Nicolás Reynolds +# Copyright (C) 2010-2012 Nicolás Reynolds +# Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) # Copyright (C) 2013-2014 Luke Shumaker # # License: GNU GPLv3+ diff --git a/src/aur b/src/aur index 72857ed..4057b6e 100755 --- a/src/aur +++ b/src/aur @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# Copyright (C) 2010 Joshua Ismael Haase Hernández (xihh) -# Copyright (C) 2010 Nicolás Reynolds -# Copyright (C) 2013-2014 Luke Shumaker +# Copyright (C) 2010-2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2010-2012 Nicolás Reynolds +# Copyright (C) 2012-2014 Luke Shumaker # # License: GNU GPLv3+ # diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup index e766117..60a4e22 100755 --- a/src/chroot-tools/chcleanup +++ b/src/chroot-tools/chcleanup @@ -1,5 +1,6 @@ #!/usr/bin/env bash -# Copyright (C) Nicolás Reynolds +# Copyright (C) 2011-2012 Nicolás Reynolds +# Copyright (C) 2012-2013 Luke Shumaker # # License: GNU GPLv3 # diff --git a/src/chroot-tools/hooks-chcleanup.sh b/src/chroot-tools/hooks-chcleanup.sh index 86c872c..0fd0f72 100644 --- a/src/chroot-tools/hooks-chcleanup.sh +++ b/src/chroot-tools/hooks-chcleanup.sh @@ -1,4 +1,21 @@ #!/usr/bin/env bash +# Copyright (C) 2013 Luke Shumaker +# +# License: GNU GPLv2+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + set -euE hook_pre_build+=("clean_chroot") diff --git a/src/chroot-tools/hooks-check.sh b/src/chroot-tools/hooks-check.sh index 2702f95..850516b 100644 --- a/src/chroot-tools/hooks-check.sh +++ b/src/chroot-tools/hooks-check.sh @@ -1,4 +1,21 @@ #!/usr/bin/env bash +# Copyright (C) 2013 Luke Shumaker +# +# License: GNU GPLv2+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + set -euE hook_check_pkgbuild+=("check_pkgbuild_nonfree") diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index ca29cbb..bb82bd2 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -2,8 +2,9 @@ set -euE # librechroot -# Copyright (C) 2010 Nicolás Reynolds -# Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2010-2012 Nicolás Reynolds +# Copyright (C) 2011-2012 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2012 Michał Masłowski # Copyright (C) 2012-2014 Luke Shumaker # # License: GNU GPLv3+ diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 6050174..1ed4eaf 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -2,8 +2,9 @@ set -euE # libremakepkg -# Copyright (C) 2010-2011 Nicolás Reynolds -# Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2010-2012 Nicolás Reynolds +# Copyright (C) 2010-2012 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2012 Michał Masłowski # Copyright (C) 2012-2014 Luke Shumaker # # License: GNU GPLv3+ diff --git a/src/fullpkg/fullpkg-build b/src/fullpkg/fullpkg-build index 0ffd42a..715f505 100755 --- a/src/fullpkg/fullpkg-build +++ b/src/fullpkg/fullpkg-build @@ -4,6 +4,7 @@ # aren't built or need update and then makepkg them in order. # Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2011 Nicolás Reynolds # Copyright (C) 2013 Luke Shumaker # # License: Unspecified diff --git a/src/fullpkg/fullpkg-find b/src/fullpkg/fullpkg-find index 009bb86..c12888a 100755 --- a/src/fullpkg/fullpkg-find +++ b/src/fullpkg/fullpkg-find @@ -4,7 +4,7 @@ # Copyright (C) 2011-2012 Joshua Ismael Haase Hernández (xihh) # Copyright (C) 2011-2012 Nicolás Reynolds # Copyright (C) 2012 Michał Masłowski -# Copyright (C) 2012-2014 Luke Shumaker +# Copyright (C) 2013-2014 Luke Shumaker # # The copy_files() function is taken from makechrootpkg: # Copyright (C) 2007 Armin Luntzer diff --git a/src/is_built b/src/is_built index 21b17d3..67c0d8d 100755 --- a/src/is_built +++ b/src/is_built @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Copyright (C) 2011-2012 Nicolás Reynolds # Copyright (C) 2011-2012 Joshua Ismael Haase Hernández (xihh) -# Copyright (C) 2012-2013 Luke Shumaker +# Copyright (C) 2013 Luke Shumaker # # License: GNU GPLv3+ # diff --git a/src/lib/libremessages b/src/lib/libremessages index 71f1636..cb3d883 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -3,6 +3,7 @@ # When run directly, it does `set -euE` # Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2012 Nicolás Reynolds # Copyright (C) 2012-2014 Luke Shumaker # For just the setup_traps() function: diff --git a/src/mips64el-tools/add-mips64el b/src/mips64el-tools/add-mips64el index 17b167b..bf04663 100755 --- a/src/mips64el-tools/add-mips64el +++ b/src/mips64el-tools/add-mips64el @@ -1,6 +1,10 @@ #!/usr/bin/env bash # Change all arch array that aren't any or mips64el already +# Copyright (C) 2011 Nicolás Reynolds +# +# License: Unspecified + find -name 'PKGBUILD' -exec sed -i "s/^\(arch=([^)anym]\+\))/\1 'mips64el')/" '{}' \; exit $? diff --git a/src/mips64el-tools/mips-add b/src/mips64el-tools/mips-add index 402036e..11f6a74 100755 --- a/src/mips64el-tools/mips-add +++ b/src/mips64el-tools/mips-add @@ -1,4 +1,8 @@ #!/usr/bin/env bash +# Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# +# License: Unspecified + . libremessages if ! grep mips64el PKGBUILD >/dev/null; then # Add mips64el in ${arch} array if it isn't 'any' warning "Adding mips64el arch" diff --git a/src/mips64el-tools/mipsrelease b/src/mips64el-tools/mipsrelease index f8b77a8..fec2a1b 100755 --- a/src/mips64el-tools/mipsrelease +++ b/src/mips64el-tools/mipsrelease @@ -2,8 +2,8 @@ # Local release of mips64el packages + clean ABS sync # Called by HOOKLOCALRELEASE -# Copyright (C) 2011 Nicolás Reynolds # Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2011-2012 Nicolás Reynolds # Copyright (C) 2013 Luke Shumaker # # License: GNU GPLv3+ diff --git a/src/pkgbuild-check-nonfree b/src/pkgbuild-check-nonfree index aa56d71..11eaf42 100755 --- a/src/pkgbuild-check-nonfree +++ b/src/pkgbuild-check-nonfree @@ -2,9 +2,9 @@ # -*- tab-width: 4 ; sh-basic-offset: 4 -*- # pkgbuild-check-nonfree -# Copyright (C) 2010 Joseph Graham (Xylon) -# Copyright (C) 2010 Joshua Ismael Haase Hernández (xihh) -# Copyright (C) 2010 Nicolás Reynolds +# Copyright (C) 2011 Joseph Graham (Xylon) +# Copyright (C) 2010-2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2010-2012 Nicolás Reynolds # Copyright (C) 2012-2013 Luke Shumaker # # License: GNU GPLv3+ diff --git a/src/toru/toru-path b/src/toru/toru-path index 407059b..8674d53 100755 --- a/src/toru/toru-path +++ b/src/toru/toru-path @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Copyright (C) 2011-2012 Nicolás Reynolds +# Copyright (C) 2012 Michał Masłowski # # License: Unspecified diff --git a/src/treepkg b/src/treepkg index a23edbf..9d3c0c3 100755 --- a/src/treepkg +++ b/src/treepkg @@ -1,6 +1,7 @@ #!/usr/bin/env bash -# Copyright (C) 2012 Nicolás Reynolds +# Copyright (C) 2012-2013 Nicolás Reynolds +# Copyright (C) 2013 Luke Shumaker # # License: GNU GPLv3+ # -- cgit v1.2.2 From cb2a663ff60eacf14f38fa4a67aabe35600c0ecb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 22 Mar 2014 22:13:04 -0400 Subject: Relicense some files from GPLv3+ GPLv2+ (that I'm the sole copyright holder of) --- src/chroot-tools/hooks-distcc.sh | 4 ++-- src/lib/conf.sh | 4 ++-- src/lib/libreblacklist | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/chroot-tools/hooks-distcc.sh b/src/chroot-tools/hooks-distcc.sh index 445810b..37c82dc 100644 --- a/src/chroot-tools/hooks-distcc.sh +++ b/src/chroot-tools/hooks-distcc.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash # Copyright (C) 2013 Luke Shumaker # -# License: GNU GPLv3+ +# License: GNU GPLv2+ # # This file is part of Parabola. # # Parabola is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or +# the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # Parabola is distributed in the hope that it will be useful, diff --git a/src/lib/conf.sh b/src/lib/conf.sh index 3e07c11..2730b57 100644 --- a/src/lib/conf.sh +++ b/src/lib/conf.sh @@ -3,11 +3,11 @@ # Copyright (C) 2012-2014 Luke Shumaker # -# License: GNU GPLv3+ +# License: GNU GPLv2+ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, diff --git a/src/lib/libreblacklist b/src/lib/libreblacklist index fdd27f9..8aa33cc 100755 --- a/src/lib/libreblacklist +++ b/src/lib/libreblacklist @@ -4,11 +4,11 @@ # Copyright (C) 2013-2014 Luke Shumaker # -# License: GNU GPLv3+ +# License: GNU GPLv2+ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, -- cgit v1.2.2 From ff15727c30e5b9af5225869e38cbcfa2b08da6c2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 22 Mar 2014 23:18:37 -0400 Subject: libreaddiff: load libremessages --- src/abslibre-tools/libreaddiff | 1 + 1 file changed, 1 insertion(+) diff --git a/src/abslibre-tools/libreaddiff b/src/abslibre-tools/libreaddiff index 16a77b5..3f8f8f4 100755 --- a/src/abslibre-tools/libreaddiff +++ b/src/abslibre-tools/libreaddiff @@ -21,6 +21,7 @@ set -e +. libremessages . $(librelib conf.sh) load_files libretools check_vars libretools WORKDIR -- cgit v1.2.2 From 222856031fbbf314e8e47db414225756a9c6fba2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 23 Mar 2014 18:09:13 -0400 Subject: Most of my desired re-licensings were authorized on the dev list --- src/chroot-tools/chcleanup | 5 +++-- src/chroot-tools/librechroot | 4 ++-- src/chroot-tools/libremakepkg | 4 ++-- src/fullpkg/fullpkg | 15 ++++++++++++++- src/fullpkg/fullpkg-build | 15 ++++++++++++++- src/lib/libremessages | 7 ++----- src/mips64el-tools/add-mips64el | 15 ++++++++++++++- src/mips64el-tools/mips-add | 15 ++++++++++++++- src/repo-diff | 15 ++++++++++++++- src/toru/toru | 5 +++-- src/toru/toru-info | 15 ++++++++++++++- src/toru/toru-path | 15 ++++++++++++++- src/toru/toru-utils | 15 ++++++++++++++- src/toru/toru-where | 15 ++++++++++++++- 14 files changed, 138 insertions(+), 22 deletions(-) diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup index 60a4e22..a72f951 100755 --- a/src/chroot-tools/chcleanup +++ b/src/chroot-tools/chcleanup @@ -2,11 +2,12 @@ # Copyright (C) 2011-2012 Nicolás Reynolds # Copyright (C) 2012-2013 Luke Shumaker # -# License: GNU GPLv3 +# License: GNU GPLv3+ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 3 of the License. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index bb82bd2..d8e76ac 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -7,13 +7,13 @@ set -euE # Copyright (C) 2012 Michał Masłowski # Copyright (C) 2012-2014 Luke Shumaker # -# License: GNU GPLv3+ +# License: GNU GPLv2+ # # This file is part of Parabola. # # Parabola is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or +# the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # Parabola is distributed in the hope that it will be useful, diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 1ed4eaf..aad4217 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -7,13 +7,13 @@ set -euE # Copyright (C) 2012 Michał Masłowski # Copyright (C) 2012-2014 Luke Shumaker # -# License: GNU GPLv3+ +# License: GNU GPLv2+ # # This file is part of Parabola. # # Parabola is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or +# the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # Parabola is distributed in the hope that it will be useful, diff --git a/src/fullpkg/fullpkg b/src/fullpkg/fullpkg index 0572ddb..8e87e46 100755 --- a/src/fullpkg/fullpkg +++ b/src/fullpkg/fullpkg @@ -5,7 +5,20 @@ # Copyright (C) 2011 Nicolás Reynolds # Copyright (C) 2011-2012 Joshua Ismael Haase Hernández (xihh) # -# License: Unspecified +# License: GNU GPLv3+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . usage() { print "Usage: %s [OPTIONS] [BUILD_DIR]" "${0##*/}" diff --git a/src/fullpkg/fullpkg-build b/src/fullpkg/fullpkg-build index 715f505..06d0d50 100755 --- a/src/fullpkg/fullpkg-build +++ b/src/fullpkg/fullpkg-build @@ -7,7 +7,20 @@ # Copyright (C) 2011 Nicolás Reynolds # Copyright (C) 2013 Luke Shumaker # -# License: Unspecified +# License: GNU GPLv3+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . # TODO move __build to chroot diff --git a/src/lib/libremessages b/src/lib/libremessages index cb3d883..b89e2bc 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -15,11 +15,11 @@ # Copyright (C) 2006 Andras Voroskoi # Copyright (C) 2006 Miklos Vajna # -# License: GNU GPLv3+ +# License: GNU GPLv2+ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, @@ -30,9 +30,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# setup_traps() is based on pacman:makepkg, which is GPLv2+, -# so we take the '+' to combine it with our GPLv3+. - ################################################################################ # Inherit most functions from devtools # ################################################################################ diff --git a/src/mips64el-tools/add-mips64el b/src/mips64el-tools/add-mips64el index bf04663..bb1bb69 100755 --- a/src/mips64el-tools/add-mips64el +++ b/src/mips64el-tools/add-mips64el @@ -3,7 +3,20 @@ # Copyright (C) 2011 Nicolás Reynolds # -# License: Unspecified +# License: GNU GPLv3+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . find -name 'PKGBUILD' -exec sed -i "s/^\(arch=([^)anym]\+\))/\1 'mips64el')/" '{}' \; diff --git a/src/mips64el-tools/mips-add b/src/mips64el-tools/mips-add index 11f6a74..ef708ec 100755 --- a/src/mips64el-tools/mips-add +++ b/src/mips64el-tools/mips-add @@ -1,7 +1,20 @@ #!/usr/bin/env bash # Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) # -# License: Unspecified +# License: GNU GPLv3+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . . libremessages if ! grep mips64el PKGBUILD >/dev/null; then # Add mips64el in ${arch} array if it isn't 'any' diff --git a/src/repo-diff b/src/repo-diff index d25983a..e36edad 100755 --- a/src/repo-diff +++ b/src/repo-diff @@ -3,7 +3,20 @@ # Copyright (C) 2013 Nicolás Reynolds # -# License: Unspecified +# License: GNU GPLv3+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . . libremessages diff --git a/src/toru/toru b/src/toru/toru index 16ec4af..142e9e4 100755 --- a/src/toru/toru +++ b/src/toru/toru @@ -6,11 +6,12 @@ # Copyright (C) 2012-2013 Michał Masłowski # Copyright (C) 2013 Luke Shumaker # -# License: GNU GPLv3 +# License: GNU GPLv3+ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 3 of the License. +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/src/toru/toru-info b/src/toru/toru-info index aa84fcf..a427050 100755 --- a/src/toru/toru-info +++ b/src/toru/toru-info @@ -3,7 +3,20 @@ # Copyright (C) 2012 Nicolás Reynolds # -# License: Unspecified +# License: GNU GPLv3+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . . libremessages . $(librelib conf) diff --git a/src/toru/toru-path b/src/toru/toru-path index 8674d53..32ddc24 100755 --- a/src/toru/toru-path +++ b/src/toru/toru-path @@ -3,7 +3,20 @@ # Copyright (C) 2011-2012 Nicolás Reynolds # Copyright (C) 2012 Michał Masłowski # -# License: Unspecified +# License: GNU GPLv3+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . source toru-utils diff --git a/src/toru/toru-utils b/src/toru/toru-utils index 2fecfc2..164f418 100755 --- a/src/toru/toru-utils +++ b/src/toru/toru-utils @@ -3,7 +3,20 @@ # Copyright (C) 2011-2012 Nicolás Reynolds # Copyright (C) 2012 Joshua Ismael Haase Hernández (xihh) # -# License: Unspecified +# License: GNU GPLv3+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . . libremessages . $(librelib conf.sh) diff --git a/src/toru/toru-where b/src/toru/toru-where index 9d90972..e70d135 100755 --- a/src/toru/toru-where +++ b/src/toru/toru-where @@ -3,7 +3,20 @@ # Copyright (C) 2012 Nicolás Reynolds # -# License: Unspecified +# License: GNU GPLv3+ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . . $(librelib conf.sh) load_files libretools -- cgit v1.2.2 From bcdde66dc12bb7ebd8d6cf4833115b719b24f2e1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 25 Mar 2014 21:03:02 -0400 Subject: touch up the librefetch(8) man page --- src/librefetch/librefetch.8.ronn | 59 ++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/librefetch/librefetch.8.ronn b/src/librefetch/librefetch.8.ronn index 7d2dfb3..895d063 100644 --- a/src/librefetch/librefetch.8.ronn +++ b/src/librefetch/librefetch.8.ronn @@ -11,7 +11,7 @@ librefetch(8) -- downloads or creates a liberated source tarball `librefetch` is a program to streamline creation of custom source tarballs for `PKGBUILD(5)` files. -If a URL mentioned in the `source` array in a `PKGUILD` is in a +If a URL mentioned in the array in a `PKGUILD` is in a location that Parabola uploads "custom" source tarballs (or configured locations), and no file is at that URL, librefetch will automatically create it for you. @@ -52,16 +52,16 @@ fails, it may choose to try `create` mode. ## DOWNLOAD MODE If begins with the string `libre://`, it is replaced with -the first value in `MIRRORS`, as configured in `librefetch.conf(5)`; +the first value in , as configured in `librefetch.conf(5)`; this is for compatability with PKGBUILDs that used a previous version of librefetch. -It uses `DOWNLOADER`, as configured in `librefetch.conf` to attempt to +It uses , as configured in `librefetch.conf` to attempt to download the source tarball from that URL. If that fails, and following conditions are met, it proceeds to `create` mode: * The `-D` flag has not been specified to inhibit `create` mode. - * The `` begins with one of the values in `MIRRORS`. + * The begins with one of the values in . The latter requirement allows librefetch to be used as a generic HTTP(S) download agent, that can automatically create files from @@ -70,13 +70,13 @@ whitelisted locations. ## CREATE MODE The principle of `create` mode is that a special `PKGBUILD(5)`, called -a `SRCBUILD(5)`, installs source files to `$pkgdir`, and the resulting -"package" is then used as a source tarball. The `SRCBUILD` exists in -the same directory as the `PKGBUILD`. It can be created manually, or -generated on-the-fly from the `PKGBUILD`. Extra steps are taken to -ensure that as long as the same directory contents go in, an identical -tarball will come out--the checksum of the file should not change -based on when it is built or who builds it. +`SRCBUILD(5)`, that installs source files to <$pkgdir>, and the +resulting "package" is then used as a source tarball. The `SRCBUILD` +exists in the same directory as the `PKGBUILD`. It can be created +manually, or generated on-the-fly from the `PKGBUILD`. Extra steps +are taken to ensure that as long as the same directory contents go in, +an identical tarball will come out--the checksum of the file should +not change based on when it is built or who builds it. The `SRCBUILD` is either created, or sanitized if it already exists, then fed to a modified version of `makepkg(8)`. @@ -98,14 +98,14 @@ file can be printed instead of executed with `print` mode. ### PRE-EXISTING SRCBUILD The use of `SRCBUILD` files pre-dates `librefetch`. By convention, -they set `PKGDEST` and `PKGEXT` in `package()` in order to modify the +they set and in `package()` in order to modify the behavior of `makepkg`. Because a modified version of `makepkg` is used, this interferes with the correct behavior. To compensate for this, lines containing "`PKGDEST=`" or "`PKGEXT=`" are deleted from the `SRCBUILD`. The general idea is that `build()` makes any modifications to the -source, then `package()` copies it from `$srcdir` to `$pkgdir`. +source, then `package()` copies it from <$srcdir> to <$pkgdir>. ### SRCBUILD FROM PKGBUILD @@ -131,31 +131,32 @@ Following is a table of the translations. makedepends = mkdepends Functions prepare() { :; } - build() { mksource; } - check() { :; } + build() { mksource; } + check() { :; } package() { cp -a "$srcdir"/*/ "$pkgdir/"; } The `mksource()` function does not need to be defined. If it isn't defined, then no transformations will be made to the source between it -being extracted to `$srcdir` and copied to `$pkgdir`. +being extracted to <$srcdir> and copied to <$pkgdir>. In summary: - * Set `mksource=()` and `mkmd5sums=(`) to act as `source=(`) and - `md5sums=()` + * Set and to act as and + , respectively. * Declare a `mksource()` function to make modifications to the source, if nescessary. Other changes: - * `pkgname` is set to `pkgbase`, or the first element of the - `pkgname` array. - * `options=()` is set have `makepkg` avoid making changes to - `$pkgdir`. The exact change is: + * is set to , or the first element of the + array (the effect is that split packaging is turnes + off). + * is set have `makepkg` avoid making changes to + <$pkgdir>. The exact change is: options=(!strip docs libtool staticlibs emptydirs !zipman purge !upx) - * `PURGE_TARGETS=()` has vcs directories added to it: + * has vcs directories added to it: PURGE_TARGETS=(.bzr/ .cvs/ .git/ .hg/ .svn/ .makepkg/) @@ -163,18 +164,18 @@ Other changes: The following modifications are made to makepkg: - * Allow us to manipulate the output file (`$pkg_file`) - * Do not include metadata in the output file (`${comp_files[@]}`) + * Allow us to manipulate the output file (<$pkg_file>) + * Do not include metadata in the output file (<${comp_files[@]}>) * Force 'ustar' tar format, don't allow it to upgrade to 'pax' to store extended file attributes. * Don't symlink the resulting file into the current directory. - * `PURGE_TARGETS` interprets an item as a directory if it ends with a + * interprets an item as a directory if it ends with a slash ("/"). - * Timestamps in `$pkgdir` are reset to "1990-01-01 0:0:0 +0", so that + * Timestamps in <$pkgdir> are reset to "1990-01-01 0:0:0 +0", so that the resulting tarball will be the same, regardless of when it was created. - * append `-libre` to `$srcdir` - * append `-libre` to `$pkgbasedir` (which becomes `$pkgdir`) + * append `-libre` to <$srcdir> + * append `-libre` to <$pkgbasedir> (which becomes <$pkgdir>) * Don't check if the package has already been built. ## CONFIGURATION -- cgit v1.2.2 From 0e9df864eea7f473e6b742cf5fb4818603df59fc Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 25 Mar 2014 21:21:48 -0400 Subject: fullpkg: load libremessages --- src/fullpkg/fullpkg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fullpkg/fullpkg b/src/fullpkg/fullpkg index 8e87e46..e053c6e 100755 --- a/src/fullpkg/fullpkg +++ b/src/fullpkg/fullpkg @@ -20,6 +20,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +. libremessages + usage() { print "Usage: %s [OPTIONS] [BUILD_DIR]" "${0##*/}" print "A (libre)makepkg wrapper that will also build dependencies" -- cgit v1.2.2 From cffbaf45b0882a5c6d63d2b798e848d5b21e800b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 25 Mar 2014 21:39:59 -0400 Subject: chcleanup: remove the no-longer-used warning() function --- src/chroot-tools/chcleanup | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup index a72f951..9084736 100755 --- a/src/chroot-tools/chcleanup +++ b/src/chroot-tools/chcleanup @@ -50,11 +50,6 @@ msg2() { printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 } -warning() { - local mesg="$(_ "$1")"; shift - printf "${YELLOW}==> $(gettext "WARNING:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 -} - error() { local mesg="$(_ "$1")"; shift printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 -- cgit v1.2.2 From ae871fca2853bc3e5bf14587caecfa0436ba03a3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 25 Mar 2014 21:40:39 -0400 Subject: chcleanup: used ##*/ instead of basename --- src/chroot-tools/chcleanup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup index 9084736..6432d5b 100755 --- a/src/chroot-tools/chcleanup +++ b/src/chroot-tools/chcleanup @@ -78,7 +78,7 @@ msg "Cleaning chroot..." cp /repo/repo.db /var/lib/pacman/sync/repo.db # Setup the temporary directory -TEMPDIR="$(mktemp --tmpdir -d $(basename $0).XXXXX)" +TEMPDIR="$(mktemp --tmpdir -d ${0##*/}.XXXXXXXXXX)" trap "rm -rf '$TEMPDIR'" EXIT cp -a /var/lib/pacman/sync "${TEMPDIR}/" -- cgit v1.2.2 From 8831cc585ae8e9071f8c022bdfaf75e42029d7e4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 25 Mar 2014 21:44:14 -0400 Subject: Fix quoting/escaping with 'rm' in traps. --- src/chroot-tools/chcleanup | 2 +- src/chroot-tools/librechroot | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chroot-tools/chcleanup b/src/chroot-tools/chcleanup index 6432d5b..bfb65ce 100755 --- a/src/chroot-tools/chcleanup +++ b/src/chroot-tools/chcleanup @@ -79,7 +79,7 @@ cp /repo/repo.db /var/lib/pacman/sync/repo.db # Setup the temporary directory TEMPDIR="$(mktemp --tmpdir -d ${0##*/}.XXXXXXXXXX)" -trap "rm -rf '$TEMPDIR'" EXIT +trap "rm -rf -- $(printf '%q' "$TEMPDIR")" EXIT cp -a /var/lib/pacman/sync "${TEMPDIR}/" pkglist="${TEMPDIR}"/pkglist.txt diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index d8e76ac..6be9f09 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -371,7 +371,7 @@ main() { arch-nspawn "$copydir" bash -c 'pacman -Syu --noconfirm' ;; clean-pkgs) - trap "rm -f '$copydir'/bin/chcleanup '$copydir'/chrootexec" EXIT + trap "rm -f -- $(printf '%q ' "$copydir"/{bin/chcleanup,chrootexec})" EXIT install -m755 "$(librelib chroot/chcleanup)" "$copydir/bin/chcleanup" printf '%s\n' \ '#!/bin/bash' \ -- cgit v1.2.2 From 9aa40b5189c5324e3d83cf78c78dca92dfda842d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 10 May 2014 21:56:03 -0400 Subject: fix whitespace (one line had 8 spaces instead of a tab) --- src/librefetch/librefetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index fdc7e00..49159f5 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -264,7 +264,7 @@ makepkg_modify=' } /tidy_install\(\) \{/,/^\}$/ { - /for .*PURGE_TARGETS/itidy_install_purge + /for .*PURGE_TARGETS/itidy_install_purge /for .*PURGE_TARGETS/,/done/d /^\}$/ifind . -exec touch --no-dereference --date="1990-01-01 0:0:0 +0" -- {} + } -- cgit v1.2.2 From b0b4a603d24d905d757df39ec2e90f46403cdd32 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 10 May 2014 21:57:34 -0400 Subject: librefetch: Make the order of files in a tarball deterministic --- src/librefetch/librefetch | 6 +++++- src/librefetch/librefetch.8.ronn | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 49159f5..d0bbf1b 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -259,7 +259,11 @@ makepkg_modify=' /create_package\(\) \{/,/^\}$/ { /pkg_file=/d # allow us to set pkg_file s/"?\$\{comp_files\[@\]\}"?// # do not include .{PKGINFO,INSTALL,CHANGELOG} - s/bsdtar /&--format=ustar / # ustar, not pax + # This is long/gross. What it does: + # - pass --format=ustar to bsdtar, to inhibit it using the pax format + # - take the files that would be included in the tarball, and use + # find/sort/xargs to order them before passing them to bsdtar + s/bsdtar(.*) - ([^|]*) \|/find \2 -print0 | LC_ALL=C sort --zero-terminated | xargs -0 bsdtar --format=ustar --no-recursion \1 - |/ s/create_signature .*/&; return $?/ # do not procede to create symlinks } diff --git a/src/librefetch/librefetch.8.ronn b/src/librefetch/librefetch.8.ronn index 7d2dfb3..3b51fb4 100644 --- a/src/librefetch/librefetch.8.ronn +++ b/src/librefetch/librefetch.8.ronn @@ -173,6 +173,9 @@ The following modifications are made to makepkg: * Timestamps in `$pkgdir` are reset to "1990-01-01 0:0:0 +0", so that the resulting tarball will be the same, regardless of when it was created. + * Sort the files included in the tarball; normally the order of files + in a tarball is essentially random (even if it tends to be the same + when re-created on the same machine). * append `-libre` to `$srcdir` * append `-libre` to `$pkgbasedir` (which becomes `$pkgdir`) * Don't check if the package has already been built. -- cgit v1.2.2 From 7233318d44860fb3e2e4596a3352b4c9d783a1da Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 10 May 2014 22:13:03 -0400 Subject: Update to new devtools. --- src/chroot-tools/makechrootpkg.sh.patch | 41 ++++++++++++++++++--------------- src/chroot-tools/mkarchroot.patch | 8 +++---- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/chroot-tools/makechrootpkg.sh.patch b/src/chroot-tools/makechrootpkg.sh.patch index 5cea39a..8180d89 100644 --- a/src/chroot-tools/makechrootpkg.sh.patch +++ b/src/chroot-tools/makechrootpkg.sh.patch @@ -1,5 +1,5 @@ ---- makechrootpkg.sh.in 2014-03-21 13:59:31.239683366 -0400 -+++ makechrootpkg.sh.ugly 2014-03-21 14:19:20.747789508 -0400 +--- makechrootpkg.sh.in 2014-05-10 22:03:27.956692573 -0400 ++++ makechrootpkg.sh.ugly 2014-05-10 22:09:15.376594518 -0400 @@ -1,4 +1,6 @@ #!/bin/bash +# License: GNU GPLv2 @@ -12,8 +12,8 @@ shopt -s nullglob +init_variables() { - _makepkg_args=(-s --noconfirm -L --holdver) - makepkg_args=("${_makepkg_args[@]}") + default_makepkg_args=(-s --noconfirm -L --holdver) + makepkg_args=("${default_makepkg_args[@]}") repack=false @@ -29,9 +32,10 @@ bindmounts_rw=() @@ -35,7 +35,7 @@ while getopts 'hcur:I:l:nTD:d:' arg; do case "$arg" in h) usage ;; -@@ -93,9 +98,6 @@ +@@ -91,9 +96,6 @@ [[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" "$passeddir" [[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try using: mkarchroot %s/root base-devel" "$chrootdir" @@ -45,7 +45,7 @@ if [[ ${copy:0:1} = / ]]; then copydir=$copy else -@@ -115,30 +117,48 @@ +@@ -113,30 +115,48 @@ esac done @@ -100,11 +100,14 @@ # 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" -@@ -159,11 +179,16 @@ +@@ -157,14 +177,19 @@ # Drop the read lock again lock_close 8 - fi + + # Update mtime + touch "$copydir" } -clean_temporary() { @@ -120,7 +123,7 @@ if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; then btrfs subvolume delete "$copydir" >/dev/null || die "Unable to delete subvolume %s" "$copydir" -@@ -178,9 +203,14 @@ +@@ -179,9 +204,14 @@ stat_done } @@ -135,7 +138,7 @@ for install_pkg in "${install_pkgs[@]}"; do pkgname="${install_pkg##*/}" cp "$install_pkg" "$copydir/$pkgname" -@@ -193,11 +223,19 @@ +@@ -194,11 +224,19 @@ rm "$copydir/$pkgname" done @@ -157,7 +160,7 @@ $repack || rm -rf "$copydir/build" mkdir -p "$copydir/build" -@@ -236,12 +274,12 @@ +@@ -237,12 +275,12 @@ chown -R nobody "$copydir"/{build,pkgdest,srcpkgdest,logdest,srcdest,startdir} @@ -172,7 +175,7 @@ sed -i '/^PACKAGER=/d' "$copydir/etc/makepkg.conf" echo "PACKAGER='${PACKAGER}'" >> "$copydir/etc/makepkg.conf" fi -@@ -254,20 +292,38 @@ +@@ -255,20 +293,38 @@ chmod 440 "$copydir/etc/sudoers.d/nobody-pacman" fi @@ -213,7 +216,7 @@ makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o else ( export SRCDEST BUILDDIR="$builddir" -@@ -277,10 +333,10 @@ +@@ -278,10 +334,10 @@ (( $? != 0 )) && die "Could not download sources." # Clean up garbage from verifysource @@ -226,7 +229,7 @@ # This function isn't run in makechrootpkg, # so no global variables local run_namcap="$1"; shift -@@ -291,6 +347,7 @@ +@@ -292,6 +348,7 @@ shopt -s nullglob # XXX: Workaround makepkg disliking read-only dirs @@ -234,7 +237,7 @@ ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* -@@ -316,11 +373,29 @@ +@@ -317,11 +374,29 @@ # Safety check if [[ ! -w PKGBUILD ]]; then @@ -265,7 +268,7 @@ if $run_namcap; then pacman -S --needed --noconfirm namcap -@@ -333,12 +408,24 @@ +@@ -334,12 +409,24 @@ exit 0 } @@ -290,7 +293,7 @@ for l in "$copydir"/logdest/*; do [[ $l == */logpipe.* ]] && continue chown "$src_owner" "$l" -@@ -352,6 +439,10 @@ +@@ -353,6 +440,10 @@ } # }}} @@ -300,8 +303,8 @@ + umask 0022 - load_vars /etc/makepkg.conf -@@ -363,30 +454,45 @@ + load_vars "$USER_HOME/.makepkg.conf" +@@ -364,30 +455,45 @@ [[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD [[ -d $LOGDEST ]] || LOGDEST=$PWD @@ -353,7 +356,7 @@ if (( ret != 0 )); then if $temp_chroot; then -@@ -397,3 +503,4 @@ +@@ -398,3 +504,4 @@ else true fi diff --git a/src/chroot-tools/mkarchroot.patch b/src/chroot-tools/mkarchroot.patch index 171b38a..d6f83f1 100644 --- a/src/chroot-tools/mkarchroot.patch +++ b/src/chroot-tools/mkarchroot.patch @@ -1,5 +1,5 @@ ---- mkarchroot.in 2014-03-21 13:59:31.593002027 -0400 -+++ mkarchroot.ugly 2014-03-21 14:23:12.027238102 -0400 +--- mkarchroot.in 2014-05-10 22:10:54.871326879 -0400 ++++ mkarchroot.ugly 2014-05-10 22:10:54.887993222 -0400 @@ -1,4 +1,6 @@ #!/bin/bash +# License: GNU GPLv2 @@ -7,7 +7,7 @@ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. -@@ -65,6 +67,11 @@ +@@ -66,6 +68,11 @@ chmod 0755 "$working_dir" fi @@ -19,7 +19,7 @@ pacstrap -GMcd ${pac_conf:+-C "$pac_conf"} "$working_dir" \ "${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages' -@@ -72,7 +79,7 @@ +@@ -73,7 +80,7 @@ echo 'LANG=C' > "$working_dir/etc/locale.conf" echo "$CHROOT_VERSION" > "$working_dir/.arch-chroot" -- cgit v1.2.2 From 7d74f7ccef61ccb120e920287f6929c12c48d895 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 10 May 2014 22:40:16 -0400 Subject: mkarchroot: creating chroots wasn't working. I later noticed that alfplayer filed a bug report about it: https://labs.parabola.nu/issues/518 --- src/chroot-tools/mkarchroot.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chroot-tools/mkarchroot.patch b/src/chroot-tools/mkarchroot.patch index d6f83f1..9366d92 100644 --- a/src/chroot-tools/mkarchroot.patch +++ b/src/chroot-tools/mkarchroot.patch @@ -14,7 +14,7 @@ +_env=() +while read -r varname; do + _env+=("$varname=${!varname}") -+done < { declare -x | sed -r 's/^declare -x ([^=]*)=.*/\1/' | grep -i '_proxy$'; } ++done < <(declare -x | sed -r 's/^declare -x ([^=]*)=.*/\1/' | grep -i '_proxy$') +env -i "${_env[@]}" \ pacstrap -GMcd ${pac_conf:+-C "$pac_conf"} "$working_dir" \ "${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages' -- cgit v1.2.2 From b810795b6689ab9e1635af21a48660305b2a7820 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 10 May 2014 22:48:36 -0400 Subject: test/librechroot: 'exit' isn't an executable program. This test worked before because of work-arounds for systemd bugs, it had invoked bash inside of the chroot. --- test/librechroot-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index c22ac58..43f3143 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -40,7 +40,7 @@ it_respects_exit_status_if_out_isnt_a_tty() ( set -o pipefail libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty r=0 - { testsudo librechroot -l "$roundup_test_name" run exit 3 | cat; } || r=$? + { testsudo librechroot -l "$roundup_test_name" run bash -c 'exit 3' | cat; } || r=$? [[ $r == 3 ]] ) -- cgit v1.2.2 From 79e4605a163199344df44b8947a15bac9ece75d0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 10 May 2014 22:59:37 -0400 Subject: Add a rough test of file order from librefetch's tarballs. --- test/librefetch-test.sh | 1 + test/librefetch.d/PKGBUILD | 5 ++++- test/librefetch.d/list.txt | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh index 43b7a69..675299a 100644 --- a/test/librefetch-test.sh +++ b/test/librefetch-test.sh @@ -31,6 +31,7 @@ it_displays_help() { empty $tmpdir/stderr } +# This test also does a rough test of file order in the PKGBUILD it_cleans_src_libre_first() { cp librefetch.d/* "$tmpdir/" cd "$tmpdir" diff --git a/test/librefetch.d/PKGBUILD b/test/librefetch.d/PKGBUILD index 723d82e..db80db3 100644 --- a/test/librefetch.d/PKGBUILD +++ b/test/librefetch.d/PKGBUILD @@ -7,7 +7,10 @@ source=("libre://$pkgname-$pkgver.tar.gz") mksource() { mkdir "$srcdir/bar" - touch "$srcdir/bar/file" + local file + for file in '~foo' '~a' a A; do + touch "$srcdir/bar/$file" + done } package() { diff --git a/test/librefetch.d/list.txt b/test/librefetch.d/list.txt index b04d5d1..9bd32f4 100644 --- a/test/librefetch.d/list.txt +++ b/test/librefetch.d/list.txt @@ -1,2 +1,5 @@ bar/ -bar/file +bar/A +bar/a +bar/~a +bar/~foo -- cgit v1.2.2 From f3dd569efc04b1fb315d2233fda043e15bb7430b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 11 May 2014 01:41:20 -0400 Subject: librefetch: enhance debugging options (flags change) --- src/librefetch/librefetch | 24 ++++++++++++++++++------ src/librefetch/librefetch.8.ronn | 8 ++++++-- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index d0bbf1b..c1c3494 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -70,7 +70,8 @@ usage() { directory, it is used instead" print " Alternate modes:" flag "-g, --geninteg" "Generage integrity checks for source files" - flag "-P, --print" "Print the effective build script (SRCBUILD)" + flag "-S, --srcbuild" "Print the effective build script (SRCBUILD)" + flag "-M, --makepkg" "Print the effective makepkg script" flag "-h, --help" "Show this message" } @@ -90,6 +91,17 @@ main() { ######################################################################## + makepkg="$(modified_makepkg "$(which makepkg)")" + + # Mode: makepkg ######################################################## + + if [[ $mode =~ makepkg ]]; then + cat "$makepkg" + return 0 + fi + + ######################################################################## + local BUILDFILEDIR="${BUILDFILE%/*}" if [[ -f "${BUILDFILEDIR}/SRCBUILD" ]]; then BUILDFILE="${BUILDFILEDIR}/SRCBUILD" @@ -102,7 +114,6 @@ main() { */SRCBUILD) srcbuild="$(modified_srcbuild "$BUILDFILE")";; *) srcbuild="$(modified_pkgbuild "$BUILDFILE")";; esac - makepkg="$(modified_makepkg "$(which makepkg)")" # Mode: checksums ###################################################### @@ -115,9 +126,9 @@ main() { return 0 fi - # Mode: print ########################################################## + # Mode: srcbuild ####################################################### - if [[ $mode =~ print ]]; then + if [[ $mode =~ srcbuild ]]; then cat "$srcbuild" return 0 fi @@ -212,7 +223,8 @@ parse_options() { -C) mode=create;; -D) mode=download;; -g|--geninteg) mode=checksums;; - -P|--print) mode=print;; + -S|--srcbuild) mode=srcbuild;; + -M|--makepkg) mode=makepkg;; -p) BUILDFILE="$(readlink -m -- "$opt")";; -h|--help) mode=help;; --) shift; break;; @@ -235,7 +247,7 @@ parse_options() { case "$mode" in help) # don't worry about it :;; - checksums|print) # don't take any extra arguments + checksums|srcbuild|makepkg) # don't take any extra arguments if [[ ${#extra_opts[@]} != 0 ]]; then print "%s: found extra non-flag arguments: %s" "$cmd" "${extra_opts[*]}" >&2 usage >&2 diff --git a/src/librefetch/librefetch.8.ronn b/src/librefetch/librefetch.8.ronn index 3b51fb4..4c9c1c4 100644 --- a/src/librefetch/librefetch.8.ronn +++ b/src/librefetch/librefetch.8.ronn @@ -31,7 +31,8 @@ There are 5 modes: * `download`: Download the tarball from the configured mirror. * `create`: Create the tarball from a `PKGBUILD`/`SRCBUILD`. * `checksums`: Generate integrity checks for source files. - * `print`: Print the effective build script. + * `srcbuild`: Print the effective build script. + * `makepkg`: Print the effective makepkg script. * `help`: Print `librefetch` usage information. The normal mode of operation is `download` mode. If `download` mode @@ -46,7 +47,10 @@ fails, it may choose to try `create` mode. directory, it is used instead. * `-g` | `--geninteg`: Use `checksums` mode: Generate integrity checks for source files. - * `-P` | `--print`: Use `print` mode: print the effective build script. + * `-S` | `--srcbuild`: Use `srcbuild` mode: print the effective build + script. + * `-M` | `--makepkg`: Use `makepkg` mode: print the effective makepkg + script. * `-h` | `--help`: Use `help` mode: Show useage information. ## DOWNLOAD MODE -- cgit v1.2.2 From 6f5910a55f72c5d01a26b685a7a06a6673a2e9f7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 11 May 2014 01:36:44 -0400 Subject: test/librefetch: inhibit running an installed copy of librefetch --- test/librefetch-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh index 675299a..9db836b 100644 --- a/test/librefetch-test.sh +++ b/test/librefetch-test.sh @@ -9,7 +9,7 @@ before() { mkdir -p "$HOME" printf '%s\n' \ - "DLAGENTS+=({https,libre}'::$(which librefetch) -p \"\$BUILDFILE\" -- %u %o')" \ + "DLAGENTS=({https,libre}'::$(which librefetch) -p \"\$BUILDFILE\" -- %u %o')" \ 'BUILDDIR=""' \ > "$HOME/.makepkg.conf" -- cgit v1.2.2 From b31425edf4c1b292280e5d14016611f238372a18 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 11 May 2014 22:45:42 -0400 Subject: Create CHROOTARCH in chroot.conf for when $CARCH != $(uname -m) This is the case on mips, where CARCH is misp64el, but uname -m is mips64. --- src/chroot-tools/arch-nspawn.patch | 14 ++++++++++++-- src/chroot-tools/librechroot | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/chroot-tools/arch-nspawn.patch b/src/chroot-tools/arch-nspawn.patch index afdf51a..5e0f10b 100644 --- a/src/chroot-tools/arch-nspawn.patch +++ b/src/chroot-tools/arch-nspawn.patch @@ -1,5 +1,5 @@ ---- arch-nspawn.in 2014-03-21 13:59:31.812992892 -0400 -+++ arch-nspawn 2014-03-21 14:24:23.520619552 -0400 +--- arch-nspawn.in 2014-05-11 00:58:42.030932904 -0400 ++++ arch-nspawn.ugly 2014-05-11 22:33:47.186717386 -0400 @@ -1,4 +1,6 @@ #!/bin/bash +# License: GNU GPLv2 @@ -7,3 +7,13 @@ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. +@@ -103,7 +105,8 @@ + machine_name="${machine_name#-}" + fi + +-exec ${CARCH:+setarch "$CARCH"} systemd-nspawn -q \ ++CHROOTARCH="$(. $(librelib conf); get_var chroot CHROOTARCH "$CARCH")" ++exec ${CHROOTARCH:+setarch "$CHROOTARCH"} systemd-nspawn -q \ + -D "$working_dir" \ + --machine "$machine_name" \ + "${mount_args[@]}" \ diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index d8e76ac..9e74a62 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -336,6 +336,8 @@ main() { printf '%q ' "${CHROOTEXTRAPKG[@]}" printf ')\n' fi + # TODO: only set CHROOTARCH if $CARCH != $(uname -m) + printf 'CHROOTARCH=%q\n' "$(uname -m)" } > "$copydir"/etc/libretools.d/chroot.conf if [[ $mode != delete ]]; then -- cgit v1.2.2 From 9f1ef0bbdf1bc246c0c035a2dd6a4bcfa41664ef Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 11 May 2014 23:31:58 -0400 Subject: update the libremessages man page with changes from devtools --- src/lib/libremessages.1.ronn | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib/libremessages.1.ronn b/src/lib/libremessages.1.ronn index d39dad0..2bf73a1 100644 --- a/src/lib/libremessages.1.ronn +++ b/src/lib/libremessages.1.ronn @@ -156,15 +156,16 @@ these, you could end up deleting a lot of someone's work. * `cleanup` []: *If* `setup_workdir` has been run, `rm -rf "$WORKDIR"`. If given - a numeric argument, it will then call `exit`(1) with that argument. + a numeric argument, it will then call `exit`(1) with that + argument, otherwise it calls `exit`(1) with a status of 0. * `abort`: Calls `msg` with the message "Aborting...", then calls - `cleanup 0`. + `cleanup 255`. * `die` [...]: Exactly like `error`, but calls `cleanup` and calls `exit`(1) - with a status of 1. + with a status of 255. ### LOCKFILE ROUTINES @@ -212,9 +213,6 @@ pull it into a separate program. xterm and rxvt (and their various values; "rxvt-unicode-256color" is still rxvt). -Also, I think `abort` calling `cleanup 1` would make more sense than -`cleanup 0`. - ## SEE ALSO librelib(7), gettext(1), common.sh(3) -- cgit v1.2.2 From 0c5516fe647de69e92517b99794792b99754044e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 15 May 2014 22:03:04 -0400 Subject: librefetch: Update 'Usage:' line. --- src/librefetch/librefetch | 2 +- src/librefetch/librefetch.8.ronn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index c1c3494..65f5de9 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -30,7 +30,7 @@ trap "rm -rf -- $(printf '%q' "$tempdir")" EXIT cmd=${0##*/} usage() { print "Usage: %s [OPTIONS] SOURCE_URL [OUTPUT_FILE]" "$cmd" - print "Usage: %s -[g|P|h]" "$cmd" + print "Usage: %s -[g|S|M|h]" "$cmd" print "Downloads or creates a liberated source tarball." echo prose "The default mode is to create OUTPUT_FILE, first by trying diff --git a/src/librefetch/librefetch.8.ronn b/src/librefetch/librefetch.8.ronn index 4c9c1c4..d7b8edc 100644 --- a/src/librefetch/librefetch.8.ronn +++ b/src/librefetch/librefetch.8.ronn @@ -4,7 +4,7 @@ librefetch(8) -- downloads or creates a liberated source tarball ## SYNOPSIS `librefetch` [] []
-`librefetch` `-`[`g`|`P`|`h`] +`librefetch` `-`[`g`|`S`|`M`|`h`] ## DESCRIPTION -- cgit v1.2.2 From 56472f6c28e278fb937e3456f91b52cc5ec0b143 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 15 May 2014 22:03:58 -0400 Subject: librefetch: fix a call to `printf` that should have been to `print` --- src/librefetch/librefetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 65f5de9..98d85a2 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -233,7 +233,7 @@ parse_options() { makepkg_opts+=("$arg") $have_opt && makepkg_opts+=("$opt") else - printf '%s: invalid flag: %s' "$cmd" "$arg" + print '%s: invalid flag: %s' "$cmd" "$arg" return 1 fi ;; -- cgit v1.2.2 From 3771f34a54bca198921d60a1bce83068b7bd4f49 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 15 May 2014 22:05:37 -0400 Subject: librefetch: The ERR trap is greedy; use exit instead of return from main(). --- src/librefetch/librefetch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 98d85a2..8fd8c1d 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -86,7 +86,7 @@ main() { if [[ $mode =~ help ]]; then usage - return 0 + exit 0 fi ######################################################################## @@ -97,7 +97,7 @@ main() { if [[ $mode =~ makepkg ]]; then cat "$makepkg" - return 0 + exit 0 fi ######################################################################## @@ -123,14 +123,14 @@ main() { PKGBUILD) sed -e 's/^[a-z]/mk&/' -e 's/^\s/ &/';; SRCBUILD) cat;; esac - return 0 + exit 0 fi # Mode: srcbuild ####################################################### if [[ $mode =~ srcbuild ]]; then cat "$srcbuild" - return 0 + exit 0 fi ######################################################################## @@ -148,7 +148,7 @@ main() { if [[ $mode =~ download ]]; then load_files librefetch - check_vars librefetch MIRRORS DOWNLOADER || return 1 + check_vars librefetch MIRRORS DOWNLOADER || exit 1 # Canonicalize $src if [[ "$src" == libre://* ]]; then @@ -174,7 +174,7 @@ main() { dlcmd="${dlcmd//\%o/\"\$dst\"}" dlcmd="${dlcmd//\%u/\"\$src\"}" - { eval "$dlcmd"; } >&2 && return 0 + { eval "$dlcmd"; } >&2 && exit 0 fi # Mode: create ######################################################### @@ -186,7 +186,7 @@ main() { export pkg_file=$dst cd "$BUILDFILEDIR" - "$makepkg" "${makepkg_opts[@]}" -p "$srcbuild" >&2 || return $? + "$makepkg" "${makepkg_opts[@]}" -p "$srcbuild" >&2 || exit $? fi } -- cgit v1.2.2 From 79588f1bcc6f8052964717cdb8fe4eb82dceb0df Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 15 May 2014 22:06:13 -0400 Subject: librefetch: replace some makepkg messages with messages that make sense --- src/librefetch/librefetch | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 8fd8c1d..f41615f 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -289,6 +289,9 @@ makepkg_modify=' arm -rf "$srcdir"\nmkdir "$srcdir" } +s|Making package:|Making source:| +s:Checking (run|build)time dependencies\.\.\.:Checking source dependencies...: + s|srcdir=.*|&-libre| s|pkgdirbase=.*|&-libre| s|check_build_status$|:| -- cgit v1.2.2 From 7cdbee3ef93c1bef4b79310e4ef46cbde18c534f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 15 May 2014 22:06:45 -0400 Subject: librefetch: call usage() consistently --- src/librefetch/librefetch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index f41615f..b29598d 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -80,7 +80,10 @@ main() { makepkg_opts=() extra_opts=() mode=download-create - parse_options "$@" + if ! parse_options "$@"; then + usage >&2 + exit 1 + fi # Mode: help ########################################################### @@ -250,14 +253,12 @@ parse_options() { checksums|srcbuild|makepkg) # don't take any extra arguments if [[ ${#extra_opts[@]} != 0 ]]; then print "%s: found extra non-flag arguments: %s" "$cmd" "${extra_opts[*]}" >&2 - usage >&2 return 1 fi ;; *download*|*create*) # take 1 or 2 extra arguments if [[ ${#extra_opts[@]} != 1 ]] && [[ ${#extra_opts[@]} != 2 ]]; then print "%s: %d non-flag arguments found, expected 1 or 2: %s" "$cmd" ${#extra_opts[@]} >&2 - usage >&2 return 1 fi ;; -- cgit v1.2.2 From 9bb1ddbaf5f0585f5854ee2c25204bda56b32974 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 15 May 2014 22:08:17 -0400 Subject: librefetch: Fix bug with xargs calling tar too many times (cut xargs out) --- src/librefetch/librefetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index b29598d..11cf380 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -276,7 +276,7 @@ makepkg_modify=' # - pass --format=ustar to bsdtar, to inhibit it using the pax format # - take the files that would be included in the tarball, and use # find/sort/xargs to order them before passing them to bsdtar - s/bsdtar(.*) - ([^|]*) \|/find \2 -print0 | LC_ALL=C sort --zero-terminated | xargs -0 bsdtar --format=ustar --no-recursion \1 - |/ + s/bsdtar(.*) - ([^|]*) \|/find \2 -print0 | LC_ALL=C sort --zero-terminated | bsdtar --null --files-from - --format=ustar --no-recursion \1 - |/ s/create_signature .*/&; return $?/ # do not procede to create symlinks } -- cgit v1.2.2 From 22bb572086ff1c1667d553ac8233fc053a1556f2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 15 May 2014 22:25:43 -0400 Subject: librefetch: clean up documentation --- src/librefetch/librefetch | 3 ++- src/librefetch/librefetch.8.ronn | 15 +++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 11cf380..8b02205 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -53,7 +53,8 @@ usage() { prose "The default build script is 'PKGBUILD', or 'SRCBUILD' if it exists." echo - prose "Unrecognized options are passed straight to makepkg." + prose "Other options, if they are valid \`makepkg\` options, are passed + straight to makepkg." echo prose "%s does NOT support getopt-style flag combining. You must use '-a -b', not '-ab'." "$cmd" diff --git a/src/librefetch/librefetch.8.ronn b/src/librefetch/librefetch.8.ronn index d7b8edc..bb2e561 100644 --- a/src/librefetch/librefetch.8.ronn +++ b/src/librefetch/librefetch.8.ronn @@ -12,9 +12,9 @@ librefetch(8) -- downloads or creates a liberated source tarball tarballs for `PKGBUILD(5)` files. If a URL mentioned in the `source` array in a `PKGUILD` is in a -location that Parabola uploads "custom" source tarballs (or configured -locations), and no file is at that URL, librefetch will automatically -create it for you. +location that Parabola uploads "custom" source tarballs to (or +configured locations), and no file is at that URL, librefetch will +automatically create it for you. This works because a post-install script for the package configures `librefetch` as the download agent for `https://` URLs in @@ -53,6 +53,9 @@ fails, it may choose to try `create` mode. script. * `-h` | `--help`: Use `help` mode: Show useage information. +Other options, if they are documented in `makepkg -h`, are passed to +the modified copy of makepkg created during `create` mode. + ## DOWNLOAD MODE If begins with the string `libre://`, it is replaced with @@ -97,7 +100,7 @@ remain intact. As explained in the `CREATE MODE` section, in `create` mode, this program generates an `SRCBUILD` file. For debugging purposes, this -file can be printed instead of executed with `print` mode. +file can be printed instead of executed with `srcbuild` mode. ### PRE-EXISTING SRCBUILD @@ -184,6 +187,10 @@ The following modifications are made to makepkg: * append `-libre` to `$pkgbasedir` (which becomes `$pkgdir`) * Don't check if the package has already been built. +For debugging purposes, this modified makepkg can be printed instead +of executed with `makepkg` mode. Before it is run in create mode, +`PKGEXT`, `PKGDEST`, and `pkg_file` are set as environment variables. + ## CONFIGURATION See `librefetch.conf(5)` for details on configuring librefetch using -- cgit v1.2.2 From de12756765f573b03821b252a47e68a088090eb0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 25 May 2014 19:46:35 -0400 Subject: Well... libregit was broken --- src/gitget/libregit | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gitget/libregit b/src/gitget/libregit index 25550e5..f3bcfd7 100755 --- a/src/gitget/libregit +++ b/src/gitget/libregit @@ -40,3 +40,5 @@ main() { gitget checkout "${repo}#ref=${ref}" "${dir}" } + +main "$@" -- cgit v1.2.2 From b247261b96339a59e74c9d705fe06ab38bd9e634 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 25 May 2014 20:12:34 -0400 Subject: touch up usage() text in src/gitget --- src/gitget/gitget | 3 +-- src/gitget/libregit | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gitget/gitget b/src/gitget/gitget index bcc528c..a748943 100755 --- a/src/gitget/gitget +++ b/src/gitget/gitget @@ -145,8 +145,7 @@ download_git_bare() { } usage() { - print 'Usage: %s [OPTIONS] bare URL DIRECTORY' "${0##*/}" - print 'Usage: %s [OPTIONS] checkout URL DIRECTORY' "${0##*/}" + print 'Usage: %s [OPTIONS] [bare|checkout] URL DIRECTORY' "${0##*/}" print 'A URL-handler for git urls. Capable of updating or cloning.' echo prose "Clones or pulls from the git URL, to a local DIRECTORY. If diff --git a/src/gitget/libregit b/src/gitget/libregit index f3bcfd7..41aefc3 100755 --- a/src/gitget/libregit +++ b/src/gitget/libregit @@ -20,18 +20,17 @@ . libremessages usage() { - print 'Usage: %s repo ref dir' "${0##*/}" + print 'Usage: %s REPO REF DIR' "${0##*/}" print 'A compatability wrapper around `gitget checkout`' echo prose "This exists because gitget used to be called libregit, and took the arguments in this format, and I'm sure there are a few scripts floating around that use it." echo - prose "Clones or pulls from the git URL 'repo', and checks out the git - ref 'ref' to the directory 'dir'." + prose "Clones or pulls from the git URL '', and checks out the git + ref '' to the directory ''." } - main() { [[ $# == 3 ]] || { usage >&2; return 1; } repo=$1 -- cgit v1.2.2 From 5051daebf722a9020b015feabc4c39e6bdb187f1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 28 May 2014 01:25:51 -0400 Subject: gitget checkout: behave correctly when $ref is a tag --- src/gitget/gitget | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitget/gitget b/src/gitget/gitget index a748943..fe5d46b 100755 --- a/src/gitget/gitget +++ b/src/gitget/gitget @@ -87,7 +87,7 @@ download_git_checkout() { fi fi msg2 "Updating %s %s repo..." "${name}" "git" - if ! git pull origin "$ref"; then + if ! { git fetch --all -p && git checkout "$ref" && git pull origin "$ref"; } ; then # only warn on failure to allow offline builds warning "Failure while updating %s %s repo" "${repo}" "git" fi -- cgit v1.2.2