Werner's Miscellanea
Sign in or create your account | Project List | Help
Werner's Miscellanea Commit Details
Date: | 2010-11-22 23:30:09 (13 years 4 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | 9d208dd855d2181f0369da5f81f0c8ceceac7c8d |
Message: | qpkg: added parsing and recording of Provides data - pkg.h (enum flags): new flags QPKG_PROVIDED to indicate that the package is only a provision, not an installable package - fixup.h, fixup.c (complete_provisions): search for provisions that do not have a real package associated with them, create a package for them, and mark it as QPKG_PROVIDED - qpkg.c (do_fixups): invoke complete_provisions - pkg.h (struct pkg): add list of (virtual or real) packages a given package provides - pkg.c (new_pkg): initialize pkg->provides - pkg.c (free_pkg): deallocate pkg->provides - gobble.c (gobble_buf): parse the list of packages a package provides - TODO: updated status of Provides support |
Files: |
qpkg/TODO (1 diff) qpkg/fixup.c (1 diff) qpkg/fixup.h (1 diff) qpkg/gobble.c (1 diff) qpkg/pkg.c (2 diffs) qpkg/pkg.h (2 diffs) qpkg/qpkg.c (1 diff) |
Change Details
qpkg/TODO | ||
---|---|---|
6 | 6 | |
7 | 7 | - handle Provides: |
8 | 8 | |
9 | Update: Provides data is now parsed and properly integrated in the | |
10 | package database, but not yet used to resolve prerequisites. | |
11 | ||
9 | 12 | - sort prerequisites such that they can be installed in the specified order |
10 | 13 | |
11 | 14 | - consider Architecture: |
qpkg/fixup.c | ||
---|---|---|
42 | 42 | (*b)->more = tmp; |
43 | 43 | } |
44 | 44 | } |
45 | ||
46 | ||
47 | void complete_provisions(void) | |
48 | { | |
49 | struct jrb *n; | |
50 | ||
51 | for (n = jrb_first(packages->root); n != jrb_nil(packages->root); | |
52 | n = jrb_next(n)) | |
53 | if (!n->val) | |
54 | new_pkg(n)->flags |= QPKG_PROVIDED; | |
55 | } |
qpkg/fixup.h | ||
---|---|---|
14 | 14 | #define FIXUP_H |
15 | 15 | |
16 | 16 | void sort_versions(void); |
17 | void complete_provisions(void); | |
17 | 18 | |
18 | 19 | #endif /* !FIXUP_H */ |
qpkg/gobble.c | ||
---|---|---|
321 | 321 | goto skip_data; |
322 | 322 | |
323 | 323 | provides: |
324 | /* @@@ later */ | |
325 | goto skip_data; | |
324 | anchor = &pkg->provides; | |
325 | /* | |
326 | * There should never be a version in the provisions, so it's a bit | |
327 | * wasteful to use a structure that has a version field. But then, code | |
328 | * reuse is nice, too. | |
329 | */ | |
330 | goto list_with_version; | |
326 | 331 | |
327 | 332 | status: |
328 | 333 | pkg->flags |= QPKG_INSTALLED; |
qpkg/pkg.c | ||
---|---|---|
30 | 30 | jrb->val = pkg; |
31 | 31 | pkg->version = NULL; |
32 | 32 | pkg->arch = NULL; |
33 | pkg->conflicts = pkg->depends = NULL; | |
33 | pkg->conflicts = pkg->depends = pkg->provides = NULL; | |
34 | 34 | pkg->filename = NULL; |
35 | 35 | pkg->flags = 0; |
36 | 36 | pkg->mark = 0; |
... | ... | |
55 | 55 | { |
56 | 56 | free_refs(pkg->conflicts); |
57 | 57 | free_refs(pkg->depends); |
58 | free_refs(pkg->provides); | |
58 | 59 | free(pkg); |
59 | 60 | } |
qpkg/pkg.h | ||
---|---|---|
19 | 19 | |
20 | 20 | |
21 | 21 | enum flags { |
22 | /* parse-time flags */ | |
22 | /* parse-time and fixup-time flags */ | |
23 | 23 | QPKG_INSTALLED = 1 << 0, /* installed on target */ |
24 | QPKG_PROVIDED = 1 << 1, /* virtual package */ | |
24 | 25 | |
25 | 26 | /* run-time flags */ |
26 | 27 | QPKG_ADDING = 1 << 10, /* resolving dependencies */ |
... | ... | |
47 | 48 | const char *arch; |
48 | 49 | struct ref *conflicts; |
49 | 50 | struct ref *depends; |
51 | struct ref *provides; | |
50 | 52 | const char *filename; |
51 | 53 | int flags; /* see enum flags */ |
52 | 54 | struct pkg *more; |
qpkg/qpkg.c | ||
---|---|---|
121 | 121 | static void do_fixups(void) |
122 | 122 | { |
123 | 123 | sort_versions(); |
124 | complete_provisions(); | |
124 | 125 | } |
125 | 126 | |
126 | 127 |
Branches:
master