You are not logged in.

#1 2009-05-02 22:29:50

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

µpkg: Very simple package installer/remover

I was recently looking at the documentation for Arch packages and thought "Holy crap, that looks like a pain!". Especially for something really small, like a brainf*** interpreter. So what did I do? I took it upon myself to create my own packaging utility and file format, of course!

µpkg is written entirely in bash and is fairly small, about 115 lines total (although expect that number to increase as I implement more functionality).

Also, a note on versioning. I'm not going to use the decimal/point system, but a revision-based one. So much cleaner, not to mention easier to type. smile

Format
Packages are [optionally compressed] tarballs that contain a number of scripts and some files (duh). They're laid out like so:
* pre-install: Executed before installing.
* post-install: Executed after installing.
* pre-uninstall: Executed before uninstalling.
* post-uninstall: Executed after uninstalling.
* files/: A directory containing files, located such that they will be in the corresponding places in the root filesystem once installed.

Sample Packages
* sudo 1.7.1 x64
* bfutils x64 — Brainf***-related utilities.
To install, simply run "upkg install <package>" as root.

Downloads
* µpkg 1 — First release.
* µpkg 2 — Adds removal functionality. Improvements to internal library.
* µpkg 3 — Library fixed due to bugs.
* µpkg 4 — Now runs appropriate scripts when uninstalling.
Decompress the tarball and run the included installation script.

Obligatory Disclaimer
I cannot be held responsible if µpkg s**ts all over your system. neutral

To Do
* Add package removal capabilities. [DONE]
* Maybe add package management (possibly as separate utility).

Last edited by Peasantoid (2009-05-03 03:24:06)

Offline

#2 2009-05-02 23:21:55

Heller_Barde
Member
Registered: 2008-04-01
Posts: 245

Re: µpkg: Very simple package installer/remover

I congratulate you on tackling the tall task of a package manager.
furthermore, no offense intended, what i don't see is the need for it.

but it's cool that you share your efforts with us smile

cheerio
Barde

Offline

#3 2009-05-02 23:51:00

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: µpkg: Very simple package installer/remover

Heller_Barde wrote:

I congratulate you on tackling the tall task of a package manager.
furthermore, no offense intended, what i don't see is the need for it.

Okay, two things:
1) µpkg is not a package manager. Package managers (at least every one I've heard of) download packages from repositories, figure out dependencies, and other stuff. All this thing does is install [and later, remove] them. The user has to manually download the package. Also, I hate having dependencies rammed down my throat.
2) Need? Who said there has to be a need in order to make something? Did Linus Torvalds "need" Linux? Hell no! I'm a hacker; I do things for fun. big_smile

Heller_Barde wrote:

but it's cool that you share your efforts with us smile

Thanks.

Last edited by Peasantoid (2009-05-02 23:51:42)

Offline

#4 2009-05-03 00:02:18

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: µpkg: Very simple package installer/remover

Peasantoid wrote:

I was recently looking at the documentation for Arch packages and thought "Holy crap, that looks like a pain!".

In what way?

Anyway, although I don't see much use for this myself, I agree with you that sometimes it's fun to code just for the sake of coding and see where it takes you.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2009-05-03 00:52:57

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: µpkg: Very simple package installer/remover

Xyne wrote:
Peasantoid wrote:

I was recently looking at the documentation for Arch packages and thought "Holy crap, that looks like a pain!".

In what way?

* PKGBUILDs. This seems like a redundant step. Why do it when you can just copy a few files into a directory and `tar cvf` it all into a completely valid package? Why distribute a file that tells the user how to make a package themselves, rather than just give them the package itself?
* Platform specificity. µpkg doesn't have any ties with Arch (pacman, makepkg, and so on), so it's more or less cross-platform — it'll work with any distro, the BSDs, and even OS X. (But not Windows, obviously.)

Other than those two points, Arch packages are better for large projects that have dependencies. µpkg would seem to be better for distributing small, standalone pieces of software.

Offline

#6 2009-05-03 00:57:17

Zariel
Member
Registered: 2008-10-07
Posts: 446

Re: µpkg: Very simple package installer/remover

Because pacman does so much more than just blidnly install/remove packages? I agree with what Xyne said.

Last edited by Zariel (2009-05-03 00:59:37)

Offline

#7 2009-05-03 01:03:44

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: µpkg: Very simple package installer/remover

Like I said, it seems like overkill to create an Arch package with all the metadata, dependencies, and so on if you're just distributing something small. Anyway, I never claimed µpkg would be useful. smile

Also: µpkg does not "blindly" install packages. It takes great pains not to clobber anything.

Last edited by Peasantoid (2009-05-03 01:44:50)

Offline

#8 2009-05-03 01:54:10

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: µpkg: Very simple package installer/remover

Sorry but I completely disagree. A proper PKGBUILD will only contain relevant data. If a package has no dependencies or optional dependencies, then those arrays are not included in the PKGBUILD. A PKGBUILD for a minimal package is itself minimal. If it does have dependencies, I don't see why you would not want to install them. What's the point of installing something that won't work? If a standard package has been built against deps that you don't need (as was vim in my case... I don't use ruby), you can just remove it.

It just makes more sense to me to not install a bunch of small packages on your system without tracking them centrally.

Again, I'm not trying to discourage you from continuing with this, I just disagree with your reasoning.

Last edited by Xyne (2009-05-03 02:39:16)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#9 2009-05-03 02:00:42

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: µpkg: Very simple package installer/remover

Well, I didn't look over the packaging documentation in detail (just saw a lot of instructions), so yeah, I probably missed something there. neutral
But anyway. Even if µpkg isn't particularly useful, it was (and still is) fun to write. smile

Speaking of which... I've released revision 2, which includes removal functionality. If you installed the previous one, just run this one's installation script as normal to upgrade it.

Also: Had to re-upload the sudo package in order to correct a naming error with /etc/sudoers.

Last edited by Peasantoid (2009-05-03 02:01:22)

Offline

#10 2009-05-03 02:03:48

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: µpkg: Very simple package installer/remover

Interesting idea! Like others have said I don't really have a use for this myself but that is irrelevant. If you are having fun and find the utility useful others might too. If not, it's all good coding experience. smile Keep working on it.

Peasantoid wrote:

Like I said, it seems like overkill to create an Arch package with all the metadata, dependencies, and so on if you're just distributing something small.

Personally I like Arch's PKGBUILDS. Arch is the first distro where I made up or edited the existing packages. It's just so easy. I never looked into making my own packages when running Gentoo though I don't know why. Arch's PKGBUILDS just sort of sneak up on you. At first you just use pacman, then you find something in AUR and you install ABS, then you are rebuilding packages in the repos to customize them for yourself and before you know it you are making your own package builds.

Peasantoid wrote:

Platform specificity. µpkg doesn't have any ties with Arch (pacman, makepkg, and so on), so it's more or less cross-platform — it'll work with any distro, the BSDs, and even OS X. (But not Windows, obviously.)

This would be an interesting nut to crack. Things like autopackage have been less than successful as far as I know. If someone came up with a cross platform package format that was accepted by the OSS comunity and actually used that would be cool.

Last edited by mikesd (2009-05-03 02:04:31)

Offline

#11 2009-05-03 02:08:44

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: µpkg: Very simple package installer/remover

Hmm, I've never heard of autopackage. Could you explain?

Offline

#12 2009-05-03 02:15:26

Stythys
Member
From: SF Bay Area
Registered: 2008-05-18
Posts: 878
Website

Re: µpkg: Very simple package installer/remover

Peasantoid wrote:

...All this thing does is install [and later, remove] them. The user has to manually download the package. Also, I hate having dependencies rammed down my throat.

so...this is identical to 'pacman -U'?

I really do not see the point of developing a second package manager for arch...


[home page] -- [code / configs]

"Once you go Arch, you must remain there for life or else Allan will track you down and break you."
-- Bregol

Offline

#13 2009-05-03 02:17:58

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: µpkg: Very simple package installer/remover

Peasantoid wrote:

Hmm, I've never heard of autopackage. Could you explain?

Unfortunately that is not surprising. Check it out here.

Offline

#14 2009-05-03 02:19:39

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: µpkg: Very simple package installer/remover

Stythys wrote:
Peasantoid wrote:

...All this thing does is install [and later, remove] them. The user has to manually download the package. Also, I hate having dependencies rammed down my throat.

so...this is identical to 'pacman -U'?

I really do not see the point of developing a second package manager for arch...

http://en.wikipedia.org/wiki/Package_management_system
µpkg is NOT a package manager. It doesn't manage packages.

No, it is not identical to `pacman -U`. Please read more carefully...?

Edit: Added quote to eliminate ambiguity.

Last edited by Peasantoid (2009-05-03 02:21:38)

Offline

#15 2009-05-03 02:41:30

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: µpkg: Very simple package installer/remover

Releasing revision 3. Apparently, the -a and -e flags have different meanings in [ ... ].

The whole thing sorta flaked out...

Last edited by Peasantoid (2009-05-03 02:45:18)

Offline

#16 2009-05-03 03:26:07

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: µpkg: Very simple package installer/remover

Releasing revision 4. I forgot to make the uninstallation thing run its scripts.
Also adding a new package called "bfutils". It's a bunch of brainf*** utilities.

Offline

#17 2009-05-03 07:39:37

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: µpkg: Very simple package installer/remover

How would I pronounce µpkg?


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#18 2009-05-03 09:02:27

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: µpkg: Very simple package installer/remover

On a tangent, I wonder what the forum policy is concerning brainfuck. It's the proper name of the language so I wonder if you really need to self-censor. How many internet/Arch users would really be bothered by it?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#19 2009-05-03 14:21:51

Anonymo
Member
Registered: 2005-04-07
Posts: 427
Website

Re: µpkg: Very simple package installer/remover

Seems a lot like this project is heading towards:

http://www.slackware.com/config/packages.php

Last edited by Anonymo (2009-05-03 14:22:22)

Offline

#20 2009-05-03 15:42:57

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: µpkg: Very simple package installer/remover

Xyne wrote:

On a tangent, I wonder what the forum policy is concerning brainfuck. It's the proper name of the language so I wonder if you really need to self-censor. How many internet/Arch users would really be bothered by it?

Well, I don't know, but I'd rather play it safe than get banned. smile

toad wrote:

How would I pronounce µpkg?

µ is the lowercase form of the Greek letter Mu. In English, it's often used to mean "micro", so I guess you'd say "micropackage". (?)

Anonymo wrote:

Seems a lot like this project is heading towards:

http://www.slackware.com/config/packages.php

Perhaps. However, once I get all [or most] of the bugs in µpkg worked out, I plan to build a full-blown package manager called µman on top of it.

Last edited by Peasantoid (2009-05-03 15:47:32)

Offline

#21 2009-05-03 17:15:45

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: µpkg: Very simple package installer/remover

Peasantoid wrote:

µpkg is NOT a package manager. It doesn't manage packages.

huh? It installs and removes 'packages'. Sounds like a package manager to me!

No, it is not identical to `pacman -U`. Please read more carefully...?

Didn't you say you didn't even look at the documentation/man-pages for pacman?

this thread is kind of funny.

that aside, coding for no reason is fun. I have reinvented many a wheel in my time.
*wistful*

have fun with your project.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#22 2009-05-03 17:54:40

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: µpkg: Very simple package installer/remover

cactus wrote:
Peasantoid wrote:

µpkg is NOT a package manager. It doesn't manage packages.

huh? It installs and removes 'packages'. Sounds like a package manager to me!

http://en.wikipedia.org/Package_management_system

A package management system is a collection of tools to automate the process of installing, upgrading, configuring, and removing software packages from a computer.
[...]
Packages are distributions of software and metadata such as the software's full name, description of its purpose, version number, vendor, checksum, and a list of dependencies necessary for the software to run properly. Upon installation, metadata is stored in a local package database.

...not a package manager.

cactus wrote:

Didn't you say you didn't even look at the documentation/man-pages for pacman?

No, I said I didn't look over them in detail. There are a lot of instructions to follow when creating an Arch package. Not so for these.

Last edited by Peasantoid (2009-05-03 17:54:52)

Offline

#23 2009-05-03 20:24:16

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: µpkg: Very simple package installer/remover

toad wrote:

How would I pronounce µpkg?

Τhe word "μ" in Greek is pronounced "mi" (mee, like in "bee") if it's ... alone.

Offline

#24 2009-05-03 20:34:44

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: µpkg: Very simple package installer/remover

I guess it's micro pkg


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#25 2009-05-03 23:19:04

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: µpkg: Very simple package installer/remover

I've decided to make µpkg more package-manager—esque. Changes will include metadata, saving a [sort of] database of installed packages, dependencies, conflicts, versioning, and so on.
Next release will contain these features. smile

Offline

Board footer

Powered by FluxBB