If /etc/apk/cache is a symlink to directory, a copy of all installed
packages is stored there, and the index of remote repositories will
be there instead of /var/lib/apk. This enables to reconstruct running
system during boot.
Left as todo: remove cached copy when the package is removed, and
additional apk applet to download missing packages to cache and/or
remove extra items.
That will make the upgrade prefer packages available in repositories.
This is good if one want's to downgrade packages by removing an experimental
repository. Or to force re-install of locally built vs. repository version
when the package version are same, but checksum is different. Fixes#51.
apk --help will list the generic options only and give a list of commands
To get the details for a spefic command, 'apk command --help' should be used.
fixes#42
This will also fix a bug that left an empty file in destination dir when
source file did not exist in repository.
There are still issues with paths longer than 255 chars.
By locking all the given dependendencies for virtual packages first
we can catch invalid deps and report those. This is alot more helpful
than just reporting "Unable to install <virutalpkg>"
implements 'apk add --virutal metaname dep1 dep2...' where metaname will
be an empy meta package with dep1 and dep2 as dependencies.
This is useful to prevent abuild to add each makedepend to world which
causes some headache when it comes to unintalling them after sucessful build.
The syntax is: apk index -d /path/to/APK_INDEX.gz pkg...
It does not seem like its possible to remove packages in the db so we
trick apk_db_index_write() by setting the repo to on-zero.
It's still not perfect since it does not recalculate the dependencies.
The state size is taken from name_id and cannot be extended. So we
must wait with initializing the state til we have all packages added
to the db.
We must also always allocate the package name, incase its not in the
repository. This is done with apk_db_get_name().
This allows you to query the state db even if you do not have write
permissions in cache dir (which is needed if you have remote repositories)
This should speed up things and save some memory if you have big and slow
remote repositories.