diff options
-rw-r--r-- | CHANGELOG.md | 24 | ||||
-rw-r--r-- | LICENSE | 2 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rwxr-xr-x | contrib/cpt-manifest-tree | 2 | ||||
-rwxr-xr-x | contrib/cpt-reset | 24 | ||||
-rwxr-xr-x | src/cpt-install | 4 | ||||
-rw-r--r-- | src/cpt-lib.in | 8 |
7 files changed, 48 insertions, 18 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 212b3e1..403c3be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,30 @@ this project _somewhat_ adheres to [Semantic Versioning]. [Semantic Versioning]: https://semver.org/spec/v2.0.0.html +[6.2.4] - 2022-02-07 +-------------------------------------------------------------------------------- + +### Fixed +- Fixed a bug in missing dependency where if the user had chosen 'ldd', it would + fail to fix dependencies due to a typo. + + +[6.2.3] - 2022-02-02 +-------------------------------------------------------------------------------- + +### Fixed +- Fixed a checksum verification bug where adding an extra source did not require + checksum verification. +- `cpt-manifest-tree` now modifies the output of `tree(1)` according to the new + version. +- `cpt-reset` is now much more verbose. +- Fixed the displayed messages on `cpt-install` when it is given a tarball as an + argument. +- Fixed a faulty implementation in `pkg_tar()` where it used `pkg_find()` + instead of using the built package's database directory for gathering + information. + + [6.2.2] - 2021-11-09 -------------------------------------------------------------------------------- @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020-2021 Cem Keylan +Copyright (c) 2020-2022 Cem Keylan Copyright (c) 2019-2020 Dylan Araps Permission is hereby granted, free of charge, to any person obtaining a copy @@ -1,6 +1,6 @@ #!/bin/sh -e -version=6.2.2 +version=6.2.4 die() { printf '%s: %s\n' "${0##*/}" "$*" >&2 diff --git a/contrib/cpt-manifest-tree b/contrib/cpt-manifest-tree index 599c0bd..bc38bc2 100755 --- a/contrib/cpt-manifest-tree +++ b/contrib/cpt-manifest-tree @@ -21,4 +21,4 @@ case "$1" in esac cpt-list "$1" >/dev/null printf '%s\n' "[$1]:" -tree -C --fromfile "$CPT_ROOT/var/db/cpt/installed/$1/manifest" | sed 1,2d +tree -C --fromfile "$CPT_ROOT/var/db/cpt/installed/$1/manifest" | sed 1d diff --git a/contrib/cpt-reset b/contrib/cpt-reset index 2a1b66e..a2336e3 100755 --- a/contrib/cpt-reset +++ b/contrib/cpt-reset @@ -3,6 +3,7 @@ # # Disable word-splittng warnings as they're safe here. # shellcheck disable=SC2046 +# shellcheck source=../src/cpt-lib ## SYNOPSIS: ## .Nm @@ -11,10 +12,10 @@ ## removes all packages from the system that is not defined as a base package in ## .Pa /etc/cpt-base . -[ "$1" ] && { - printf 'usage: %s\n\nRemove all packages not defined in the base.\n' \ - "${0##*/}" - exit 0 +parser_definition() { + setup REST help:usage -- "usage: ${0##*/}" + global_options compact + msg -- '' "Remove all packages outside of base definition" } . cpt-lib @@ -27,9 +28,14 @@ set +f; for pkg in *; do contains "$base" "$pkg" || set -- "$pkg" "$@" done -[ "$1" ] && { - printf 'WARNING: This will remove \033[1m%s\033[m package(s).\n' "$#" - printf 'Base packages can be redefined in %s\n' "$CPT_ROOT/etc/cpt-base" - printf 'Continue? [Enter/Ctrl+C]\n' - read -r _ && CPT_FORCE=1 cpt-remove "$@" +[ -z "$1" ] && { + log "No package outside of the base definition could be found, not continuing." + exit 0 } + +warn "" "This is a potentially harmful operation, do NOT continue unless" +warn "" "you know exactly what you are doing. Continuing will remove $#" +warn "" "packages that are not listed in the base definition or that the" +warn "" "base packages don't depend on. See the CPT BASE section on the" +warn "" "user manual to learn more." +prompt && cpt-remove "$@" diff --git a/src/cpt-install b/src/cpt-install index af8b7ff..78da9a8 100755 --- a/src/cpt-install +++ b/src/cpt-install @@ -36,8 +36,8 @@ for pkg in $order; do "$(_multiply_char '=' 60)" \ "$pkg" \ "$(_multiply_char '=' 60)" - cat "$sys_db/$pkg/message" >&2 + cat "$sys_db/$pkg/message" msg=1 } -done +done >&2 [ "$msg" ] || log "No message in queue" diff --git a/src/cpt-lib.in b/src/cpt-lib.in index 96471c0..3a57d00 100644 --- a/src/cpt-lib.in +++ b/src/cpt-lib.in @@ -972,7 +972,7 @@ pkg_fix_deps() { case ${elf_prog:-ldd} in *readelf) "$elf_prog" -d "$file" 2>/dev/null ;; - *) pirntf '%s\n' "$lddbuf" ;; + *) printf '%s\n' "$lddbuf" ;; esac | while read -r dep; do # Skip lines containing 'ldd'. @@ -1033,7 +1033,7 @@ pkg_manifest() ( # sed: Remove the first character in each line (./dir -> /dir) and # remove all lines which only contain '.'. find . -type d -exec printf '%s/\n' {} + -o -print | - sort -r | sed '/^\.$/d;/^\.\/$/d;ss.ss' > "${2:-$pkg_dir}/$1/$pkg_db/$1/manifest" + sort -r | sed '/^\.\/*$/d;ss.ss' > "${2:-$pkg_dir}/$1/$pkg_db/$1/manifest" ) pkg_etcsums() ( @@ -1063,7 +1063,7 @@ pkg_tar() { log "$1" "Creating tarball" # Read the version information to name the package. - read -r version release < "$(pkg_find "$1")/version" + read -r version release < "$pkg_dir/$1/$pkg_db/$1/version" # Create a tarball from the contents of the built package. cd "$pkg_dir/$1" @@ -1294,7 +1294,7 @@ pkg_checksums() { pkg_verify() { # Verify all package checksums. This is achieved by generating a new set of # checksums and then comparing those with the old set. - vcmd="NR==FNR{a[\$1];next}/^git .*/{next}!((\$1)in a){exit 1}" + vcmd="NR==FNR{a[\$1];next}/^git .*/{next}!((\$1)in a){exit 1}END{if(NR/2!=FNR)exit 1}" for pkg; do repo_dir=$(pkg_find "$pkg") |