Musl Distros - GNU/Linux

Users browsing this thread: 1 Guest(s)
z3bra
Grey Hair Nixers
pm(1) only takes local files as arguments, it is not meant to deal with external repos of some kind.
I have written two small shell script, namely repo(1) and repogen(1) to deal with remote tarball fetching or whatever. I've listed some examples in pm's README, but for all the lazy asses in there (I know there's a lot of you!), here is an idea of how it works.

Let's say you have two machines, "server" and "client". On the server, you'll have the build system of your choice, having all tarballs created under /var/www/dl.z3bra.org/releases. You'd use repogen(1) to turn this directory into a repository (it simply generate a .list file, with the name, version and checksum of all tarballs):

Code:
[root@server ~]# repogen /var/www/dl.z3bra.org/releases
bzip2   1.0.6   2df1fe882e46a1e614d0fa2c72590c2c0354923d
curl    7.42.1  be76b8b93528156fe36049ee92dd64001607b263
dash    0.5.8   3a4833d32c1c633c11bd048d6efd89cc0b7620d0
fs      0.1     3ffeef271370b629ed6a2b93023c0372fd176680
gzip    1.3.3   b82268b6ad4d86db2d11aa28352b8c20cd40a994
iproute2        3.18.0  c47b14dfda5617e3a79d491ad9e9e109c2a81ebc
mk      0.1     dd7bbbe7d7cd0f69fc44d606b94d3ef574cf3693
mksh    R50e    01119230f24f488777cff2cc46cc5aae1aecaa6a
musl    1.1.12  eaa54d777dd5d341378c1d3742b30f532e4ac653
pcc-libs        1.1.0   ada38ca8ee75e734663a0be75927df1303954c81
pcc     1.1.0   9a1b3f7fd8cad795026cf98415165dc8756d296c
sbase   0.0     c7a78f26f9d3ee92c1d43d3078e12f54c9cda6e7
ubase   0.0     73b4e3ee83b78b0ddcf14672713f3e6d11311eae

Now that you have your remote repo setup, you can sync it locally using the repo(1) utility:

Code:
[z3bra@client ~]$ export REPO=$HOME/repo
[z3bra@client ~]$ repo -s
bzip2   1.0.6   2df1fe882e46a1e614d0fa2c72590c2c0354923d
curl    7.42.1  be76b8b93528156fe36049ee92dd64001607b263
dash    0.5.8   3a4833d32c1c633c11bd048d6efd89cc0b7620d0
fs      0.1     3ffeef271370b629ed6a2b93023c0372fd176680
gzip    1.3.3   b82268b6ad4d86db2d11aa28352b8c20cd40a994
iproute2        3.18.0  c47b14dfda5617e3a79d491ad9e9e109c2a81ebc
mk      0.1     dd7bbbe7d7cd0f69fc44d606b94d3ef574cf3693
mksh    R50e    01119230f24f488777cff2cc46cc5aae1aecaa6a
musl    1.1.12  eaa54d777dd5d341378c1d3742b30f532e4ac653
pcc-libs        1.1.0   ada38ca8ee75e734663a0be75927df1303954c81
pcc     1.1.0   9a1b3f7fd8cad795026cf98415165dc8756d296c
sbase   0.0     c7a78f26f9d3ee92c1d43d3078e12f54c9cda6e7
ubase   0.0     73b4e3ee83b78b0ddcf14672713f3e6d11311eae

Syncing the repository will NOT download all the tarballs. That would be a huge waste of time. You can list the content of your local repo with "repo -l". This will give the same output as when you sync the repo, minus the checksums.
To actually download a tarball, simply run repo(1) with the name of the pack you want. Once done, the full path to the tarball will be printed to stdout:

Code:
[z3bra@client ~]$ repo dash
/home/z3bra/repo/dash:0.5.8.tar.bz2
[z3bra@client ~] tree $REPO
/home/z3bra/repo
├── dash:0.5.8.tar.bz2
└── .list

If you call the command again, repo will check the tarball's checksum against its local .list file, and if they match, will output the full path again to stdout, without redownloading the file (this makes sense right?)
You can then use repo's output to feed pm(1) without having to know where the tarballs are located:

Code:
[z3bra@client ~]$ pm -a $(repo dash)

is equivalent to:

Code:
[z3bra@client ~]$ repo dash
/home/z3bra/repo/dash:0.5.8.tar.bz2
[z3bra@client ~]$ pm -a /home/z3bra/repo/dash:0.5.8.tar.bz2

At some point, I'll try to make pm read path from stdin, leading to a simpler way to install tarballs ;)
Repo can already read pack names from stdin, leading to some neat one liners! For example, to download all packs except the libraries, you can run the following:

Code:
[z3bra@client ~]$ repo -s | grep -v 'lib' | cut -f1 | repo
/home/z3bra/repo/bzip2:1.0.6.tar.bz2
/home/z3bra/repo/curl:7.42.1.tar.bz2
/home/z3bra/repo/dash:0.5.8.tar.bz2
/home/z3bra/repo/fs:0.1.tar.bz2
/home/z3bra/repo/gzip:1.3.3.tar.bz2
/home/z3bra/repo/iproute2:3.18.0.tar.bz2
/home/z3bra/repo/mk:0.1.tar.bz2
/home/z3bra/repo/mksh:R50e.tar.bz2
/home/z3bra/repo/musl:1.1.12.tar.bz2
/home/z3bra/repo/pcc:1.1.0.tar.bz2
/home/z3bra/repo/sbase:0.0.tar.bz2
/home/z3bra/repo/ubase:0.0.tar.bz2

Note that this is still a work in progress, which is why I didn't commit neither repo(1) nor repogen(1). I'm still trying to figure out how they should work, and what the workflow should be.
If you're interrested in giving it a shot, and reporting some points that might be awkward or incoherent, just ask and I'll paste the scripts ;)


Messages In This Thread
Musl Distros - by xikuuky - 27-12-2015, 05:01 AM
RE: Musl Distros - by xikuuky - 27-12-2015, 06:02 AM
RE: Musl Distros - by Houseoftea - 27-12-2015, 12:55 PM
RE: Musl Distros - by sth - 27-12-2015, 01:41 PM
RE: Musl Distros - by z3bra - 28-12-2015, 04:22 AM
RE: Musl Distros - by xikuuky - 28-12-2015, 06:49 AM
RE: Musl Distros - by z3bra - 28-12-2015, 08:46 AM
RE: Musl Distros - by xikuuky - 28-12-2015, 11:27 AM
RE: Musl Distros - by Houseoftea - 29-12-2015, 10:55 AM
RE: Musl Distros - by z3bra - 29-12-2015, 01:48 PM
RE: Musl Distros - by Houseoftea - 29-12-2015, 03:03 PM
RE: Musl Distros - by xikuuky - 29-12-2015, 04:48 PM
RE: Musl Distros - by z3bra - 29-12-2015, 05:11 PM
RE: Musl Distros - by xikuuky - 30-12-2015, 01:49 AM
RE: Musl Distros - by xikuuky - 30-12-2015, 12:21 PM
RE: Musl Distros - by z3bra - 30-12-2015, 09:13 PM
RE: Musl Distros - by Houseoftea - 30-12-2015, 09:52 PM
RE: Musl Distros - by z3bra - 31-12-2015, 05:21 AM
RE: Musl Distros - by z3bra - 07-01-2016, 08:28 PM
RE: Musl Distros - by apk - 07-01-2016, 10:32 PM
RE: Musl Distros - by z3bra - 08-01-2016, 08:35 AM
RE: Musl Distros - by apk - 08-01-2016, 01:09 PM
RE: Musl Distros - by z3bra - 15-01-2016, 08:51 AM
RE: Musl Distros - by venam - 16-01-2016, 03:52 AM
RE: Musl Distros - by XcelQ - 24-01-2016, 01:10 PM
RE: Musl Distros - by z3bra - 09-02-2016, 07:56 AM
RE: Musl Distros - by venam - 09-02-2016, 09:52 AM
RE: Musl Distros - by z3bra - 09-02-2016, 10:00 AM
RE: Musl Distros - by z3bra - 15-06-2017, 06:22 AM
RE: Musl Distros - by jkl - 15-06-2017, 09:13 AM
RE: Musl Distros - by Pieces Of Quiet - 15-06-2017, 02:16 PM
RE: Musl Distros - by jkl - 07-02-2018, 08:20 AM
RE: Musl Distros - by z3bra - 07-02-2018, 11:38 AM
RE: Musl Distros - by evbo - 07-02-2018, 01:24 PM
RE: Musl Distros - by jkl - 07-02-2018, 04:43 PM
RE: Musl Distros - by z3bra - 07-02-2018, 07:20 PM
RE: Musl Distros - by jkl - 07-02-2018, 07:23 PM
RE: Musl Distros - by evbo - 07-02-2018, 08:24 PM
RE: Musl Distros - by z3bra - 08-02-2018, 04:51 AM
RE: Musl Distros - by jkl - 08-02-2018, 04:53 PM