Skip to content

The problem with the .pet format

Phoenix-Starlight edited this page Sep 8, 2021 · 2 revisions
  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 -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 -x --strip=1 --directory=${DIRECTSAVEPATH}/ -f ${tarball} #120102. 120107. 131122
  fi

When you create something, you are the one who define the rules, others have to adapt and achieve the same results even with different programs, code or programming language.

It's simple, non-standard stuff must not be supported, we're defining a package format here. Otherwise it only makes it a nightmare to process pet packages and bloats the scripts.

md5: It means nothing inside a pet package It only corrupts the tar file forcing you to do really quirky things with it. tar can check the integrity of tar files,

checksums are part of online package lists so you know you have the correct files..

with .pet you need to do some crazy things to convert it to a normal tar file, there was a truncate binary that I deleted for good, You need to produce another file without the checksum at the end, and I see this in pet2tgz so you get the right extension.

#determine the compression, extend test to 'XZ'
finfo=$(file -b "$PFILE")
case $finfo in
  gz*|GZ*) EXT=gz ;;
  xz*|XZ*) EXT=xz ;;
  *) exit_error "wrong compression or corrupted/empty file" ;;
esac

YAB (yet another bug): the root directory must be a directory with the package filename, leading to really quirky code to deal with it (see above)

How to fix this

A new format

  1. A simple tar.gz or tar.xz file with .pxz or .pgz extension, so it's identified as a puppy package. The package must be created with this code.
(
cd pkgdir
tar -c * | gzip > ../pkgdir.pgz
)
(
cd pkgdir
tar -c * | xz > ../pkgdir.pxz
)
  1. Checksums go to online pkg lists.
Clone this wiki locally