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
66
77- handle Provides:
88
9  Update: Provides data is now parsed and properly integrated in the
10  package database, but not yet used to resolve prerequisites.
11
912- sort prerequisites such that they can be installed in the specified order
1013
1114- consider Architecture:
qpkg/fixup.c
4242                    (*b)->more = tmp;
4343                }
4444}
45
46
47void 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
1414#define FIXUP_H
1515
1616void sort_versions(void);
17void complete_provisions(void);
1718
1819#endif /* !FIXUP_H */
qpkg/gobble.c
321321    goto skip_data;
322322
323323provides:
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;
326331
327332status:
328333    pkg->flags |= QPKG_INSTALLED;
qpkg/pkg.c
3030    jrb->val = pkg;
3131    pkg->version = NULL;
3232    pkg->arch = NULL;
33    pkg->conflicts = pkg->depends = NULL;
33    pkg->conflicts = pkg->depends = pkg->provides = NULL;
3434    pkg->filename = NULL;
3535    pkg->flags = 0;
3636    pkg->mark = 0;
...... 
5555{
5656    free_refs(pkg->conflicts);
5757    free_refs(pkg->depends);
58    free_refs(pkg->provides);
5859    free(pkg);
5960}
qpkg/pkg.h
1919
2020
2121enum flags {
22    /* parse-time flags */
22    /* parse-time and fixup-time flags */
2323    QPKG_INSTALLED = 1 << 0, /* installed on target */
24    QPKG_PROVIDED = 1 << 1, /* virtual package */
2425
2526    /* run-time flags */
2627    QPKG_ADDING = 1 << 10, /* resolving dependencies */
...... 
4748    const char *arch;
4849    struct ref *conflicts;
4950    struct ref *depends;
51    struct ref *provides;
5052    const char *filename;
5153    int flags; /* see enum flags */
5254    struct pkg *more;
qpkg/qpkg.c
121121static void do_fixups(void)
122122{
123123    sort_versions();
124    complete_provisions();
124125}
125126
126127

Archive Download the corresponding diff file

Branches:
master



interactive