s243a

intallpkg.sh LN# 510-530 Update DB

Apr 22nd, 2018
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.17 KB | None | 0 0
  1. # LN# 510 to 530 of /usr/local/petget/installpkg (tahrpup) - http://www.pearltrees.com/s243a/installpkg-sh-usr-local-petget/id20402080/item224131607
  2. #w465 <pkgname>.pet.specs is in older pet pkgs, just dump it...
  3. #maybe a '$APKGNAME.pet.specs' file created by dir2pet script...
  4. rm -f /*.pet.specs 2>/dev/null
  5. #...note, this has a setting to prevent .files and entry in user-installed-packages, so install not registered.
  6.  
  7. #add entry to /root/.packages/user-installed-packages...
  8. #w465 a pet pkg may have /pet.specs which has a db entry...
  9. if [ -f /pet.specs -a -s /pet.specs ];then #w482 ignore zero-byte file.
  10.  DB_ENTRY="`cat /pet.specs | head -n 1`"
  11.  rm -f /pet.specs
  12. else
  13.  [ -f /pet.specs ] && rm -f /pet.specs #w482 remove zero-byte file.
  14.  dlPATTERN='|'"`echo -n "$DLPKG_BASE" | sed -e 's%\\-%\\\\-%'`"'|'
  15.  DB_ENTRY="`cat /tmp/petget_missing_dbentries-Packages-* | grep "$dlPATTERN" | head -n 1`"
  16. fi
  17. ##+++2011-12-27 KRG check if $DLPKG_BASE matches DB_ENTRY 1 so uninstallation works :Ooops:
  18. db_pkg_name=`echo "$DB_ENTRY" |cut -f 1 -d '|'`
  19. if [ "$db_pkg_name" != "$DLPKG_NAME" ];then
  20.  DB_ENTRY=`echo "$DB_ENTRY" |sed "s#$db_pkg_name#$DLPKG_NAME#"`
  21. fi
  22. ##+++2011-12-27 KRG
Advertisement
Add Comment
Please, Sign In to add comment