aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2021-04-05 09:50:00 +0000
committermerakor <cem@ckyln.com>2021-04-05 09:50:00 +0000
commitaf5cf1872607d4e6e6dcfa7f8f5140cddb520f28 (patch)
tree9352363cfaaac46cf1b4ad2fb2224630b3a3bc10 /src
parentc7ebd02839a29e07d5b2c66d1769613cc0b2eeb8 (diff)
parent22016f78e26f45dda7c09dc21782a52b9ff2ee52 (diff)
downloadcpt-af5cf1872607d4e6e6dcfa7f8f5140cddb520f28.tar.gz
merge 6.0.x stable
FossilOrigin-Name: 0f8a799d51f6cf2f4f38dd16749982c9b941961b4a281b1f7ddb2594b949b835
Diffstat (limited to 'src')
-rw-r--r--src/cpt-lib.in15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/cpt-lib.in b/src/cpt-lib.in
index 9ddee72..bf58fbe 100644
--- a/src/cpt-lib.in
+++ b/src/cpt-lib.in
@@ -39,7 +39,10 @@ die() {
trap_set() {
# Function to set the trap value.
case ${1:-cleanup} in
- cleanup) trap pkg_clean EXIT INT ;;
+ cleanup)
+ trap pkg_clean EXIT
+ trap 'pkg_clean; exit 1' INT
+ ;;
block) trap '' INT ;;
unset) trap - EXIT INT ;;
esac
@@ -1041,7 +1044,7 @@ pkg_build() {
log "Building: $*"
# Only ask for confirmation if more than one package needs to be built.
- [ $# -gt 1 ] || [ "$pkg_update" ] && { prompt || exit 0 ;}
+ [ $# -gt 1 ] || [ "$pkg_update" ] && prompt
log "Checking for pre-built dependencies"
@@ -1792,8 +1795,8 @@ pkg_updates(){
# Read version and release information from the installed packages
# and repository.
- read -r db_ver db_rel < "$pkg/version" || exit 1
- read -r re_ver re_rel < "$(pkg_find "$pkg_name")/version" || exit 1
+ read -r db_ver db_rel < "$pkg/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" ] && {
@@ -1809,7 +1812,7 @@ pkg_updates(){
# shellcheck disable=2154
[ "$download_only" = 1 ] && {
log "Only sources for the packages will be acquired"
- prompt || exit 0
+ prompt
for pkg in $outdated; do
pkg_sources "$pkg"
@@ -1822,7 +1825,7 @@ pkg_updates(){
log "Detected package manager update"
log "The package manager will be updated first"
- prompt || exit 0
+ prompt
pkg_build cpt
cpt-install cpt