diff --git a/qpkg/gobble.c b/qpkg/gobble.c index dfcbb64..3c9dfa4 100644 --- a/qpkg/gobble.c +++ b/qpkg/gobble.c @@ -134,8 +134,7 @@ initial: switch (NEXT) { case 'r': EXPECT("chitecture:"); - /* @@@ use later */ - goto skip_data; + goto architecture; case 'u': EXPECT("to-Installed:"); goto skip_data; @@ -290,6 +289,7 @@ package: pkg->more = jrb->val; jrb->val = pkg; pkg->version = NULL; + pkg->arch = NULL; pkg->conflicts = pkg->depends = NULL; pkg->filename = NULL; pkg->flags = 0; @@ -303,6 +303,13 @@ version: pkg->version = ID(versions)->key; goto eol; +architecture: + WHITESPACE; + if (pkg->arch) + FAIL; + pkg->arch = buf; + goto skip_data; + provides: /* @@@ later */ goto skip_data; @@ -314,6 +321,8 @@ status: filename: WHITESPACE; + if (pkg->filename) + FAIL; pkg->filename = buf; goto skip_data; diff --git a/qpkg/qpkg.c b/qpkg/qpkg.c index f79dc51..ee9faca 100644 --- a/qpkg/qpkg.c +++ b/qpkg/qpkg.c @@ -126,10 +126,12 @@ int main(int argc, char **argv) { int arg; - if (argc == 1) - usage(*argv); packages = make_tree(comp_id); versions = make_tree(comp_id); + + if (argc == 1) + usage(*argv); + for (arg = 1; arg != argc; arg++) { if (*argv[arg] == '-') usage(*argv); diff --git a/qpkg/qpkg.h b/qpkg/qpkg.h index 97d3b5b..a554577 100644 --- a/qpkg/qpkg.h +++ b/qpkg/qpkg.h @@ -35,6 +35,7 @@ struct ref { struct pkg { struct id *id; struct id *version; + const char *arch; struct ref *conflicts; struct ref *depends; const char *filename;