wok diff get-google-earth/stuff/get-google-earth @ rev 25037
Up glza (0.11.4)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat May 21 21:38:29 2022 +0000 (2022-05-21) |
parents | d7b0fb9b6487 |
children |
line diff
1.1 --- a/get-google-earth/stuff/get-google-earth Fri Apr 05 16:34:43 2019 +0100 1.2 +++ b/get-google-earth/stuff/get-google-earth Sat May 21 21:38:29 2022 +0000 1.3 @@ -2,17 +2,20 @@ 1.4 # 1.5 # get-google-earth - create and install SliTaz package google-earth 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 : unknown 1.10 # modified by HGT on 2019-04-05 1.11 +# modified by HGT on 2020-02-10 1.12 # 1.13 1.14 # === Initialisations === 1.15 1.16 PKGS_DB="/var/lib/tazpkg" # packages database directory 1.17 PACKAGE="google-earth" # package to create and install 1.18 +CATEGORY="non-free" 1.19 +TAGS="maps" 1.20 +LICENSE="non-free" 1.21 WEB_SITE="https://google.com/earth/" 1.22 -CATEGORY="non-free" 1.23 DEPENDS="libglu-mesa" 1.24 1.25 # Declare functions check_root, status, ... 1.26 @@ -59,10 +62,12 @@ 1.27 [ -z "$keep" ] && keep="no" 1.28 1.29 # Directory for temporary files 1.30 -[ -z "$tempdir" ] && TMP_DIR="/tmp/get-$PACKAGE" 1.31 +TMP_DIR="$tmpdir" 1.32 +[ -z "$tmpdir" ] && TMP_DIR="/tmp/get-$PACKAGE" 1.33 1.34 # Logging file (unused by now) 1.35 -LOG=$TMP_DIR/get-$PACKAGE.log 1.36 +LOG="$logfile" 1.37 +[ -z "$logfile" ] && LOG=$TMP_DIR/get-$PACKAGE.log 1.38 1.39 cat <<EOT 1.40 Options in use: 1.41 @@ -77,12 +82,23 @@ 1.42 separator; newline 1.43 1.44 # === Remove package, if installed === 1.45 -if [ is_installed ] 1.46 - then 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 +if is_installed 1.52 + then 1.53 + echo "$PACKAGE is already installed." 1.54 + echo -n "Would you like to remove and reinstall this package [y/n]? " 1.55 + read answer 1.56 + case "$answer" in 1.57 + y|Y) 1.58 + action "Removing installed version..." 1.59 + tazpkg remove $PACKAGE --root="$root/" 1.60 + [ ! is_installed ] && 1.61 + die "Can't remove installed version. Exiting." 1.62 + ;; 1.63 + *) 1.64 + echo "Leaving $PACKAGE untouched." 1.65 + exit 0 1.66 + ;; 1.67 + esac 1.68 fi 1.69 1.70 # === Fetch archive file, if not existing === 1.71 @@ -113,7 +129,7 @@ 1.72 then 1.73 cd $CUR_DIR 1.74 rm -rf $TMP_DIR 1.75 - echo "Could not transfer $FILE from $URL. Exiting." 1.76 + echo "Could not transfer $FILE from $WGET_URL. Exiting." 1.77 exit 1 1.78 fi 1.79 fi 1.80 @@ -153,10 +169,10 @@ 1.81 PACKAGE="$PACKAGE" 1.82 VERSION="$VERSION" 1.83 CATEGORY="$CATEGORY" 1.84 -TAGS="maps" 1.85 +TAGS="$TAGS" 1.86 SHORT_DESC="$SHORT_DESC" 1.87 MAINTAINER="$MAINTAINER" 1.88 -LICENSE="non-free" 1.89 +LICENSE="$LICENSE" 1.90 WEB_SITE="$WEB_SITE" 1.91 1.92 DEPENDS="$DEPENDS" 1.93 @@ -187,7 +203,9 @@ 1.94 1.95 # === Cleanup === 1.96 # Preserve package file, if requested 1.97 -[ "$keep" == "yes" ] && mv $PACKAGE-$VERSION.tazpkg $CUR_DIR 1.98 +[ "$keep" == "yes" ] && 1.99 +( mv $PACKAGE-$VERSION.tazpkg $CUR_DIR && 1.100 + echo Saved $PACKAGE-$VERSION.tazpkg to $CUR_DIR ) 1.101 1.102 # Remove temporary build directory 1.103 cd $CUR_DIR