From 6a942f462d754c2165150c4f3e31f4bacd0d77ab Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 20 Sep 2021 12:19:52 +0000 Subject: bump version to 6.2.1 FossilOrigin-Name: f1dceff1a2978f60882eb48829a0d34424744faaed4ad12dccc9eca42689ae89 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 2411f90..ac4a4c7 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #!/bin/sh -e -version=6.2.0 +version=6.2.1 die() { printf '%s: %s\n' "${0##*/}" "$*" >&2 -- cgit v1.2.3 From 6475eb9133b8519359fd77d596c5be979082f3c3 Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 8 Nov 2021 18:09:31 +0000 Subject: pkg_swap(): properly log alternative swap for files that no longer exist. FossilOrigin-Name: 64599979a94e6e9578c6fe651ad18a8f41e9d1da768c966d16e55922783dc688 --- src/cpt-lib.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cpt-lib.in b/src/cpt-lib.in index 58c9a0f..41b0a14 100644 --- a/src/cpt-lib.in +++ b/src/cpt-lib.in @@ -1465,6 +1465,13 @@ pkg_swap() { sed "s#^$(regesc "$2")\$#${PWD#$CPT_ROOT}/$pkg_owns>${alt#*>}#" \ "../installed/$pkg_owns/manifest" | sort -r -o "../installed/$pkg_owns/manifest" + else + # If the file doesn't exist, we assume that there was a previous owner, + # but the package was then removed. We want the message to be short + # and clear, I thought of writing "Swapping [...] from 'null' to '$1'", + # but that would probably sound more like a package manager bug. Instead + # we are printing the message below which should be informative enough. + log "Installing '$2' from '$1'" fi # Convert the desired alternative to a real file and rewrite -- cgit v1.2.3 From 36ec0ea4176c680a84bfac9284dc0fd207078563 Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 8 Nov 2021 18:16:20 +0000 Subject: cpt-lib: fix shellcheck errors FossilOrigin-Name: 9cf7ecf5739797be76b834a1f1e054e35b9cbcef419269799a0945159204081b --- src/cpt-lib.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cpt-lib.in b/src/cpt-lib.in index 41b0a14..96471c0 100644 --- a/src/cpt-lib.in +++ b/src/cpt-lib.in @@ -100,7 +100,7 @@ sepchar() ( str_tmp=${str_tmp%?} done set -- "$@" "$str_tmp" - str=${str#$str_tmp} + str=${str#"$str_tmp"} done printf '%s\n' "$@" ) @@ -801,7 +801,7 @@ pkg_extract() { # VCS Repository git+*|hg+*|fossil+*) backend=${src%%+*} - url=${src##${backend}+} com=${url##*[@#]} com=${com#${url%[@#]*}} + url=${src##"${backend}"+} com=${url##*[@#]} com=${com#"${url%[@#]*}"} log "$1" "Cloning ${url%[#@]*}" "pkg_vcs_clone_$backend" "${url%[#@]*}" "$com" @@ -1340,7 +1340,7 @@ pkg_conflicts() { # Combine the dirname and file values, and print them into the # temporary manifest to be parsed. - printf '%s/%s\n' "${dirname#$CPT_ROOT}" "${file##*/}" + printf '%s/%s\n' "${dirname#"$CPT_ROOT"}" "${file##*/}" done < "$tar_dir/$1/$pkg_db/$1/manifest" > "$CPT_TMPDIR/$pid/manifest" @@ -1462,7 +1462,7 @@ pkg_swap() { # its manifest file to reflect this. We then resort this file # so no issues arise when removing packages. cp -Pf "$CPT_ROOT/$2" "$pkg_owns>${alt#*>}" - sed "s#^$(regesc "$2")\$#${PWD#$CPT_ROOT}/$pkg_owns>${alt#*>}#" \ + sed "s#^$(regesc "$2")\$#${PWD#"$CPT_ROOT"}/$pkg_owns>${alt#*>}#" \ "../installed/$pkg_owns/manifest" | sort -r -o "../installed/$pkg_owns/manifest" else @@ -1477,7 +1477,7 @@ pkg_swap() { # Convert the desired alternative to a real file and rewrite # the manifest file to reflect this. The reverse of above. mv -f "$alt" "$CPT_ROOT/$2" - sed "s#^${PWD#$CPT_ROOT}/$(regesc "$alt")\$#$2#" "../installed/$1/manifest" | + sed "s#^${PWD#"$CPT_ROOT"}/$(regesc "$alt")\$#$2#" "../installed/$1/manifest" | sort -r -o "../installed/$1/manifest" } @@ -1721,7 +1721,7 @@ pkg_repository_update() { # Function to update the given package repository. cd "$1" repo_type=$(pkg_vcs_info) - repo_root=${repo_type#$PWD:} + repo_root=${repo_type#"$PWD":} repo_type=${repo_type##*:} repo_root=${repo_root%:*} contains "$repos" "$repo_root" || { repos="$repos $repo_root " -- cgit v1.2.3 From 066f39fe72bd7fdcd8f2c56d2d5cf9fbed9e9e0d Mon Sep 17 00:00:00 2001 From: merakor Date: Tue, 9 Nov 2021 09:57:30 +0000 Subject: cpt-build: fix shellcheck error FossilOrigin-Name: 6ead8644b196024a910c4878fc63a982468e4ef65d7c9d6066b89df584b1a940 --- src/cpt-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpt-build b/src/cpt-build index 4eccbd1..03a33b7 100755 --- a/src/cpt-build +++ b/src/cpt-build @@ -10,7 +10,7 @@ parser_definition() { if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi -[ "$1" ] || { set -- "${PWD##*/}"; export CPT_PATH=${PWD%/*}:$CPT_PATH ;} +[ "$1" ] || { set -- "${PWD##*/}"; export CPT_PATH="${PWD%/*}:$CPT_PATH" ;} create_cache -- cgit v1.2.3 From 084402a10322ee126a3751a6f9ee3f147c2f708e Mon Sep 17 00:00:00 2001 From: merakor Date: Tue, 9 Nov 2021 09:58:25 +0000 Subject: cpt-remove: fix shellcheck error FossilOrigin-Name: 07c7f7449592259d1eb410762d36296beabb81e6c2c5ebde0711e1da74d41f74 --- src/cpt-remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpt-remove b/src/cpt-remove index cce3739..ae007eb 100755 --- a/src/cpt-remove +++ b/src/cpt-remove @@ -10,7 +10,7 @@ parser_definition() { if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi -[ "$1" ] || { set -- "${PWD##*/}"; export CPT_PATH=${PWD%/*}:$CPT_PATH ;} +[ "$1" ] || { set -- "${PWD##*/}"; export CPT_PATH="${PWD%/*}:$CPT_PATH" ;} [ -w "$CPT_ROOT/" ] || [ "$uid" = 0 ] || { as_root "$0" "$@" -- cgit v1.2.3 From 8c9c561e33de1930c2acf11e4dcc60091cfbd257 Mon Sep 17 00:00:00 2001 From: merakor Date: Tue, 9 Nov 2021 09:58:38 +0000 Subject: cpt-download: fix shellcheck error FossilOrigin-Name: e05141eae479ea2b40e07bcc901d31c90fd12befcbf1a9db6e6042ebb4cb6643 --- src/cpt-download | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpt-download b/src/cpt-download index d2c9aeb..231e4bb 100755 --- a/src/cpt-download +++ b/src/cpt-download @@ -9,7 +9,7 @@ case "$1" in exit 0 ;; --version|-v) version ;; - '') set -- "${PWD##*/}"; export CPT_PATH=${PWD%/*}:$CPT_PATH + '') set -- "${PWD##*/}"; export CPT_PATH="${PWD%/*}:$CPT_PATH" esac create_cache -- cgit v1.2.3 From 9a8743deb73d4025fee0c9fa0e901cdbb141df3d Mon Sep 17 00:00:00 2001 From: merakor Date: Tue, 9 Nov 2021 09:59:10 +0000 Subject: cpt-install: fix shellcheck error FossilOrigin-Name: 8faf0a20406acb0f83fc3da3775afbdbb866ba40a4cd5f1f28f53ee11a17df96 --- src/cpt-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpt-install b/src/cpt-install index 44842a3..b64d5a0 100755 --- a/src/cpt-install +++ b/src/cpt-install @@ -10,7 +10,7 @@ parser_definition() { if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi -[ "$1" ] || { set -- "${PWD##*/}"; export CPT_PATH=${PWD%/*}:$CPT_PATH ;} +[ "$1" ] || { set -- "${PWD##*/}"; export CPT_PATH="${PWD%/*}:$CPT_PATH" ;} [ -w "$CPT_ROOT/" ] || [ "$uid" = 0 ] || { as_root "$0" "$@" -- cgit v1.2.3 From 3380d3391d77b459fb5e892095751f3303c70fec Mon Sep 17 00:00:00 2001 From: merakor Date: Tue, 9 Nov 2021 09:59:57 +0000 Subject: cpt-owns: fix shellcheck error FossilOrigin-Name: d5627faf00fe2b32a342c76e2063928f01079a5c463a192646a1fda00ce975a0 --- contrib/cpt-owns | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/cpt-owns b/contrib/cpt-owns index 9bc7d77..1f362d7 100755 --- a/contrib/cpt-owns +++ b/contrib/cpt-owns @@ -40,7 +40,7 @@ case "$1" in esac # Strip 'CPT_ROOT' from the file path if passed and follow symlinks. -file="${1#$CPT_ROOT}" +file="${1#"$CPT_ROOT"}" dirname=$(_readlinkf "$CPT_ROOT/${file%/*}") file="$dirname/${file##*/}" -- cgit v1.2.3 From 458e2953caeb4034ac31e87ef54d7793d21cfa0b Mon Sep 17 00:00:00 2001 From: merakor Date: Tue, 9 Nov 2021 10:07:21 +0000 Subject: CHANGELOG: update FossilOrigin-Name: 2e15fc5b219ff7e36e4067627b28c0250d8f88bb166d78b16d42e7786ee0b4fa --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3922eaa..212b3e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,15 @@ this project _somewhat_ adheres to [Semantic Versioning]. [Semantic Versioning]: https://semver.org/spec/v2.0.0.html +[6.2.2] - 2021-11-09 +-------------------------------------------------------------------------------- + +### Fixed +- `cpt-alternatives` now properly logs file swaps even when the original file + no longer exists. +- Minor fixes + + [6.2.1] - 2021-09-20 --------------------------------------------------------------------------------- -- cgit v1.2.3