Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cd "$DLPKG_PATH" # LN# 215-299 of /usr/local/petget/installpkg.sh (tahrpup) - http://www.pearltrees.com/s243a/installpkg-sh-usr-local-petget/id20402080/item224129810
- case $DLPKG_BASE in
- *.pet)
- DLPKG_MAIN="`basename $DLPKG_BASE .pet`"
- pet2tgz $DLPKG_BASE || exit 1
- tarball=$(echo ${DLPKG_MAIN}.tar.[gx]z)
- PETFILES="$(tar --list -a -f $tarball)" || exit 1
- #check for renamed pets. Will produce an empty ${DLPKG_NAME}.files file
- PETFOLDER=$(echo "${PETFILES}" | cut -f 2 -d '/' | head -n 1)
- [ "$PETFOLDER" = "" ] && PETFOLDER=$(echo "${PETFILES}" | cut -f 1 -d '/' | head -n 1)
- if [ "${DLPKG_MAIN}" != "${PETFOLDER}" ]; then
- pupkill $YAFPID1
- LANG=$LANG_USER
- if [ "$DISPLAY" ]; then
- . /usr/lib/gtkdialog/box_ok "$(gettext 'Puppy Package Manager')" error "<b>${DLPKG_MAIN}.pet</b> $(gettext 'is named') <b>${PETFOLDER}</b> $(gettext 'inside the pet file. Will not install it!')"
- else
- . dialog --msgbox "$DLPKG_MAIN.pet $(gettext 'is named') $PETFOLDER $(gettext 'inside the pet file. Will not install it!')" 0 0
- fi
- exit 1
- fi
- if [ "`echo "$PETFILES" | grep -m1 '^\\./'`" != "" ];then
- #ttuuxx has created some pets with './' prefix...
- pPATTERN="s%^\\./${DLPKG_NAME}%%"
- echo "$PETFILES" | sed -e "$pPATTERN" > /root/.packages/${DLPKG_NAME}.files
- install_path_check
- tar -a -x --strip=2 --directory=${DIRECTSAVEPATH}/ -f ${tarball} #120102. 120107 remove --unlink-first
- else
- #new2dir and tgz2pet creates them this way...
- pPATTERN="s%^${DLPKG_NAME}%%"
- echo "$PETFILES" | sed -e "$pPATTERN" > /root/.packages/${DLPKG_NAME}.files
- install_path_check
- tar -a -x --strip=1 --directory=${DIRECTSAVEPATH}/ -f ${tarball} #120102. 120107. 131122
- fi
- rm -f "${tarball}"
- [ $? -ne 0 ] && clean_and_die
- ;;
- *.deb)
- DLPKG_MAIN="`basename $DLPKG_BASE .deb`"
- PFILES="`dpkg-deb --contents $DLPKG_BASE | tr -s ' ' | cut -f 6 -d ' '`"
- [ $? -ne 0 ] && exit 1
- echo "$PFILES" > /root/.packages/${DLPKG_NAME}.files
- install_path_check
- # Workaround to avoid overwriting the $DISTRO_ARCHDIR symlink.
- if [ "$DISTRO_ARCHDIR" != "" -a "$(echo "$PFILES" | grep "$DISTRO_ARCHDIR")" != "" ]; then
- mkdir -p /tmp/$DLPKG_BASE
- rm -rf /tmp/$DLPKG_BASE/*
- dpkg-deb -x $DLPKG_BASE /tmp/$DLPKG_BASE/
- for f in $(find /tmp/$DLPKG_BASE \( -type f -o -type l \))
- do
- xpath=$(echo $f | cut -f 4-30 -d "/" | sed "s/$DISTRO_ARCHDIR\///")
- mkdir -p /$(dirname $xpath)
- cp -a $f /$(dirname $xpath)/
- done
- rm -rf /tmp/$DLPKG_BASE
- else
- dpkg-deb -x $DLPKG_BASE ${DIRECTSAVEPATH}/
- fi
- [ $? -ne 0 ] && clean_and_die
- [ -d /DEBIAN ] && rm -rf /DEBIAN #130112 precaution.
- dpkg-deb -e $DLPKG_BASE /DEBIAN #130112 extracts deb control files to dir /DEBIAN. may have a post-install script, see below.
- ;;
- *.tgz|*.txz|*.tar.gz|*.tar.xz|*.tar.bz2) #slackware, arch, etc..
- DLPKG_MAIN="`basename $DLPKG_BASE`" #remove directory - filename only
- DLPKG_MAIN=${DLPKG_MAIN%*.tar.*} #remove .tar.xx extension
- DLPKG_MAIN=${DLPKG_MAIN%.t[gx]z} #remove .t[gx]z extension
- PFILES="`tar --list -a -f $DLPKG_BASE`" || exit 1
- echo "$PFILES" > /root/.packages/${DLPKG_NAME}.files
- install_path_check
- tar -a -x --directory=${DIRECTSAVEPATH}/ -f $DLPKG_BASE #120102. 120107
- [ $? -ne 0 ] && clean_and_die
- ;;
- *.rpm) #110523
- DLPKG_MAIN="`basename $DLPKG_BASE .rpm`"
- busybox rpm -qp $DLPKG_BASE > /dev/null 2>&1
- [ $? -ne 0 ] && exit 1
- PFILES="`busybox rpm -qpl $DLPKG_BASE`"
- [ $? -ne 0 ] && exit 1
- echo "$PFILES" > /root/.packages/${DLPKG_NAME}.files
- install_path_check
- #110705 rpm -i does not work for mageia pkgs...
- exploderpm -i $DLPKG_BASE
- [ $? -ne 0 ] && clean_and_die
- ;;
- esac
Add Comment
Please, Sign In to add comment