Improving .pet installation

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 a52dec-0.7.4.pet
# tar -z -t -f a52dec-0.7.4.tar.gz
a52dec-0.7.4/
a52dec-0.7.4/usr/
a52dec-0.7.4/usr/bin/
a52dec-0.7.4/usr/bin/extract_a52
a52dec-0.7.4/usr/bin/a52dec

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?

1.
Expand into a directory as before, but 'mv' each file rather than 'cp', to minimise temporary space usage.
2.
Expand the tarball then remake it ...a rather convoluted solution.
3.
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 '/'?


Posted on 23 Feb 2009, 21:48


Comments:

Posted on 23 Feb 2009, 22:45 by labrador
Extract .tar file to /
NAME="a52dec-0.7.4"

pet2tgz "${NAME}.pet"

tar -C / --transform 's/^\(\.\/\)\?'"$NAME"'//g' -zxf "${NAME}.tar.gz"


Posted on 24 Feb 2009, 2:14 by Rahim
App Dirs?
Just a wish.... would it be possible to have application directories instead of having the package's files scattered all over the filesystem? Maybe symlinks could be created automatically in the traditional /etc/ and /usr/bin and /usr/lib directories, but have the actual files in a /programs/name directory structure.


Posted on 24 Feb 2009, 4:18 by Alexio
Symbolic Links
GoboLinux uses symbolic links:
http://gobolinux.org/?page=at_a_glance


Posted on 24 Feb 2009, 4:31 by Alexio
The CreateRootlessEnvironment script
You can try the CreateRootlessEnvironment script:
http://svn.gobolinux.org/tools/trunk/Scripts/bin/CreateRootlessEnvironment

Ę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 http://gobolinux.org/index.php?page=rootless


Posted on 24 Feb 2009, 11:37 by dogone
Being BASHful
This is way off-topic but BASH v4 sounds like the Puppy's Woof. Here's a brief feature list:

http://tiswww.case.edu/php/chet/bash/NEWS

More power with which to Woof!


Posted on 24 Feb 2009, 12:56 by PaulBx1
App Dirs
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?


Posted on 24 Feb 2009, 18:15 by BarryK
the solution
labrador,
Wow, that's great, thanks for posting a neat solution.



Posted on 26 Feb 2009, 6:15 by Michalis
Another idea to reduce installation space
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.


Posted on 26 Feb 2009, 7:24 by Springer
cpio is your friend
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.


Posted on 27 Feb 2009, 4:19 by Alexio
GNU cpio
The latest version of GNU cpio is licensed under the GPLv3: http://www.gnu.org/software/cpio/cpio.html