Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 21 Jan 2017, 13:33
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Thingy package manager 001
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message

Joined: 11 Aug 2009
Posts: 2031
Location: Israel, somewhere in the beautiful desert

PostPosted: Sat 17 Jul 2010, 06:54    Post subject:  Thingy package manager 001
Subject description: A simple package manager prototype

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 Razz

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:
full package name|menu category|description|size in K|dependency1 dependency2 [...]

An example entry is:
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:
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:

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.

Filename  thingy-001.tar 
Filesize  20 KB 
Downloaded  212 Time(s) 

My homepage
My GitHub profile
Back to top
View user's profile Send private message Visit poster's website 

Joined: 29 Jan 2008
Posts: 63

PostPosted: Sat 24 Jul 2010, 21:03    Post subject:  

Woo Hoo.... Shocked

Will it work in 5.01? Question

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. Surprised

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. Cool

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. Very Happy

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 or Very Mad

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0523s ][ Queries: 12 (0.0075s) ][ GZIP on ]