1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 04:33:08 +02:00

qpkg: record Architecture: tag

- qpkg.h (struct pkg): added "arch" field for the architecture
- gobble.c (gobble_buf): record the architecture
- gobble.c (gobble_buf): fail if trying to set the file name twice
- qpkg.c (main): initialize trees before doing anything else, so that the
  argument processing stays together
This commit is contained in:
Werner Almesberger 2010-11-21 03:53:19 -03:00
parent dd0ee66304
commit f14c041e51
3 changed files with 16 additions and 4 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;