Ok I uploaded the package here:

http://home.tiscali.no/natanael/software/apk-tools/apk-tools-0.0.1_unstable_beta3.tar.gz

Just a warning: this *will* break things for you. use:

export ROOT=/some/where

and you should be pretty safe, all the packages will be handeled
relative $ROOT. But I don't guarantee anything. Myself test it in a RAM
environment in vmware.

On Fri, 2005-05-06 at 23:33 +0200, Eric Spakman wrote:
> Hello Natanael,
> 
> Very interesting!
> Can you tell something more about the metadata, how is it stored in a
> RAM based system?

The metadata is some files that are compressed to a tar.gz archive. The
compressed files are very similar to lrp, maybe different names, added a
file for sha1 sums and a .backup list.

Here is an example:

Those files are inside the .apk files.
-rw-r--r-- root/root       409 2005-05-06 18:39:07 
./var/lib/apkdb/dnrd-2.19.control
-rw-r--r-- root/root         0 2005-05-06 18:39:07 
./var/lib/apkdb/dnrd-2.19.backuplist

The package is dnrd version 2.19.

The control list contains maintainer, package details, dependencies,
license etc etc. Basicly whatever you want. The format is similar to
debian.

the backuplist is supposed to just be a filelist for tar backups.

before dnrd is installed apk_add will just dump the contents (tar
-ztf ...) of the dnrd-1.19.apk file to
$ROOT/var/lib/apkdb/dnrd-2.19.list, it will look for a pre-install
script and unpack and execute it, unpack the entire package and finaly
just "tar -czf dnrd-2.19.meta.tar.gz dnrd-2.19.*" before removing the
uncompressed meta files.


> Is it recreated every time the system boots?

Yes, that means, only the .control file is needed to be stored inside
the package. License info, web page, dependencies etc.

> How much memory does this metedata take, both running and storage.

its a filelist + license info, general package info etc in a compressed
tar.gz file. When managing the package the metadata file is extracted.
Here is the apk_info -L code:

pkg_listfiles() {
    local opwd pkgv
    opwd=`pwd`
    pkgv=$1
    cd ${APKDB}
    tar -zxf ${pkgv}.meta.tar.gz -O ${pkgv}.list
    cd $opwd
}

So, its smaller than the lrp meta data.

> Also note that there are a lot of lrp packages, could or is this
> system backwards compatible with the existing packages?

No, but is should be pretty easy to write a script that converted the
packages in one shot. Myself is converting gentoo-embedded binary
packages.

I don't know if the lrp's is using *exclude.list files? That has caused
alot of problems for me/us so that is completely unsupported.

A convertscript would look something like:

cconvert() {
        pkg=$1
        mkdir $tmp/$pkg
        tar -C $tmp/$pkg -zxf $pkg.lrp
        cd $tmp/pkg
        mv var/lib/lrpkg var/lib/apkdb
        version=`find_version`
        pkgv="$pkg-$version"
        convert_meta $pkgv
        tar -czf $destdir/$pkgv.apk *
}

You get the idea...

I have a 91MB demo iso, running from RAM, bur I have nowhere to upload
it.

> Eric Spakman
> 
> 
> >I would like to tell you guys that im working on a package manager that
> >you might be interested in.
> >
> >It is very similar to apkg (the Nathan Angelacos modified one) and is
> >actually originally designed to be a replacement for apkg.
> >
> >I call it apk-tools.
> >
> >It is inspired by apkg and BSD packages. It is supposed to have the
> >simplicity of apkg (basicly a tar.gz package with some extra metadata),
> >run on RAM based mini linux, shell based (im using busybox), doing
> >backups for local configs, but at the same time has almost the same
> >power as bsd's packages with recursion, http repositories, pre/post
> >install scripts etc etc.
> >
> >The metadata is very similar apkg, vith some files in /var/lib/apkdb.
> >The difference is that files are compressed into
> >a /var/lib/apkdb/package-version.meta.tar.gz format. I chosed to
> >compress it since I have heard of problems with too big meta data on
> >apkg systems.
> >
> >the tools are similar to pkg_add with friends in bsd:
> >apk_add
> >apk_delete
> >apk_info
> >
> >Here is an example how they are used:
> >
> >~ # apk_info -h
> >apk_info 0.0.1_unstable_beta3
> >Usage: apk_info [ -a | -h ] | [-L | -c ] PACKAGE
> >  -a     List all installed packages
> >  -h     Display this help
> >  -L     List contents of PACKAGE
> >  -c     Check sha1 sums of package
> >
> >Lets see whats installed.
> >
> >~ # apk_info
> >openssh-4.0_p1
> >openssl-0.9.7e
> >zlib-1.2.2
> >
> >Lets add a package file.
> >
> >~ # mount /media/cdrom/
> >~ # apk_add /media/cdrom/pkgs/dnrd-2.19.apk
> >~ # apk_info
> >dnrd-2.19
> >openssh-4.0_p1
> >openssl-0.9.7e
> >zlib-1.2.2
> >
> >Lets see the contents of installed package.
> >
> >~ # apk_info -L dnrd
> >.
> >./var
> >./var/lib
> >./var/lib/apkdb
> >./var/lib/apkdb/dnrd-2.19.control
> >./var/lib/apkdb/dnrd-2.19.backuplist
> >./usr
> >./usr/sbin
> >./usr/sbin/dnrd
> >./etc
> >
> >Lets check the sha1sums.
> >
> >~ # apk_info -c dnrd
> >./var/lib/apkdb/dnrd-2.19.control: OK
> >./var/lib/apkdb/dnrd-2.19.backuplist: OK
> >./usr/sbin/dnrd: OK
> >
> >Lets try to modify some files.
> >
> >~ # echo "distortion" > /usr/sbin/dnrd
> >~ # apk_info -c dnrd
> >./var/lib/apkdb/dnrd-2.19.control: OK
> >./var/lib/apkdb/dnrd-2.19.backuplist: OK
> >./usr/sbin/dnrd: FAILED
> >sha1sum: WARNING: 1 of 3 computed checksums did NOT match
> >
> >Remove package.
> >
> >~ # apk_delete dnrd-2.19
> >
> >Lets use a cdrom repository.
> >
> >~ # umount /media/cdrom
> >~ # export APK_PATH=cdrom:/pkgs
> >
> >Note that the -r is used.
> >
> >~ # apk_add -rv netcat
> >Installing netcat-110-r7
> >~ # apk_info
> >netcat-110-r7
> >openssh-4.0_p1
> >openssl-0.9.7e
> >zlib-1.2.2
> >
> >Lets use a http repository.
> >
> >~ # export APK_PATH=http://192.168.65.250/alpine/apk
> >
> >and let us install a bunch of packages.
> >
> >~ # apk_add -rv dnrd haserl libpcap tcpdump
> >Downloading http://192.168.65.250/alpine/apk/Packages.sha1.gz
> >Connecting to 192.168.65.250[192.168.65.250]:80
> >Packages.sha1.gz     100% |*****************************| 11220
> >00:00 ETA
> >Downloading http://192.168.65.250/alpine/apk/dnrd-2.19.apk
> >Connecting to 192.168.65.250[192.168.65.250]:80
> >dnrd-2.19.apk        100% |*****************************| 22850
> >00:00 ETA
> >dnrd-2.19.apk: OK
> >Downloading http://192.168.65.250/alpine/apk/haserl-0.7.3.apk
> >Connecting to 192.168.65.250[192.168.65.250]:80
> >haserl-0.7.3.apk     100% |*****************************| 19823
> >00:00 ETA
> >haserl-0.7.3.apk: OK
> >Downloading http://192.168.65.250/alpine/apk/libpcap-0.8.3-r1.apk
> >Connecting to 192.168.65.250[192.168.65.250]:80
> >libpcap-0.8.3-r1.apk 100% |*****************************| 61345
> >00:00 ETA
> >libpcap-0.8.3-r1.apk: OK
> >Downloading http://192.168.65.250/alpine/apk/tcpdump-3.8.3-r1.apk
> >Connecting to 192.168.65.250[192.168.65.250]:80
> >tcpdump-3.8.3-r1.apk 100% |*****************************|   173 KB
> >00:00 ETA
> >tcpdump-3.8.3-r1.apk: OK
> >Installing dnrd-2.19
> >Installing haserl-0.7.3
> >Installing libpcap-0.8.3-r1
> >Installing tcpdump-3.8.3-r1
> >
> >I have manually changed a package on http server so we can test sha som
> >on packages. Also note that the package "database", Packages.sha1.gz is
> >not downloaded this time. The cached version is used. This file is
> >simply a compressed sha1sum list.
> >
> >~ # apk_add -rv ipsec-tools
> >Downloading http://192.168.65.250/alpine/apk/ipsec-tools-0.4.apk
> >Connecting to 192.168.65.250[192.168.65.250]:80
> >ipsec-tools-0.4.apk  100% |*****************************|     5
> >00:00 ETA
> >ipsec-tools-0.4.apk: FAILED
> >sha1sum: WARNING: 1 of 1 computed checksums did NOT match
> >Checksum failed for ipsec-tools!
> >
> >Let me know if you are interested. I don't have any official hosting
> >site nor cvs, so I'd need to upload what I got so far somehwere if you
> >are interested to take a look at it.
> >
> >Next thing to do is test the ftp:/ module and write a ssh:/, rsync:/ and
> >file:/ module for repositries on other protocols. Those modules are easy
> >to write so there is nothing that prevents a nfs:/ whatever:/ module.
> >
> >The -r option is supposed to fetch dependencies but that need some work
> >still.
> >
> >I have also an apk_backup utility on my todolist for backing up local
> >configs.
> >
> >--
> >Natanael Copa
> >
> >
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by: NEC IT Guy Games.
> >Get your fingers limbered up and give it your best shot. 4 great events, 4
> >opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
> >win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
> >
> >_______________________________________________
> >leaf-devel mailing list
> >[email protected]
> >https://lists.sourceforge.net/lists/listinfo/leaf-devel
> >
> >
> 



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20

_______________________________________________
leaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to