s243a

installpkg.sh (tahpup) LN# 82-117-warn if intalling to /mnt/

Apr 21st, 2018
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.87 KB | None | 0 0
  1. # 6sep10 shinobar: installing files under /mnt is danger #LN# 82-117 of /usr/local/petget/installpkg.sh (tahrpup) - http://www.pearltrees.com/s243a/installpkg-sh-usr-local-petget/id20402080/item224090338
  2. install_path_check() {
  3.   FILELIST="/root/.packages/${DLPKG_NAME}.files"
  4.   [ -s "$FILELIST" ] || return 0 #120126 noryb009: typo
  5.   grep -q '^/mnt' "$FILELIST" || return 0
  6.   MNTDIRS=$(cat "$FILELIST" | grep '^/mnt/.*/$' | cut -d'/' -f1-3  | tail -n 1)
  7.   LANG=$LANG_USER
  8.   MSG1=$(gettext "This package will install files under")
  9.   MSG2=$(gettext "It can be dangerous to install files under '/mnt' because it depends on the profile of installation.")
  10.   MSG3=""
  11.   if grep -q '^/mnt/home' "$FILELIST"; then
  12.     if [ $PUPMODE -eq 5 ]; then
  13.       MSG3=$(gettext "You are running Puppy without 'pupsave', and '/mnt/home' does not exist. In this case, you can use the RAM for this space, but strongly recommended to shutdown now to create 'pupsave' BEFORE installing these packages.")
  14.       MSG3="$MSG3\\n$(gettext "NOTE: You can install this package for a tentative use, then do NOT make 'pupsave' with this package installed.")"
  15.     fi
  16.     DIRECTSAVEPATH=""
  17.   fi
  18.   # dialog
  19.   export DIALOG="<window title=\"$T_title\" icon-name=\"gtk-dialog-warning\">
  20.  <vbox>
  21.  <text use-markup=\"true\"><label>\"$MSG1: <b>$MNTDIRS</b>\"</label></text>
  22.  <text><input>echo -en \"$MSG2 $MSG3\"</input></text>
  23.  <text><label>$(gettext "Click 'Cancel' not to install(recommended). Or click 'Install' if you like to proceed.")</label></text>
  24.   <hbox>
  25.   <button cancel></button>
  26.   <button><input file stock=\"gtk-apply\"></input><label>$(gettext 'Install')</label><action type=\"exit\">INSTALL</action></button>
  27.   </hbox>
  28.   </vbox>
  29.   </window>"
  30.  RETPARAMS=`gtkdialog -p DIALOG` || echo "$DIALOG" >&2
  31.  eval "$RETPARAMS"
  32.  LANG=C
  33.  [ "$EXIT" = "INSTALL" ]  && return 0
  34.  rm -f "$FILELIST"
  35.  exit 1
  36. }
Advertisement
Add Comment
Please, Sign In to add comment