From f5663f08d44091ca16c7f53c492c2594202ba7e5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 16:52:57 -0500 Subject: update to the new devtools --- src/lib/common.sh.top | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/lib') diff --git a/src/lib/common.sh.top b/src/lib/common.sh.top index 054301b..625ea05 100644 --- a/src/lib/common.sh.top +++ b/src/lib/common.sh.top @@ -13,6 +13,8 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. +shopt -s extglob + if [[ -z ${_INCLUDE_COMMON_SH:-} ]]; then _INCLUDE_COMMON_SH=true -- cgit v1.2.2 From 56384e572d419a48439a90b9481a715a13a109c8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 17:09:11 -0500 Subject: src/lib/: set TEXTDOMAIN differently for internal messages This allows us to fix the long-standing bug that libremessages forces TEXTDOMAIN=libretools --- src/lib/Makefile | 8 +++++++- src/lib/common.sh.top | 8 ++++++-- src/lib/conf.sh | 4 ++-- src/lib/libreblacklist | 8 +++++--- src/lib/librelib | 29 +++++++++++++++++++++-------- src/lib/libremessages | 2 +- src/lib/libremessages.1.ronn | 6 ------ 7 files changed, 42 insertions(+), 23 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Makefile b/src/lib/Makefile index 4f24ad3..4ed5e4f 100644 --- a/src/lib/Makefile +++ b/src/lib/Makefile @@ -14,7 +14,13 @@ common.sh: %: %.in %.top Makefile @{ \ cat '$*.top' && \ echo && \ - sed -r -e '/encoding problem/d;/LANG=/d' -e 's/mesg=\$$(.)/mesg="$$(_ "$$\1")"/' '$*.in' && \ + sed -r \ + -e '/encoding problem/d;/LANG=/d' \ + -e 's/mesg=\$$(.)/mesg="$$(_ "$$\1")"/' \ + -e 's/gettext /_l _ /g' \ + -e "s/^(\s+)(msg|error) '/\1_l \2 '/" \ + -e 's|lock\(\)\s*\{|lock()\n{|' \ + '$*.in' && \ echo && \ cat '$*.bottom' && \ :; } > '$@' diff --git a/src/lib/common.sh.top b/src/lib/common.sh.top index 625ea05..9c4ba2e 100644 --- a/src/lib/common.sh.top +++ b/src/lib/common.sh.top @@ -18,11 +18,15 @@ shopt -s extglob if [[ -z ${_INCLUDE_COMMON_SH:-} ]]; then _INCLUDE_COMMON_SH=true -export TEXTDOMAIN='libretools' -export TEXTDOMAINDIR='/usr/share/locale' +[[ -n ${TEXTDOMAIN:-} ]] || export TEXTDOMAIN='libretools' +[[ -n ${TEXTDOMAINDIR:-} ]] || export TEXTDOMAINDIR='/usr/share/locale' if type gettext &>/dev/null; then _() { gettext "$@"; } else _() { echo "$@"; } fi + +_l() { + TEXTDOMAIN='librelib' TEXTDOMAINDIR='/usr/share/locale' "$@" +} diff --git a/src/lib/conf.sh b/src/lib/conf.sh index 0a6fb89..4445bef 100644 --- a/src/lib/conf.sh +++ b/src/lib/conf.sh @@ -122,10 +122,10 @@ check_vars() { if [[ -z ${!VAR:-} ]]; then type print &>/dev/null || . libremessages if [[ $(list_files $slug|wc -l) -gt 1 ]]; then - print "Configure '%s' in one of:" "$VAR" + _l print "Configure '%s' in one of:" "$VAR" list_files $slug | sed 's/./ -> &/' else - print "Configure '%s' in '%s'" "$VAR" "$(list_files $slug)" + _l print "Configure '%s' in '%s'" "$VAR" "$(list_files $slug)" fi ret=1 fi diff --git a/src/lib/libreblacklist b/src/lib/libreblacklist index 5db1a3f..267d32d 100755 --- a/src/lib/libreblacklist +++ b/src/lib/libreblacklist @@ -48,7 +48,7 @@ blacklist-update() ( local remote_blacklist="$BLACKLIST" local local_blacklist="$XDG_CACHE_HOME/libretools/blacklist.txt" - stat_busy "Downloading blacklist of proprietary software packages" + _l stat_busy "Downloading blacklist of proprietary software packages" mkdir -p "${local_blacklist%/*}" if wget -N -q -O "${local_blacklist}.part" "$remote_blacklist" 2>/dev/null; then @@ -58,9 +58,9 @@ blacklist-update() ( stat_done rm "${local_blacklist}.part" if [[ -e "$local_blacklist" ]]; then - warning "Using local copy of blacklist" + _l warning "Using local copy of blacklist" else - error "Download failed, exiting" + _l error "Download failed, exiting" return 1 fi @@ -109,6 +109,8 @@ if [[ "${0##*/}" == libreblacklist ]]; then sed 's/\r/\n/g'<<<"$1"|sed -e '/^$/d' -e 's/^# //' } usage() { + export TEXTDOMAIN='librelib' + export TEXTDOMAINDIR='/usr/share/locale' . $(librelib messages) if [[ $# -eq 0 ]]; then print "Usage: %s [-h] COMMAND [ARGUMENTS]" "${0##*/}" diff --git a/src/lib/librelib b/src/lib/librelib index a58f5d3..3b05e37 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -16,18 +16,31 @@ default_libdir=/usr/lib/libretools -if ! type gettext &>/dev/null; then - gettext() { echo "$@"; } +if type gettext &>/dev/null; then + _() { gettext "$@"; } +else + _() { echo "$@"; } fi +_l() { + TEXTDOMAIN='librelib' TEXTDOMAINDIR='/usr/share/locale' "$@" +} + print() { - mesg=$1 + local mesg="$(_ "$1")" shift - printf -- "$(gettext "$mesg")\n" "$@" + printf -- "$mesg\n" "$@" +} + +_html_whitespace_collapse() { + [[ $# == 0 ]] || panic + tr '\n' ' ' | sed -r -e 's/\t/ /g' -e 's/ +/ /g' } prose() { - print "$@" | fmt -su + [[ $# -ge 1 ]] || panic + local mesg="$(_ "$(_html_whitespace_collapse <<<"$1")")"; shift + printf -- "$mesg" "$@" | fmt -u } cmd=${0##*/} @@ -54,11 +67,11 @@ usage() { main() { if [[ $# != 1 ]]; then - usage >&2 + _l usage >&2 return 2 fi if [[ $1 == '-h' ]]; then - usage + _l usage return 0; fi @@ -76,7 +89,7 @@ main() { return 0; fi done - print '%s: could not find library: %s' "$cmd" "$lib" >> /dev/stderr + _l print '%s: could not find library: %s' "$cmd" "$lib" >> /dev/stderr return 1 } diff --git a/src/lib/libremessages b/src/lib/libremessages index c6d08e2..8766578 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -36,7 +36,7 @@ ################################################################################ panic() { - echo "$(_ 'panic: malformed call to internal function')" >&2 + echo "$(_l _ 'panic: malformed call to internal function')" >&2 exit 1 } diff --git a/src/lib/libremessages.1.ronn b/src/lib/libremessages.1.ronn index b91a958..30314c8 100644 --- a/src/lib/libremessages.1.ronn +++ b/src/lib/libremessages.1.ronn @@ -188,12 +188,6 @@ These routines relate to `makepkg`(8). ## BUGS -libremessages sets to `libretools` unconditionally, -making it generally unsuitable for use outside of libretools. If you -override after loading the library, that should work, but -you will also have to provide translations for libremessage's internal -messages (such as "ERROR" or "Warning"). - Generating `.pot` files for the prose functions is a pain. The libretools Makefiles have rules to do it, but it might make sense to pull it into a separate program. -- cgit v1.2.2 From b07f84783a9b3e4e799e93173977882de6c16fa8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Jan 2014 17:09:30 -0500 Subject: src/lib/: misc touch-up --- src/lib/conf.sh | 4 ++-- src/lib/libremessages | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/conf.sh b/src/lib/conf.sh index 4445bef..6b1ab49 100644 --- a/src/lib/conf.sh +++ b/src/lib/conf.sh @@ -112,7 +112,7 @@ load_files() { # Check whether the variables listed are properly set. # If not, it prints a message saying to set them in the configuration file(s) # for $slug. -check_vars() { +check_vars() ( local slug=$1; shift local ret=0 @@ -134,7 +134,7 @@ check_vars() { if [[ $ret != 0 ]]; then return 1 fi -} +) # Usage: get_var # Does not work with arrays diff --git a/src/lib/libremessages b/src/lib/libremessages index 8766578..8e48c3b 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -88,8 +88,6 @@ bullet() { # bullet. flag() { [[ $# == 2 ]] || panic - local n=' -' local flag=$1 local desc="$(_ "$(_html_whitespace_collapse <<<"$2")")" @@ -99,7 +97,7 @@ flag() { done local lines - IFS=$n lines=($(fmt -u -w $((73-indent)) <<<"$desc")) + IFS=$'\n' lines=($(fmt -u -w $((73-indent)) <<<"$desc")) local line for line in "${lines[@]}"; do printf " %-${indent}s %s\n" "$flag" "$line" -- cgit v1.2.2 From ca879723bef3b0f638a2e6262f1fc869cf2b14be Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 18 Jan 2014 12:47:01 -0500 Subject: Update libremessages.1.ronn --- src/lib/libremessages.1.ronn | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/libremessages.1.ronn b/src/lib/libremessages.1.ronn index 30314c8..bf052bd 100644 --- a/src/lib/libremessages.1.ronn +++ b/src/lib/libremessages.1.ronn @@ -104,7 +104,7 @@ For each of these, is fed through `gettext` automatically. These routines print to standard error, and all take arguments in the same format as `printf`(1), except for `stat_done`, which doesn't take -any arguments. +any arguments. Each of these print to stderr, not stdout. For each of these, is fed through `gettext` automatically. @@ -178,6 +178,13 @@ these, you could end up deleting a lot of someone's work. These routines relate to `makepkg`(8). + * `find_cached_package` [-: + Searches for a localy built copy of the specified package, in + and the current working directory. If is not + specified, any value will match. If multiple matching files are + found (not counting duplicate links), then an error is printed to + stderr and nothing is prented to stdout. + * `get_full_version` []: Inspects variables that are set, and prints the full version spec, including if necessary, , and . By -- cgit v1.2.2 From 63362d52d3943f40fb96898a2b4e87e17f0adcf4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Jan 2014 00:43:09 -0500 Subject: libremessages: add a setup_traps routine --- src/lib/libremessages | 19 +++++++++++++++++++ src/lib/libremessages.1.ronn | 4 ++++ 2 files changed, 23 insertions(+) (limited to 'src/lib') diff --git a/src/lib/libremessages b/src/lib/libremessages index 8e48c3b..df0a98a 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -117,6 +117,25 @@ term_title() { printf "$fmt" "$*" } +# Usage: setup_traps +# Sets up traps on TERM, HUP, QUIT and INT signals, as well as the ERR event, +# similar to makepkg +setup_traps() { + _libremessages_trap_exit() { + local signal=$1; shift + echo + error "$@" + trap -- "$signal" + kill "-$signal" "$$" + } + set -E + for signal in TERM HUP QUIT; do + trap "_libremessages_trap_exit $signal '%s signal caught. Exiting...' $signal" $signal + done + trap '_libremessages_trap_exit INT "Aborted by user! Exiting..."' INT + trap '_libremessages_trap_exit USR1 "An unknown error has occurred. Exiting..."' ERR +} + ################################################################################ # Run one of the defined functions if invoked directly # ################################################################################ diff --git a/src/lib/libremessages.1.ronn b/src/lib/libremessages.1.ronn index bf052bd..d4c35fc 100644 --- a/src/lib/libremessages.1.ronn +++ b/src/lib/libremessages.1.ronn @@ -69,6 +69,10 @@ Unless otherwise noted, these do not implicitly call `gettext`. Joins all arguments with whitespace, and sets the terminal title to that. + * `setup_traps`: + Sets traps on TERM, HUP, QUIT and INT signals, as sell as the ERR + event, similar to makepkg. + ### PROSE ROUTINES These routines print to standard output, ande are useful for printing -- cgit v1.2.2 From 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/lib/libreblacklist | 2 +- src/lib/librelib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib') 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 } -- cgit v1.2.2 From ea11eca851e1b54e36d310f4d69e099f169191e8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 00:05:22 -0500 Subject: I forgot to bump the copyright year on all the files I've touched this year --- src/lib/conf.sh | 2 +- src/lib/libreblacklist | 2 +- src/lib/librelib | 2 +- src/lib/libremessages | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib') 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 -- cgit v1.2.2 From c43f0808583070a22e904cd650e8ed17fe781806 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 00:20:19 -0500 Subject: Normalize to use the string "Copyright (C)" --- src/lib/conf.sh | 2 +- src/lib/libreblacklist | 2 +- src/lib/librelib | 2 +- src/lib/libremessages | 18 +++++++++--------- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/lib') 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 -- cgit v1.2.2 From e3108aeb1e38e9d6b243015344c6b4d856221fb4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 2 Feb 2014 04:16:17 -0500 Subject: src/lib/Makefile: fix extra files from being included in libexecs --- src/lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/Makefile b/src/lib/Makefile index 4ed5e4f..495abb1 100644 --- a/src/lib/Makefile +++ b/src/lib/Makefile @@ -1,5 +1,5 @@ copy_files = common.sh.in -libexecs = $(filter-out librelib,$(wildcard libre*)) +libexecs = $(filter-out librelib,$(progs)) # include common.sh in libs explicitly, because it might not exist yet # when the wildcard is performed libs = $(sort $(wildcard *.sh) common.sh) -- cgit v1.2.2 From 74f68d0149f2a94780c860b0775d1e880dbe9225 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Mar 2014 10:57:57 -0500 Subject: teach libremessages:setup_traps to be able to use a custom signal handler --- src/lib/libremessages | 31 ++++++++++++++++++++++--------- src/lib/libremessages.1.ronn | 9 +++++++-- 2 files changed, 29 insertions(+), 11 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libremessages b/src/lib/libremessages index e5b7157..162c8fb 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -117,17 +117,30 @@ term_title() { printf "$fmt" "$*" } -# Usage: setup_traps +# Usage: setup_traps [handler] # Sets up traps on TERM, HUP, QUIT and INT signals, as well as the ERR event, -# similar to makepkg +# similar to makepkg. +# +# If `handler` is specified, instead of using the default handler +# (which is good for most purposes), it will call the command handler +# with the arguments: +# +# ${handler} SIGNAL_NAME MESSAGE_FMT [MESSAGE_PARAMS...] +# +# where MESSAGE_* are printf-like stuff. setup_traps() { - _libremessages_trap_exit() { - local signal=$1; shift - echo - error "$@" - trap -- "$signal" - kill "-$signal" "$$" - } + [[ $# -le 1 ]] || panic + if [[ $# == 1 ]]; then + eval "_libremessages_trap_exit() { $1 \"\$@\"; }" + else + _libremessages_trap_exit() { + local signal=$1; shift + echo + error "$@" + trap -- "$signal" + kill "-$signal" "$$" + } + fi set -E for signal in TERM HUP QUIT; do trap "_libremessages_trap_exit $signal '%s signal caught. Exiting...' $signal" $signal diff --git a/src/lib/libremessages.1.ronn b/src/lib/libremessages.1.ronn index d4c35fc..d39dad0 100644 --- a/src/lib/libremessages.1.ronn +++ b/src/lib/libremessages.1.ronn @@ -69,9 +69,14 @@ Unless otherwise noted, these do not implicitly call `gettext`. Joins all arguments with whitespace, and sets the terminal title to that. - * `setup_traps`: + * `setup_traps` []: Sets traps on TERM, HUP, QUIT and INT signals, as sell as the ERR - event, similar to makepkg. + event, similar to makepkg. If is specified, instead of + using the default handler (which is good for most purposes), it + will call with the arguments + ` [...]`, where + is a `printf`(1)-formatted string, and + are its arguments. ### PROSE ROUTINES -- cgit v1.2.2 From 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/lib/common.sh.top | 9 +-------- src/lib/conf.sh | 4 +++- src/lib/libreblacklist | 4 +++- src/lib/librelib | 4 +++- src/lib/libremessages | 43 +++++++++++++++++++++++++------------------ 5 files changed, 35 insertions(+), 29 deletions(-) (limited to 'src/lib') 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 # -- cgit v1.2.2 From c48ac8c89e596e160505bd5678db2b193607493f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 22 Mar 2014 22:00:44 -0400 Subject: Audit the authors and copyright years of files against git logs --- src/lib/libremessages | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lib') diff --git a/src/lib/libremessages b/src/lib/libremessages index 71f1636..cb3d883 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -3,6 +3,7 @@ # When run directly, it does `set -euE` # Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) +# Copyright (C) 2012 Nicolás Reynolds # Copyright (C) 2012-2014 Luke Shumaker # For just the setup_traps() function: -- cgit v1.2.2 From cb2a663ff60eacf14f38fa4a67aabe35600c0ecb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 22 Mar 2014 22:13:04 -0400 Subject: Relicense some files from GPLv3+ GPLv2+ (that I'm the sole copyright holder of) --- src/lib/conf.sh | 4 ++-- src/lib/libreblacklist | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/conf.sh b/src/lib/conf.sh index 3e07c11..2730b57 100644 --- a/src/lib/conf.sh +++ b/src/lib/conf.sh @@ -3,11 +3,11 @@ # Copyright (C) 2012-2014 Luke Shumaker # -# License: GNU GPLv3+ +# License: GNU GPLv2+ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, diff --git a/src/lib/libreblacklist b/src/lib/libreblacklist index fdd27f9..8aa33cc 100755 --- a/src/lib/libreblacklist +++ b/src/lib/libreblacklist @@ -4,11 +4,11 @@ # Copyright (C) 2013-2014 Luke Shumaker # -# License: GNU GPLv3+ +# License: GNU GPLv2+ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, -- cgit v1.2.2 From 222856031fbbf314e8e47db414225756a9c6fba2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 23 Mar 2014 18:09:13 -0400 Subject: Most of my desired re-licensings were authorized on the dev list --- src/lib/libremessages | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libremessages b/src/lib/libremessages index cb3d883..b89e2bc 100755 --- a/src/lib/libremessages +++ b/src/lib/libremessages @@ -15,11 +15,11 @@ # Copyright (C) 2006 Andras Voroskoi # Copyright (C) 2006 Miklos Vajna # -# License: GNU GPLv3+ +# License: GNU GPLv2+ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, @@ -30,9 +30,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# setup_traps() is based on pacman:makepkg, which is GPLv2+, -# so we take the '+' to combine it with our GPLv3+. - ################################################################################ # Inherit most functions from devtools # ################################################################################ -- cgit v1.2.2 From 9f1ef0bbdf1bc246c0c035a2dd6a4bcfa41664ef Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 11 May 2014 23:31:58 -0400 Subject: update the libremessages man page with changes from devtools --- src/lib/libremessages.1.ronn | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libremessages.1.ronn b/src/lib/libremessages.1.ronn index d39dad0..2bf73a1 100644 --- a/src/lib/libremessages.1.ronn +++ b/src/lib/libremessages.1.ronn @@ -156,15 +156,16 @@ these, you could end up deleting a lot of someone's work. * `cleanup` []: *If* `setup_workdir` has been run, `rm -rf "$WORKDIR"`. If given - a numeric argument, it will then call `exit`(1) with that argument. + a numeric argument, it will then call `exit`(1) with that + argument, otherwise it calls `exit`(1) with a status of 0. * `abort`: Calls `msg` with the message "Aborting...", then calls - `cleanup 0`. + `cleanup 255`. * `die` [...]: Exactly like `error`, but calls `cleanup` and calls `exit`(1) - with a status of 1. + with a status of 255. ### LOCKFILE ROUTINES @@ -212,9 +213,6 @@ pull it into a separate program. xterm and rxvt (and their various values; "rxvt-unicode-256color" is still rxvt). -Also, I think `abort` calling `cleanup 1` would make more sense than -`cleanup 0`. - ## SEE ALSO librelib(7), gettext(1), common.sh(3) -- cgit v1.2.2