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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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 (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(+) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf 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(-) (limited to 'src/librefetch') 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.3-54-g00ecf