package management discussion - Programming On Unix

Users browsing this thread: 1 Guest(s)
z3bra
Grey Hair Nixers
Now that's one topic I like to discuss !!

I wrote my own pack manager too: pm.

All it does is unpacking tarballs into a $ROOT directory, and write down all the unpacked files for easier removal. Removing a pack means deleting all files created on installation (so listed in the database file), and the database entry (just a directory in $DATA). Updating a package is as simple as removing current version, and installing a new one.

As I see it, package manager should only do that: keep track of what is installed, and their version. The rest might or might not be needed, and should thus be handled outside (check integrity, verify signature, sync repositories, list dependencies, ...).

The key feature is that because it installs to an arbitrary $ROOT, it works alongside distro-integrated package managers. I use it to install everything that is not packaged on the distro I run (crux, debian, void, openbsd), has an incorrect version for my needs, or require recompilation to be configured (eg. suckless tools). I wrote a quick shell script that runs "make; make DESTDIR=$tmp install; tar -C $tmp -cjf name@version.tbz ." to create a package ready for install. Thus needing no build recipe. I create packages interactively and install them this way.

I install everything to either /usr/local or ~/.local, depending on wether I want it global or not.

I worked on a few other tools to make it usable with external repos, but never used it. There is a repo to sync, download and cache remote packs locally. It can even use gopher:// as a hosting protocol ! You would use it like this:

Code:
# printf 'repo "https://repo.your.tld"\n' > /etc/repo.conf
# repo -s # fetch remote pack list
# pm -a -v $(repo sick)
installed sick (v1.2)

Note that for usability reasons, "pm" can call "repo" internally, so that "pm -a -v sick" would have the same effect. "repo" itself can also call "sick" internally, to verify package integrity using crypto keys, but this is well beyond scope here ☺
I think these 3 tools, each having their own purpose, and being useful on their own integrate well together, and have nothing to envy to the big names (apt, dnf, pacman, ..), besides perhaps dependency resolution.

Dependency resolution could be handled by the repo utility itself, assuming the remote pack list would list them.

Thanks for reading this far, you're an awesome person !

tl;dr
I wrote pm, sick and repo.
It features a simple package format: plain tarballs, whose only metadata is in the filename: name@version.tbz.
Installing a package unpack it to $ROOT, and store the list of installed files to $DATA/name/files. Removing files installed is as easy as "cd $ROOT; rm $(<$DATA/name/files)", which is what the pack manager does.
Updating means "remove pack + install new pack".


Messages In This Thread
package management discussion - by sth - 26-05-2020, 05:55 PM
RE: package management discussion - by z3bra - 26-05-2020, 07:00 PM
RE: package management discussion - by sth - 26-05-2020, 07:18 PM
RE: package management discussion - by z3bra - 26-05-2020, 07:35 PM
RE: package management discussion - by sth - 26-05-2020, 07:41 PM
RE: package management discussion - by sth - 26-05-2020, 09:41 PM
RE: package management discussion - by venam - 27-05-2020, 01:51 AM
RE: package management discussion - by z3bra - 27-05-2020, 03:49 PM
RE: package management discussion - by sth - 28-05-2020, 06:05 PM
RE: package management discussion - by z3bra - 28-05-2020, 08:10 PM
RE: package management discussion - by jkl - 29-05-2020, 03:58 AM
RE: package management discussion - by z3bra - 29-05-2020, 05:18 AM
RE: package management discussion - by ckester - 29-05-2020, 05:24 PM
RE: package management discussion - by movq - 31-05-2020, 02:47 AM
RE: package management discussion - by z3bra - 31-05-2020, 04:14 AM
RE: package management discussion - by sth - 31-05-2020, 05:28 PM
RE: package management discussion - by jkl - 01-06-2020, 06:06 AM
RE: package management discussion - by movq - 01-06-2020, 02:26 PM
RE: package management discussion - by eadwardus - 05-07-2020, 02:32 PM