Date:2010-11-22 00:55:25 (8 years 7 months ago)
Author:Werner Almesberger
Commit:a0c0e854cc5792cef05fd838c2da70668ca6cf53
Message:qpkg: option -d to enable debugging at run time, and some cleanup

- prereq.c: added section titles
- prereq.c (debug), qpkg.h, qpkg.c: made variable "debug" global and moved
it to qpkg.c
- qpkg.c (usage, main): new option -d to enable debugging
Files: qpkg/prereq.c (4 diffs)
qpkg/qpkg.c (3 diffs)
qpkg/qpkg.h (1 diff)

Change Details

qpkg/prereq.c
3939static int n_best; /* undefined if best == NULL */
4040static int n_install = 0;
4141static int install_max = 0;
42static int debug = 0;
42
43
44/* ----- Version comparison ------------------------------------------------ */
4345
4446
4547static int epoch(const char **s, const struct id *id)
...... 
100102}
101103
102104
105/* ----- List of packages considered for installation ---------------------- */
106
107
103108static void done(void)
104109{
105110    int size;
...... 
139144}
140145
141146
147/* ----- Check dependencies and conflicts ---------------------------------- */
148
149
142150static int satisfies(const struct pkg *pkg, const struct ref *ref)
143151{
144152    int cmp;
...... 
171179}
172180
173181
182/* ----- Recurse through lists and layers of dependencies ------------------ */
183
184
174185static void print_debug(const struct pkg *pkg, const struct stack *top,
175186    int level)
176187{
qpkg/qpkg.c
2626struct tree *packages = NULL;
2727struct tree *versions = NULL;
2828
29int debug = 0;
30
2931
3032static void list_all_packages(void)
3133{
...... 
115117static void usage(const char *name)
116118{
117119    fprintf(stderr,
118"usage: %s [pkg-list ...] list [pkg]\n"
119" %s [pkg-list ...] prereq pkg [version]\n"
120"usage: %s options [pkg-list ...] list [pkg]\n"
121" %s options [pkg-list ...] prereq pkg [version]\n\n"
122" -d enable debugging output\n"
120123    , name, name);
121124    exit(1);
122125}
...... 
133136        usage(*argv);
134137
135138    for (arg = 1; arg != argc; arg++) {
139        if (!strcmp(argv[arg], "-d")) {
140            debug = 1;
141            continue;
142        }
136143        if (*argv[arg] == '-')
137144            usage(*argv);
138145        if (!strcmp(argv[arg], "list")) {
qpkg/qpkg.h
5252struct tree *packages;
5353struct tree *versions;
5454
55int debug;
56
5557#endif /* !QPKG_H */

Archive Download the corresponding diff file

Branches:
master



interactive