diff options
author | Dave Reisner <dreisner@archlinux.org> | 2016-03-20 16:43:22 -0400 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2016-03-20 16:43:22 -0400 |
commit | b91a953f5f67a296b638f2a1a827dab65a57c881 (patch) | |
tree | c1ffc47e7fc6e915446fc6415005693feba74451 | |
parent | ac4cfde7e64f5d753de86ccf1f2a3e2a9f110471 (diff) | |
download | asp32-b91a953f5f67a296b638f2a1a827dab65a57c881.tar.xz |
fix some things highlighted by shellcheck
-rw-r--r-- | asp.in | 6 | ||||
-rw-r--r-- | package.inc.sh | 15 | ||||
-rw-r--r-- | remote.inc.sh | 4 |
3 files changed, 11 insertions, 14 deletions
@@ -139,15 +139,15 @@ list_all() { } shortlog() { - package_log "$@" "$FUNCNAME" + package_log "$@" "${FUNCNAME[0]}" } log() { - package_log "$@" "$FUNCNAME" + package_log "$@" "${FUNCNAME[0]}" } difflog() { - package_log "$@" "$FUNCNAME" + package_log "$@" "${FUNCNAME[0]}" } gc() { diff --git a/package.inc.sh b/package.inc.sh index aeea3ae..14bede9 100644 --- a/package.inc.sh +++ b/package.inc.sh @@ -64,7 +64,7 @@ package_log() { } package_show_pkgbuild() { - local pkgname=$1 remote repo subtree blob_id + local pkgname=$1 remote repo subtree if [[ $pkgname = */* ]]; then IFS=/ read -r repo pkgname <<<"$pkgname" @@ -78,12 +78,11 @@ package_show_pkgbuild() { subtree=trunk fi - git show "remotes/$remote/packages/$pkgname":"$subtree"/PKGBUILD + git show "remotes/$remote/packages/$pkgname:$subtree"/PKGBUILD } package_export() { - local pkgname=$1 remote repo arch - local mode objtype objid path + local pkgname=$1 remote repo arch path if [[ $pkgname = */* ]]; then IFS=/ read -r repo pkgname <<<"$pkgname" @@ -134,8 +133,8 @@ package_get_repos_with_arch() { local pkgname=$1 remote=$2 local path arch repo - while read path; do - IFS=/- read _ repo arch <<<"$path" + while read -r path; do + IFS=/- read -r _ repo arch <<<"$path" printf '%s %s\n' "$repo" "$arch" done < <(git ls-tree --name-only "$remote/packages/$pkgname" repos/) } @@ -146,7 +145,7 @@ package_get_arches() { package_init "$pkgname" remote || return 1 - while read _ arch; do + while read -r _ arch; do arches["$arch"]=1 done < <(package_get_repos_with_arch "$pkgname" "$remote") @@ -159,7 +158,7 @@ package_get_repos() { package_init "$pkgname" remote || return 1 - while read repo _; do + while read -r repo _; do repos["$repo"]=1 done < <(package_get_repos_with_arch "$pkgname" "$remote") diff --git a/remote.inc.sh b/remote.inc.sh index 61204bf..826ab37 100644 --- a/remote.inc.sh +++ b/remote.inc.sh @@ -1,5 +1,3 @@ -declare -A refcache=() - __remote_refcache_update() { local remote=$1 cachefile=$ASPCACHE/remote-$remote @@ -11,7 +9,7 @@ __remote_refcache_update() { } __remote_refcache_get() { - local remote=$1 ttl=3600 now= cachetime= cachefile=$ASPCACHE/remote-$remote + local remote=$1 ttl=3600 now cachetime cachefile=$ASPCACHE/remote-$remote printf -v now '%(%s)T' -1 |