Commit Graph

209 Commits (2ea61da9d99a64aa0358b9186447310c98de9a77)

Author SHA1 Message Date
Timo Teräs 1f9a36de68 db: support line feed as 'world' dependency separator
* default writing the world with spaces if a space is found
   (for backwards compatibility) for now
2012-01-12 14:33:29 +02:00
Timo Teräs 30965aa867 solver: print repository tag when committing package changes 2012-01-12 11:33:04 +02:00
Timo Teräs f1de353b81 db, solver: refuse committing changes if there is missing tags 2012-01-12 10:42:27 +02:00
Timo Teräs 3e8dc3da09 db: properly detect when pkg install trigger needs executing
call apk_pkg_install() and hlist_tail_ptr() only once. the latter
is O(n) and can get very slow.
2012-01-06 10:35:04 +02:00
Timo Teräs 34756e6b87 solver: report number of (mega)bytes used 2011-12-27 14:06:03 +02:00
Timo Teräs 500f8d4a7d solver, db: implement repository pinning
Improves /etc/apk/repositories format so you can say:
http://nl.alpinelinux.org/alpine/v2.3/main
@edge http://nl.alpinelinux.org/alpine/edge/main
@testing http://nl.alpinelinux.org/alpine/edge/testing

After which you can pin dependencies to these tags using:
 apk add stableapp newapp@edge bleedingapp@testing

Apk will now by default only use the untagged repositories,
but adding a tag to specific dependency:
 1. will prefer that tag for the name
 2. allowing pulling in dependencies from that tag (though,
    it prefers untagged packages to satisfy deps if possible)

fixes #575
2011-10-29 05:18:21 +03:00
Timo Teräs 8d4d68d818 pkg: convert struct apk_install_package flags to bitfield 2011-10-19 15:26:55 -04:00
Timo Teräs 89d003f8c2 pkg: introduce "replaces_priority"
If two packages replace each other, the one with highes priority
will keep the file. Additionally, if we have a package overriding
another's file it's remembered and handled properly. This is
essentially to allow "policy packages" which just overwrite certain
(configuration) files from other package(s).
2011-10-19 11:38:23 -04:00
Timo Teräs a787038dbe pkg, info: remember installed packages "replaces"
"replaces" is now turned to a full dependency type list, so you can
make package overwrite files only certain versions of the package
(though, we should probably take this into account already at solution
calculation phase).

Also make 'info --replaces' print the "replaces" of the package.

This is in preparation for the policy package support, which still
requires "replacement priority" field to decide which packages' files
get the preference.
2011-10-18 18:11:26 -04:00
Timo Teräs e34d2ed5fd solver, db: run triggers in dependency order
fixes #738
2011-09-14 11:30:35 +03:00
Timo Teräs 1817b0a3c3 all: update copyright year statement 2011-09-13 11:53:01 +03:00
Timo Teräs a5a7021658 applets: start using solver code
still todo:
  - 'fix' is missing
  - 'del -R' does not work
  - 'upgrade' does not do self-upgrade first

... and a lot of testing.
2011-09-09 16:32:31 +03:00
William Pitcock 37a682e560 apk_database: move APK_DEFAULT_ARCH to headers so that we can use it in version(). 2011-07-16 04:28:41 -05:00
Timo Teräs 433da92e37 index: handle errors instead of silently failing
Make indexer keep noise about errors that prevent index generation.
Detect certain errors in the APKs better. And also have the applet
return error in these scenarios.
2011-06-28 15:40:52 +03:00
Timo Teräs 95555ede4d db: more fix for read-only cache remounting
remount to read-write before trying to create the cache directory
subdirs. fix a fd leak that might prevent remounting back to rw.
2011-05-27 16:49:25 +03:00
Natanael Copa 38e54240a3 db: remount read-only after the file handles have been closed
The apk cache might be on the readonly media so we need wait with
remounting til after atleast this filehandle is closed.
2011-05-27 11:38:50 +00:00
Timo Teräs c5de3cdc4c db: fix post-install script error message formatting 2011-05-23 15:32:32 +03:00
Timo Teräs 9901058891 db: remount ro cache to rw earlier for update to work 2011-04-22 11:24:33 +03:00
Natanael Copa cec1fa2b0f db: Allow override arch when using --root
This is so we can do x86 --root installs on x86_64 hosts.

Using --arch without --root can make great damage so we only enable it
if --root is used.
2011-04-14 19:59:01 +00:00
Timo Teräs 91c4cc6c18 fetch: fix fetching of packages with arch 2011-04-07 14:14:27 +03:00
Timo Teräs 8e01be4777 apk: fix gcc 4.6 warnings 2011-03-27 02:51:51 +02:00
Timo Teräs 93eb38a31a db: relocate from /var/lib/apk
move all files therein to other places. this allows /var to be
mounted from harddisk, but rest of system be run from ramdisk.

this also removes support for historical version of the scripts
database which was obsoleted in 2.0_pre16 (in July 2009).
2011-03-16 16:53:07 +02:00
Timo Teräs 2222a15edd db: move lock file to /var/lock
in accordance with FSH. this also to clear /var of apk related things
as we might want to run /var as harddisk, but rest of system from
ramdisk.
2011-03-16 15:39:36 +02:00
Timo Teräs 5d64bc5d8c db: fix cache tmpfs detection
comment out the code that was out for testing. duh.
2011-03-16 15:21:41 +02:00
Timo Teräs 415e230a7f db, cache: automatically remount cache read-write when needed
.. and back to read-only after finishing with modifications.

fixes #512
2011-03-16 14:56:13 +02:00
Timo Teräs 1e17da9d70 db: handle arch similarly to stable branch
if package arch is not set, do not append anything to repository.
if arch is set, it is appended to repository.
2011-03-16 14:56:13 +02:00
Timo Teräs 15badbfd97 db: detect tmpfs better
Use statfs() filesystem type, instead of the device IDs.
2011-03-16 14:56:13 +02:00
Timo Teräs 1c6ab67984 db: fix package caching 2011-01-21 09:37:19 +02:00
Timo Teräs 0e450c5fb6 add: use default arch instead of noarch, improve errors
Packages without architecture should get the platforms default
architecture (so we are backwards compatible). Only the virtual
packages should get 'noarch' by default. Also print full path
to the index file which failed.
2011-01-05 14:33:16 +02:00
Timo Teräs 94ce7f01bf db: check and initiailize required package fields before addition to db
The atomization change broke virtual packages because they don't
have license or arch set.
2011-01-04 11:45:34 +02:00
Timo Teräs 28dcd5d3b3 pkg: recognize install_if
Parse install_if from package metadata and include it in the
indexes. Also setup the reverse install_if dependencies when
loading a database. ref #443.

Actual install_if functionality is not yet implemented.
2011-01-04 10:05:20 +02:00
Timo Teräs d8ba07e484 pkg, db: allow index with unsupported features to be loaded
Just disable installation of packages using the new stuff. Also
flag lower case package info fields as non-critical and allow
installation even if that features is not supported.
2011-01-03 21:06:41 +02:00
Timo Teräs 972bec3210 various: use 'atoms' for certain package field and misc fixes
- implement a hash table for commonly shared fields such as
   license, version and architecture
 - use macroes to print blobs or pkgname-pkgver strings
 - fix some old cruft
2010-12-14 19:51:16 +02:00
Timo Teräs fca1c30b80 pkg, db: add preliminary support for arch field
Architecture is now:
 - parsed from .PKGINFO
 - written to index and installed db
 - appended to repository URL when fetching files
2010-12-14 17:06:29 +02:00
Timo Teräs 6e34f048c7 db: remove support for unsigned repository index
Unsigned indexes should not be needed anymore anyway.
2010-12-10 16:42:25 +02:00
Timo Teräs 6e89c1d5b7 db: print full url/filename of the failing package
.. instead of the pkgname-pkgver string.
2010-12-09 11:10:12 +02:00
Timo Teräs 6398d338c6 db: fix the previous commit
id cache needs to be initialized early. and group database filename
is surprisingly 'group'.
2010-10-08 16:09:03 +03:00
Timo Teräs 19419f1a88 io, db: id cache should be specific to database root, not system root
Otherwise we end up using wrong uid/gid mappings when doing install
to alternate system root. Fixes #434.
2010-10-08 15:36:54 +03:00
Natanael Copa 5c4583a902 db: optionally remove dirs when unref
We want remove dirs when they are unreferenced so we remove all dirs on
apk del, but we don't want remove dirs when closing database. So we make
removing dir optional when unreferencing it.

This partially reverts commit c7ffc96a16.

fixes #406
2010-09-22 14:34:35 +00:00
Natanael Copa b4adf7645f Fix building on eglibc
Seems like recent eglibc requires that you include sys/stat.h
2010-08-30 13:04:25 +00:00
Timo Teräs ec6359732d db: reinitialize trigger_pkg_list node after deletion
The trigger list can be reused after it's cleared, make sure
the list node is initialized all the time.
2010-06-15 14:40:46 +03:00
Timo Teräs 8b317678e3 db: --simulate never needs write access to db
So open the db in read-only mode instead. This allows --simulate to
be run as non-root user.
2010-06-12 13:48:42 +03:00
Timo Teräs 43cb554c3f various: use O_CLOEXEC and add some error checking 2010-06-11 13:42:21 +03:00
Natanael Copa 36d1bfb4ed db: make apk_wait a part of dbopts 2010-06-11 07:02:18 +00:00
Natanael Copa 3ec82a5a42 First steps for libapk 2010-06-11 07:02:18 +00:00
Natanael Copa 60b537e356 db: do not free trigger list after package is unpacked
The triggers are read during apk_db_unpack_pkg(). If we delete the
triggers list after then unpack we delete the triggers which is not
what we want.

This fixes bug introduced in ce3cf8bff9
2010-06-10 17:50:11 +00:00
Timo Teräs f85d87e5f9 db: fix usage of apk_name_array in install_ctx
got broken to the previous array cleanup and grepping struct
definition only from headers.
2010-06-07 17:45:04 +03:00
Timo Teräs 7be853e637 all: rework how arrays work
Instead of having a null pointer, use a dummy array which just
says the array is empty. This helps in multiple places of the code
which would otherwise need explicitly need to check first if the
array exists. This has been cause of multiple seg.faults in the
past as the array check is easily omitted.

This also removes (or fixes) all existing checks accordingly.
2010-06-05 12:33:54 +03:00
Timo Teräs ce3cf8bff9 db, pkg: fix triggers related crash
clean up the triggers properly, in proper order.
2010-06-01 16:46:53 +03:00
Timo Teras ef7d467083 fetch: do not include installed non-repository files in search
we do not create mirror repositories from other valid repositories,
not from what was installed locally.
2010-03-04 14:01:37 +02:00