Thingy package manager 001

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

Thingy package manager 001

#1 Post by Iguleder »

This is a small package manager I'm working on. Package managers thrilled me since my first days in the free software world, especially in the Puppy world, so here's my third attempt to write a proper package manager. The first two attempts were full-fledged package mangers that used SFS images without Aufs (i.e with symlinking) and worked beautifully, but this is the first time I write a .tar.gz package manager.

It's all GPL, do whatever you want with it. Curious people will surely find it fun to explore the code :P

Basically, this thing is a simple package manager that is kinda similar to Puppy's and APT. It consists of two levels:
- pkg-thingy (the equivalent to dpkg and rpm) - a low-level package installer and remover that has other small functions. It does everything in a very straight-forward way and without any attention to details.
- thingy-get (the equivalent to aptitude and yum) - a higher-level package tool that knows how to work with repos and fetch packages. It utilizes pkg-thingy for the actual installation and removal of packages. It still doesn't handle dependencies, but I'll try to add that.

If you want to try it out, don't forget to:
1) Take a look at the example repo in http://brainwavedesigncentral.net/dima/thingy
2) Make a repo compatible with your Puppy. Use "pkg-thingy --help" to see your Puppy's details.
3) Edit /etc/thingyrc. If you want to try the example repo's packages, just put "arch=klp4" in /etc/thingyrc to force it. Go for the Skype package.

How does it work?

Package Format

The Thingy packages are .tar.gz packages (just like PETs), with a .tng extension. They contain all the package files, and the optional pinstall.sh and puninstall.sh (I kept the names for easy package conversion).

Packages are named <generic name>-<version>-<Puppy prefix><Puppy major version number>.tng.

For instance, Pmusic 1.0.1 for Puppy 4.x is pmusic-1.0.1-pup4.tng, while an Opera 10.60 package for Lupu is opera-10.60-lupu5.tng. Simple, isn't it?

The Repository Format

The repository contains files named thingy-packages-<Puppy prefix><Puppy major version number>; each of these files lists the packages in a directory named packages-<Puppy prefix><Puppy major version number>, along with their size, description, category and dependencies.

For instance, the thingy-packages-lupu5 file lists all the packages in the directory packages-lupu5.

The package lists contain many lines of this format:

Code: Select all

full package name|menu category|description|size in K|dependency1 dependency2 [...]
An example entry is:

Code: Select all

opera-10.60-pup4|Internet|A fast web browser|11M|gtk
This way, more information is concentrated in one line: the name, version and target Puppy are sticked together.

So ... How does it work?

pkg-thingy is very simple. It uses a very simple algorithm to install packages:

Code: Select all

Check whether the package is already installed
Create a temporary directory
Extract the package there
Make a list of files and directories it adds to the system and save it under Thingy's settings directory
Copy everything to the main file system
Run the post-install script if it exists
Refresh the menus if needed
The removal procedure is even simpler:

Code: Select all

Check whether the package is already installed
For each file or directory in the files list, delete it
Remove the file list
Run the post-uninstall script if it exists
Refresh the menus if needed
thingy-get also knows how to sync with the repo, locate packages, fetch them and calls pkg-thingy for installation and removal.
______

As I said, it's not intended to be some real package manager, although I may find some use for it in a puplet or something.

And hey, guess what? Use at your own risk.
Attachments
thingy-001.tar
(20 KiB) Downloaded 253 times
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
TrailerTrash
Posts: 67
Joined: Tue 29 Jan 2008, 16:50

#2 Post by TrailerTrash »

Woo Hoo.... :shock:

Will it work in 5.01? :?:

What has always irritated me about Linux is package managers. We all know that when using Windows if we want to make a local repository of applications all we need to do is to drag those applications to a storage media and later we can drag them back to another machine. See? No fussing with or having to find dependencies manually. :o

I really wish that I could to the same with any Linux. My dream is what I have been calling a Universal Package Manager. It works with any flavor. But what makes it truly different is that you can use it to simply drag applications to a DVD for local storage. It would collect and copy all the dependencies for that application and simply put them all together in a file for future reference. This saves having to download all the stuff all over again later. Then when you drag an application to your new flavor it checks to see which of the dependencies are already there, which need upgrading or replacing and sorts out compatibility issues. Then it gets installed. I really miss that .exe file that you simply click on to have everything done for you. 8)

This business of managing packages has always been a sore point with me. I want to be able to install what I want with the software taking care of all the package stuff.

Universal Package Manager.... Make one of these and remove the last reason to keep Windows. I mean that. :D

Man if I knew how to build one I'd be doing it right now.

Want to know what really P's me off? It's the people who always say "we can't we can't we can't... My attitude is that if humans made a system humans can change it. There should be no such thing as "we can't".

So, anyway, is your manager sort of like my idea??? I'll download it anyway.

Thanks Rant over... :evil:

TT

Post Reply