wok diff get-e-uae/stuff/get-e-uae @ rev 24984
Up ufr2 (2.40-2)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue May 10 07:46:30 2022 +0000 (2022-05-10) |
parents | 7cfacc80d067 |
children |
line diff
1.1 --- a/get-e-uae/stuff/get-e-uae Thu Oct 24 16:40:55 2019 +0100 1.2 +++ b/get-e-uae/stuff/get-e-uae Tue May 10 07:46:30 2022 +0000 1.3 @@ -2,9 +2,10 @@ 1.4 # 1.5 # get-e-uae - create and install SliTaz package e-uae 1.6 # 1.7 -# (C) 2019 SliTaz - GNU General Public License v3. 1.8 +# (C) 2020 SliTaz - GNU General Public License v3. 1.9 # Author : HGT 1.10 # created: 2019-10-24 1.11 +# modified by HGT on 2020-02-08 1.12 # 1.13 1.14 # === Initialisations === 1.15 @@ -59,10 +60,12 @@ 1.16 [ -z "$keep" ] && keep="no" 1.17 1.18 # Directory for temporary files 1.19 -[ -z "$tempdir" ] && TMP_DIR="/tmp/get-$PACKAGE" 1.20 +TMP_DIR=$tmpdir 1.21 +[ -z "$tmpdir" ] && TMP_DIR="/tmp/get-$PACKAGE" 1.22 1.23 # Logging file (unused by now) 1.24 -LOG=$TMP_DIR/get-$PACKAGE.log 1.25 +LOG=$logging_file 1.26 +[ -z "$logging_file" ] && LOG=$TMP_DIR/get-$PACKAGE.log 1.27 1.28 cat <<EOT 1.29 Options in use: 1.30 @@ -77,12 +80,23 @@ 1.31 separator; newline 1.32 1.33 # === Remove package, if installed === 1.34 -if [ is_installed ] 1.35 - then 1.36 - action "Removing installed version..." 1.37 - tazpkg remove $PACKAGE --root="$root/" 1.38 - [ ! is_installed ] && 1.39 - die "Can't remove installed version. Exiting." 1.40 +if is_installed 1.41 + then 1.42 + echo "$PACKAGE is already installed." 1.43 + echo -n "Would you like to remove and reinstall this package [y/n]? " 1.44 + read answer 1.45 + case "$answer" in 1.46 + y|Y) 1.47 + action "Removing installed version..." 1.48 + tazpkg remove $PACKAGE --root="$root/" 1.49 + [ ! is_installed ] && 1.50 + die "Can't remove installed version. Exiting." 1.51 + ;; 1.52 + *) 1.53 + echo "Leaving $PACKAGE untouched." 1.54 + exit 0 1.55 + ;; 1.56 + esac 1.57 fi 1.58 1.59 # === Fetch archive file, if not existing === 1.60 @@ -121,6 +135,7 @@ 1.61 fi 1.62 1.63 action "Creating the package $PACKAGE..." 1.64 +newline 1.65 # Convert from Debian format 1.66 tazpkg convert $FILE 1.67 1.68 @@ -130,7 +145,9 @@ 1.69 1.70 # === Cleanup === 1.71 # Preserve package file, if requested 1.72 -[ "$keep" == "yes" ] && mv $PACKAGE-$VERSION.tazpkg $CUR_DIR 1.73 +[ "$keep" == "yes" ] && 1.74 +( mv $PACKAGE-$VERSION.tazpkg $CUR_DIR && 1.75 + echo Saved $PACKAGE-$VERSION.tazpkg to $CUR_DIR ) 1.76 1.77 # Remove temporary build directory 1.78 cd $CUR_DIR