site  contact  subhomenews

Improving .pet installation

February 23, 2009 — BarryK
I'm trying to solve a problem that we have with installing PET packages. They are expanded into a directory, then the files are copied to '/' then the directory is deleted. This is very inefficient and a problem when we have a large package to install and not much free space.

Slackware tarballs are created such that they can be expanded directly to '/'.

I did have various reasons for choosing to expand .pets into a directory first. It did make it easy to determine what files have been installed, but then, this is very easy without expanding:

# pet2tgz
# tar -z -t -f a52dec-0.7.4.tar.gz

One thing that I think I wanted was the ability to precisely control how each file gets installed. For example, I wanted to use the '--remove-destination' option of the 'cp' command.

Anyway, if I do want to expand a .pet package directly to '/', how to do it?

Expand into a directory as before, but 'mv' each file rather than 'cp', to minimise temporary space usage.
Expand the tarball then remake it ...a rather convoluted solution.
Any other way?

'tar' does have a '-O' option, which means expand to stdout. I wonder if there is some trick to pipe that to '/'?


Extract .tar file to /
Username: labrador
NAME="a52dec-0.7.4" pet2tgz "${NAME}.pet" tar -C / --transform 's/^\(\.\/\)\?'"$NAME"'//g' -zxf "${NAME}.tar.gz"

Symbolic Links
Username: Alexio
"GoboLinux uses symbolic links:

The CreateRootlessEnvironment script
Username: Alexio
"You can try the CreateRootlessEnvironment script: ĘThe "rootless" package allows for building a mini-GoboLinux directory hierarchy inside your $HOME. Very useful for non-root users or GoboLinux addicts trapped inside some other distributionĘ More information at

Being BASHful
Username: dogone
"This is way off-topic but BASH v4 sounds like the Puppy's Woof. Here's a brief feature list: More power with which to Woof!

App Dirs
Username: PaulBx1
"I like Rahim's idea. I always thought it was a bad practice to put pieces of an app all over the place, even though I guess that is standard 'nix practice. If that could be done for dotpups, it would make these easier to "uninstall". I wonder if dotpups could be automatically converted into pets right when they are installed? Thus making them uninstallable? Or are we not supporting dotpups any more?

the solution
Username: BarryK
"labrador, Wow, that's great, thanks for posting a neat solution.

Another idea to reduce installation space
Username: Michalis
"Barry, since you are talking about "Improving .pet installation" and reducing the space used by the installation procedure, I have an idea which I believe it can be easy implemented and it could reduce the use of unnecessary space in the pup-woof save file. The installation script when installing pet files which include locales or NLS pet files could look for the languages which the user have configure in his/her save file and it could install only the languages the user has chosen. That could reduce much of the space used by locales since in most cases only 2 locales are being used (native and english) when an NLS pet can contain even more than 20.I usually do that manually, but it could be great if it could be automatic during the installation process. It can also be implemented with a dialog that asks the user to tick the locales he wants to install. The script can read the names of the folders in the locale dir and post them in a GUI with a tick box next to each one, the user decides which one wants and the script installs only those, or installs all of them and deletes the non chosen ones.

cpio is your friend
Username: Springer
"I know you already have an answer, but dont' forget that cpio can do everything that tar can, and much much more. (Yes, you read that right - if all you have is cpio, you can deal with both tar and cpio archives, but not the other way around...) In particular, cpio is more stream-friendly and has some serious power options for moving things around. It's also faster than tar (or at least, it used to be...) Long ago, on DEC Ultrix, I would routinely use the gibberish-looking "cpio -padlkvm" to move/replicate entire file trees, access timestamps and all.

Tags: woof