diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-09-01 12:53:02 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-09-01 12:53:02 +0000 |
commit | ec5152c9616a56d4efd870b882eebf5f3ff76957 (patch) | |
tree | a1ba84a057a2db32a75b6aba4466b5449a35a2d0 /kiss | |
parent | 34ccb80dda9a2ca0be40f1eddb16e3f2d8ed60bf (diff) | |
download | cpt-ec5152c9616a56d4efd870b882eebf5f3ff76957.tar.gz |
kiss: clean repo_dir variables used once
FossilOrigin-Name: 56bdec030aedead98ba863598d1de8b55389caac310122787abb76905105c2fe
Diffstat (limited to 'kiss')
-rwxr-xr-x | kiss | 28 |
1 files changed, 9 insertions, 19 deletions
@@ -248,10 +248,8 @@ pkg_strip() { # Strip package binaries and libraries. This saves space on the # system as well as on the tar-balls we ship for installation. - repo_dir=$(pkg_find "$1") - # Package has stripping disabled, stop here. - [ -f "$repo_dir/nostrip" ] && return + [ -f "$(pkg_find "$1")/nostrip" ] && return log "[$1] Stripping binaries and libraries" @@ -374,10 +372,8 @@ pkg_tar() { # This tar-ball also contains the package's database entry. log "[$1] Creating tar-ball" - repo_dir=$(pkg_find "$1") - # Read the version information to name the package. - read -r version release < "$repo_dir/version" + read -r version release < "$(pkg_find "$1")/version" # Create a tar-ball from the contents of the built package. tar zpcf "$bin_dir/$1#$version-$release.tar.gz" -C "$pkg_dir/$1" . || @@ -448,10 +444,8 @@ pkg_build() { ;; esac - repo_dir=$(pkg_find "$pkg") - # Figure out the version and release. - read -r version release < "$repo_dir/version" + read -r version release < "$(pkg_find "$pkg")/version" # Remove the current package from the package list. shift @@ -472,10 +466,8 @@ pkg_build() { for pkg; do pkg_lint "$pkg"; done for pkg; do - repo_dir=$(pkg_find "$pkg") - # Ensure that checksums exist prior to building the package. - [ -f "$repo_dir/checksums" ] || { + [ -f "$(pkg_find "$pkg")/checksums" ] || { log "[$pkg] Checksums are missing" # Instead of dying above, log it to the terminal. Also define a @@ -717,10 +709,8 @@ pkg_install() { tar_file=$pkg else - repo_dir=$(pkg_find "$pkg") - # Read the version information to name the package. - read -r version release < "$repo_dir/version" + read -r version release < "$(pkg_find "$pkg")/version" # Construct the name of the package tarball. tar_name=$pkg\#$version-$release.tar.gz @@ -891,17 +881,17 @@ pkg_updates() { set +f for pkg in "$KISS_ROOT/$pkg_db/"*; do - repo_dir=$(pkg_find "${pkg##*/}") + pkg_name=${pkg##*/} # Read version and release information from the installed packages # and repository. read -r db_ver db_rel < "$pkg/version" - read -r re_ver re_rel < "$repo_dir/version" + read -r re_ver re_rel < "$(pkg_find "$pkg_name")/version" # Compare installed packages to repository packages. [ "$db_ver-$db_rel" != "$re_ver-$re_rel" ] && { - printf '%s\n' "${pkg##*/} $db_ver-$db_rel ==> $re_ver-$re_rel" - outdated="$outdated${pkg##*/} " + printf '%s\n' "$pkg_name $db_ver-$db_rel ==> $re_ver-$re_rel" + outdated="$outdated $pkg_name " } done |