diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/abslibre-tools/diff-unfree | 16 | ||||
-rwxr-xr-x | src/abslibre-tools/libreaddiff | 3 | ||||
-rwxr-xr-x | src/abslibre-tools/libredbdiff | 4 | ||||
-rwxr-xr-x | src/aur | 8 | ||||
-rw-r--r-- | src/chroot-tools/chcleanup.in | 2 | ||||
-rwxr-xr-x | src/chroot-tools/librechroot | 2 | ||||
-rwxr-xr-x | src/dagpkg | 11 | ||||
-rw-r--r-- | src/lib/conf.sh.in | 14 | ||||
-rwxr-xr-x | src/pkgbuild-check-nonfree | 12 | ||||
-rwxr-xr-x | src/repo-diff | 3 | ||||
-rwxr-xr-x | src/toru/toru-info | 3 |
11 files changed, 42 insertions, 36 deletions
diff --git a/src/abslibre-tools/diff-unfree b/src/abslibre-tools/diff-unfree index 15fd197..3670f7f 100755 --- a/src/abslibre-tools/diff-unfree +++ b/src/abslibre-tools/diff-unfree @@ -4,6 +4,7 @@ # Copyright (C) 2010-2011 Nicolás Reynolds <fauno@parabola.nu> # Copyright (C) 2011 Joshua Ismael Haase Hernández (xihh) <hahj87@gmail.com> +# Copyright (C) 2017 Luke Shumaker <lukeshu@sbcglobal.net> # # License: GNU GPLv3+ # @@ -41,8 +42,9 @@ main() { exit 0 fi + local package_guess=${PWD##*/} - local repo=${1:-$(basename ${PWD%/*})} + local repo=${1:-$(basename "${PWD%/*}")} local package=${2:-${package_guess%-libre}} local trunk=${3:-trunk} @@ -59,7 +61,7 @@ main() { fi - tmp_dir="$(mktemp --tmpdir -d ${package}.XXXXXX)" + tmp_dir="$(mktemp --tmpdir -d "${package}.XXXXXX")" if [[ ! -d "${tmp_dir}" ]]; then error "Can't create temp dir" exit 1 @@ -70,19 +72,19 @@ main() { msg "Getting diff from %s..." "$repo/$package" - svn checkout --depth=empty svn://svn.archlinux.org/$svnrepo &>/dev/null + svn checkout --depth=empty "svn://svn.archlinux.org/$svnrepo" &>/dev/null - cd ${svnrepo} - svn update ${package} + cd "${svnrepo}" + svn update "${package}" # Back to start dir popd &>/dev/null msg "Diffing files" - for _file in ${unfree_dir}/*; do + for _file in "${unfree_dir}"/*; do msg2 "%s" "$(basename "${_file}")" - ${DIFFPROG} "$PWD/$(basename "${_file}")" "${_file}" + "${DIFFPROG}" "$PWD/$(basename "${_file}")" "${_file}" done } diff --git a/src/abslibre-tools/libreaddiff b/src/abslibre-tools/libreaddiff index afd1c98..17e808b 100755 --- a/src/abslibre-tools/libreaddiff +++ b/src/abslibre-tools/libreaddiff @@ -3,6 +3,7 @@ # Copyright (C) 2011-2012 Michał Masłowski <mtjm@mtjm.eu> # Copyright (C) 2012 Daniel Molina (lluvia) +# Copyright (C) 2017 Luke Shumaker <lukeshu@sbcglobal.net> # # License: GNU GPLv3+ # @@ -61,7 +62,7 @@ try: line = next(it) if line == "%ARCH%\n": arch = next(it) - if arch == "'"$arch"'\n" or "'$repo'" not in '"$archrepos"': + if arch == "'"$arch"'\n" or "'"$repo"'" not in '"$archrepos"': print("%s-%s" % (name.strip(), version.strip())) if line == "%NAME%\n": name = next(it) diff --git a/src/abslibre-tools/libredbdiff b/src/abslibre-tools/libredbdiff index 54b386e..24d285e 100755 --- a/src/abslibre-tools/libredbdiff +++ b/src/abslibre-tools/libredbdiff @@ -2,7 +2,7 @@ name="Libredbdiff" # Copyright (C) 2014 Esteban Carnevale <alfplayer@mailoo.org> -# Copyright (C) 2014 Luke Shumaker <lukeshu@sbcglobal.net> +# Copyright (C) 2014, 2017 Luke Shumaker <lukeshu@sbcglobal.net> # # License: GNU GPLv3+ # @@ -160,7 +160,7 @@ initialize() { repo_test() { for repo in ${repos} ; do - if [[ $repo == $1 ]] ; then + if [[ $repo == "$1" ]] ; then found=1 return 0 fi @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Copyright (C) 2010-2011 Joshua Ismael Haase Hernández (xihh) <hahj87@gmail.com> # Copyright (C) 2010-2012 Nicolás Reynolds <fauno@parabola.nu> -# Copyright (C) 2012-2014 Luke Shumaker <lukeshu@sbcglobal.net> +# Copyright (C) 2012-2014, 2017 Luke Shumaker <lukeshu@sbcglobal.net> # # License: GNU GPLv3+ # @@ -66,7 +66,7 @@ main() { # Store our copy of the PKGBUILD dir copy_old=$copy_new - copy_new="$(mktemp --tmpdir -d aur-${pkg}.new.XXXX)/$pkg" + copy_new="$(mktemp --tmpdir -d "aur-${pkg}.new.XXXX")/$pkg" cd "${copy_new%/*}" fi @@ -123,10 +123,10 @@ main() { msg2 "Checking dependencies" for _dep in "${_deps[@]}"; do _dep=${_dep/[<>=]*/} - if ! is_built $_dep; then + if ! is_built "$_dep"; then if ! pacman -Sddp "$_dep" &>/dev/null ; then plain "%s: will be downloaded from AUR" "$_dep" - missing_deps+=($_dep) + missing_deps+=("$_dep") fi else plain "%s: is on repos" "$_dep" diff --git a/src/chroot-tools/chcleanup.in b/src/chroot-tools/chcleanup.in index d6f2156..a7d2fb4 100644 --- a/src/chroot-tools/chcleanup.in +++ b/src/chroot-tools/chcleanup.in @@ -68,7 +68,7 @@ msg "Cleaning chroot..." cp /repo/repo.db /var/lib/pacman/sync/repo.db # Setup the temporary directory -TEMPDIR="$(mktemp --tmpdir -d ${0##*/}.XXXXXXXXXX)" +TEMPDIR="$(mktemp --tmpdir -d "${0##*/}.XXXXXXXXXX")" trap "rm -rf -- $(printf '%q' "$TEMPDIR")" EXIT cp -a /var/lib/pacman/sync "${TEMPDIR}/" diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index fb0490e..a1e01d0 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -66,7 +66,7 @@ hack_arch_nspawn_flags() { # Detect the architecture of the chroot local CARCH if [[ -f "$makepkg_conf" ]]; then - eval $(grep '^CARCH=' "$makepkg_conf") + eval "$(grep '^CARCH=' "$makepkg_conf")" else CARCH="$(uname -m)" fi @@ -5,6 +5,7 @@ # Copyright (C) 2014 Nicolás Reynolds <fauno@parabola.nu> # Copyright (C) 2014 Michał Masłowski <mtjm@mtjm.eu> +# Copyright (C) 2017 Luke Shumaker <lukeshu@sbcglobal.net> # # License: GNU GPLv3+ # @@ -112,20 +113,20 @@ visit_pkgbuild() { # Detect cycle or already visited package case "${marks[$name]:-0}" in - 1) msg2 "cycle found with %s depending on %s" $prev $name + 1) msg2 "cycle found with %s depending on %s" "$prev" "$name" exit 1;; 2) return;; esac - msg "%s (%s)" ${name} ${prev} + msg "%s (%s)" "${name}" "${prev}" if ! in_array "${CARCH}" "${arch[@]}"; then - warning "%s isn't ported to %s yet" ${name} ${CARCH} + warning "%s isn't ported to %s yet" "${name}" "${CARCH}" fi # If the envvar I contains this package, ignore it and exit if in_array "$name" $I; then - msg2 "%s ignored" ${name} + msg2 "%s ignored" "${name}" return fi @@ -145,7 +146,7 @@ visit_pkgbuild() { test -z "$w" && continue # Go to this dir - pushd $w &>/dev/null + pushd "$w" &>/dev/null visit_pkgbuild "$name" diff --git a/src/lib/conf.sh.in b/src/lib/conf.sh.in index 0b2275a..63d5cf9 100644 --- a/src/lib/conf.sh.in +++ b/src/lib/conf.sh.in @@ -1,7 +1,7 @@ #!/hint/bash # This may be included with or without `set -euE` -# Copyright (C) 2012-2015 Luke Shumaker <lukeshu@sbcglobal.net> +# Copyright (C) 2012-2015, 2017 Luke Shumaker <lukeshu@sbcglobal.net> # # License: GNU GPLv2+ # @@ -19,7 +19,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. LIBREUSER="${SUDO_USER:-$USER}" -if [[ $LIBREUSER == $USER ]]; then +if [[ $LIBREUSER == "$USER" ]]; then LIBREHOME=$HOME else eval "LIBREHOME=~$LIBREUSER" @@ -112,19 +112,19 @@ load_files() { local file # Save the existing versions at _VARNAME - for var in $(list_envvars $slug); do + for var in $(list_envvars "$slug"); do [[ -n ${!var:-} ]] && eval "_$var=\${$var}" done # Load the files - for file in $(list_files $slug); do + for file in $(list_files "$slug"); do if [[ -r $file ]]; then . "$file" || return 1 fi done # Restore the _SAVED versions - for var in $(list_envvars $slug); do + for var in $(list_envvars "$slug"); do eval "$var=\${_$var:-\${$var:-}}" done } @@ -141,9 +141,9 @@ check_vars() { local VAR for VAR in "$@"; do if [[ -z ${!VAR:-} ]]; then - if [[ $(list_files $slug|wc -l) -gt 1 ]]; then + if [[ $(list_files "$slug"|wc -l) -gt 1 ]]; then libremessages _l print "Configure '%s' in one of:" "$VAR" - list_files $slug | sed 's/./ -> &/' + list_files "$slug" | sed 's/./ -> &/' else libremessages _l print "Configure '%s' in '%s'" "$VAR" "$(list_files "$slug")" fi diff --git a/src/pkgbuild-check-nonfree b/src/pkgbuild-check-nonfree index 67f07bc..d5495c7 100755 --- a/src/pkgbuild-check-nonfree +++ b/src/pkgbuild-check-nonfree @@ -5,7 +5,7 @@ # Copyright (C) 2011 Joseph Graham (Xylon) <joe@t67.eu> # Copyright (C) 2010-2011 Joshua Ismael Haase Hernández (xihh) <hahj87@gmail.com> # Copyright (C) 2010-2012 Nicolás Reynolds <fauno@parabola.nu> -# Copyright (C) 2012-2013 Luke Shumaker <lukeshu@sbcglobal.net> +# Copyright (C) 2012-2013, 2017 Luke Shumaker <lukeshu@sbcglobal.net> # # License: GNU GPLv3+ # @@ -129,7 +129,7 @@ pkgbuild_get_pkg_str() { local var=$2 local indirect=${!var} - eval $(declare -f package_$pkg | sed -rn "s/^\s*${var}(\+?=)/indirect\1/p") + eval "$(declare -f "package_$pkg" | sed -rn "s/^\s*${var}(\+?=)/indirect\1/p")" printf '%s' "${indirect}" } # Usage: eval $(pkgbuild_get_pkg_ary ${pkgname} ${varname} [$variable_name_to_set]) @@ -142,7 +142,7 @@ pkgbuild_get_pkg_ary() { local ary="${var}[@]" local indirect=("${!ary}") - eval $(declare -f package_$pkg | sed -rn "s/^\s*${var}(\+?=)/indirect\1/p") + eval "$(declare -f "package_$pkg" | sed -rn "s/^\s*${var}(\+?=)/indirect\1/p")" declare -p indirect|sed "s/ indirect=/ ${out}=/" } @@ -277,9 +277,9 @@ pkgbuild_check() ( local _pkgname _license _depends _optdepends for _pkgname in "${pkgname[@]}"; do msg2 'Inspecting split package pkgname=%q (%s)' "$_pkgname" "$(get_full_version "$_pkgname")" - eval $(pkgbuild_get_pkg_ary "$_pkgname" license _license) - eval $(pkgbuild_get_pkg_ary "$_pkgname" depends _depends) - eval $(pkgbuild_get_pkg_ary "$_pkgname" optdepends _optdepends) + eval "$(pkgbuild_get_pkg_ary "$_pkgname" license _license)" + eval "$(pkgbuild_get_pkg_ary "$_pkgname" depends _depends)" + eval "$(pkgbuild_get_pkg_ary "$_pkgname" optdepends _optdepends)" # Check if this is blacklisted check_pkg "$_pkgname" || ret=$(($ret|$?)) diff --git a/src/repo-diff b/src/repo-diff index c875dce..10b617c 100755 --- a/src/repo-diff +++ b/src/repo-diff @@ -2,6 +2,7 @@ # Shows a diff between repo databases # Copyright (C) 2013 Nicolás Reynolds <fauno@parabola.nu> +# Copyright (C) 2017 Luke Shumaker <lukeshu@sbcglobal.net> # # License: GNU GPLv3+ # @@ -34,7 +35,7 @@ if test $# -eq 0; then exit 0 fi -b() { bsdtar ztf $1 | cut -d "/" -f1 | sort -u ; } +b() { bsdtar ztf "$1" | cut -d "/" -f1 | sort -u ; } n() { echo "$1".db | tr "/" "-"; } # hopefully simple way to convert diff --git a/src/toru/toru-info b/src/toru/toru-info index 9bb80d3..31015e4 100755 --- a/src/toru/toru-info +++ b/src/toru/toru-info @@ -2,6 +2,7 @@ # Prints info about a given pkgname # Copyright (C) 2012 Nicolás Reynolds <fauno@parabola.nu> +# Copyright (C) 2017 Luke Shumaker <lukeshu@sbcglobal.net> # # License: GNU GPLv3+ # @@ -22,7 +23,7 @@ . "$(librelib conf)" for _pkg in "$@"; do - _pkgbuild="$(toru-where $_pkg)" + _pkgbuild="$(toru-where "$_pkg")" if [ -f "$_pkgbuild/PKGBUILD" ]; then if ! load_PKGBUILD "$_pkgbuild/PKGBUILD" 2>/dev/null; then |