diff options
-rw-r--r-- | CHANGELOG.md | 18 | ||||
-rwxr-xr-x | contrib/cpt-manifest-tree | 2 | ||||
-rwxr-xr-x | contrib/cpt-reset | 26 | ||||
-rw-r--r-- | src/cpt-lib.in | 4 |
4 files changed, 35 insertions, 15 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 85f95c7..dda4498 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,7 +47,23 @@ this project _somewhat_ adheres to [Semantic Versioning]. ### Library - In order to get the `$deps` variable, one now has to use the new `pkg_depends_commit()` function. - + + +[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 -------------------------------------------------------------------------------- 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 85142af..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,15 +12,13 @@ ## 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" } -# shellcheck source=../src/cpt-lib . cpt-lib - base=$(pkg_get_base nonl) set -- @@ -29,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_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-lib.in b/src/cpt-lib.in index d0de978..cfa0b18 100644 --- a/src/cpt-lib.in +++ b/src/cpt-lib.in @@ -1116,7 +1116,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" @@ -1348,7 +1348,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") |