Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPM tweaks: Update installpkg.sh #4294

Open
wants to merge 3 commits into
base: testing
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 48 additions & 31 deletions woof-code/rootfs-skeleton/usr/local/petget/installpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,16 @@ Pfiles () {
}

Clear_wkdir () {
cp -far --remove-destination ${WKDIR}/* /
cp -far --remove-destination ${WKDIR}/* ${DIRECTSAVEPATH}/
local RC="$?"
rm -fr ${WKDIR}/*
cd "$DLPKG_PATH"
return "$RC"
}

#Marv ->
wkdir_memcheck () {
USE=`df --output='pcent' /tmp/petget_proc/wkdir | grep -o '[0-9]*'`
USE=`df --output='pcent' ${WKDIR} | grep -o '[0-9]*'`
if [ "$USE" -ge "90" ]; then #or so, Marv
. /usr/lib/gtkdialog/box_splash -timeout 2 -fontsize large -text "$(gettext 'Temporary memory full - aborting install. Consider setting up a swap file or partition.')" > /dev/null 2>&1 &
exit
Expand All @@ -87,35 +88,6 @@ wkdir_memcheck () {
#<-Marv
#End Functions # <-jrb

#Make directory to extract pkgs to #jrb
mkdir /tmp/petget_proc/wkdir > /dev/null 2>&1 #230305 #jrb
WKDIR=/tmp/petget_proc/wkdir #230305 #jrb
wkdir_memcheck

[ "$(cat /var/local/petget/nt_category 2>/dev/null)" != "true" ] && \
[ -f /tmp/petget_proc/install_quietly ] && set -x
#; mkdir -p /tmp/petget_proc/PPM_LOGs ; NAME=$(basename "$0"); exec 1>> /tmp/petget_proc/PPM_LOGs/"$NAME".log 2>&1

export TEXTDOMAIN=petget___installpkg.sh
export OUTPUT_CHARSET=UTF-8

APPDIR=$(dirname $0)
[ -f "$APPDIR/i18n_head" ] && source "$APPDIR/i18n_head"
LANG_USER=$LANG
export LANG=C
[ -e /etc/rc.d/PUPSTATE ] && . /etc/rc.d/PUPSTATE #this has PUPMODE and SAVE_LAYER.
. /etc/DISTRO_SPECS #has DISTRO_BINARY_COMPAT, DISTRO_COMPAT_VERSION

. /etc/xdg/menus/hierarchy #w478 has PUPHIERARCHY variable.

[ "$PUPMODE" == "" ] && PUPMODE=2

[ "$PUPMODE" = "2" ] && [ ! -d /audit ] && mkdir -p /audit

DLPKG="$1"
DLPKG_BASE="`basename "$DLPKG"`" #ex: scite-1.77-i686-2as.tgz
DLPKG_PATH="`dirname "$DLPKG"`" #ex: /root
DL_SAVE_FLAG=$(cat /var/local/petget/nd_category 2>/dev/null)

clean_and_die () {
rm -f /var/packages/${DLPKG_NAME}.files
Expand Down Expand Up @@ -160,6 +132,34 @@ install_path_check() {
exit 1
}



[ "$(cat /var/local/petget/nt_category 2>/dev/null)" != "true" ] && \
[ -f /tmp/petget_proc/install_quietly ] && set -x
#; mkdir -p /tmp/petget_proc/PPM_LOGs ; NAME=$(basename "$0"); exec 1>> /tmp/petget_proc/PPM_LOGs/"$NAME".log 2>&1

export TEXTDOMAIN=petget___installpkg.sh
export OUTPUT_CHARSET=UTF-8

APPDIR=$(dirname $0)
[ -f "$APPDIR/i18n_head" ] && source "$APPDIR/i18n_head"
LANG_USER=$LANG
export LANG=C
[ -e /etc/rc.d/PUPSTATE ] && . /etc/rc.d/PUPSTATE #this has PUPMODE and SAVE_LAYER.
. /etc/DISTRO_SPECS #has DISTRO_BINARY_COMPAT, DISTRO_COMPAT_VERSION

. /etc/xdg/menus/hierarchy #w478 has PUPHIERARCHY variable.

[ "$PUPMODE" == "" ] && PUPMODE=2

[ "$PUPMODE" = "2" ] && [ ! -d /audit ] && mkdir -p /audit

DLPKG="$1"
DLPKG_BASE="`basename "$DLPKG"`" #ex: scite-1.77-i686-2as.tgz
DLPKG_PATH="`dirname "$DLPKG"`" #ex: /root
DL_SAVE_FLAG=$(cat /var/local/petget/nd_category 2>/dev/null)


# 22sep10 shinobar clean up probable old files for precaution
rm -f /pet.specs /pinstall.sh /puninstall.sh /install/doinst.sh

Expand Down Expand Up @@ -290,6 +290,23 @@ elif [ $PUPMODE -eq 13 ] && [ "$PUNIONFS" != "overlay" ];then
fi
fi

#Make directory to extract pkgs to #jrb

TMPFREE=$(df -k /tmp | awk 'NR==2 {print $4}')
DSAVEFREE=$(df -k /${DIRECTSAVEPATH} | awk 'NR==2 {print $4}')

if [ $DSAVEFREE -ge $TMPFREE ]; then
WKDIR=${DIRECTSAVEPATH}/wkdir #230305 #jrb
else
WKDIR=/tmp/petget_proc/wkdir #230305 #jrb
fi

mkdir -p ${WKDIR} > /dev/null 2>&1 #230305 #jrb

wkdir_memcheck



if [ -n "$DISPLAY" ] || [ -n "$WAYLAND_DISPLAY" ] && [ ! -f /tmp/petget_proc/install_quietly ];then #131222
LANG=$LANG_USER
. /usr/lib/gtkdialog/box_splash -close never -fontsize large -text "$(gettext 'Please wait, processing...')" &
Expand Down