2 * Copyright (c) 2007, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
11 * convert rpm db to repo
15 #include <sys/types.h>
29 #include "repo_rpmdb.h"
31 #include "tools_util.h"
35 #define TAG_VERSION 1001
36 #define TAG_RELEASE 1002
37 #define TAG_EPOCH 1003
38 #define TAG_SUMMARY 1004
39 #define TAG_DESCRIPTION 1005
40 #define TAG_BUILDTIME 1006
42 #define TAG_VENDOR 1011
43 #define TAG_GROUP 1016
45 #define TAG_FILESIZES 1028
46 #define TAG_FILEMODES 1030
47 #define TAG_PROVIDENAME 1047
48 #define TAG_REQUIREFLAGS 1048
49 #define TAG_REQUIRENAME 1049
50 #define TAG_REQUIREVERSION 1050
51 #define TAG_CONFLICTFLAGS 1053
52 #define TAG_CONFLICTNAME 1054
53 #define TAG_CONFLICTVERSION 1055
54 #define TAG_OBSOLETENAME 1090
55 #define TAG_PROVIDEFLAGS 1112
56 #define TAG_PROVIDEVERSION 1113
57 #define TAG_OBSOLETEFLAGS 1114
58 #define TAG_OBSOLETEVERSION 1115
59 #define TAG_DIRINDEXES 1116
60 #define TAG_BASENAMES 1117
61 #define TAG_DIRNAMES 1118
62 #define TAG_SUGGESTSNAME 1156
63 #define TAG_SUGGESTSVERSION 1157
64 #define TAG_SUGGESTSFLAGS 1158
65 #define TAG_ENHANCESNAME 1159
66 #define TAG_ENHANCESVERSION 1160
67 #define TAG_ENHANCESFLAGS 1161
69 #define DEP_LESS (1 << 1)
70 #define DEP_GREATER (1 << 2)
71 #define DEP_EQUAL (1 << 3)
72 #define DEP_STRONG (1 << 27)
73 #define DEP_PRE ((1 << 6) | (1 << 9) | (1 << 10) | (1 << 11) | (1 << 12))
84 typedef struct rpmhead {
88 unsigned char data[1];
92 headint32array(RpmHead *h, int tag, int *cnt)
94 unsigned int i, o, *r;
95 unsigned char *d, taga[4];
102 for (i = 0; i < h->cnt; i++, d -= 16)
103 if (d[3] == taga[3] && d[2] == taga[2] && d[1] == taga[1] && d[0] == taga[0])
107 if (d[4] != 0 || d[5] != 0 || d[6] != 0 || d[7] != 4)
109 o = d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11];
110 i = d[12] << 24 | d[13] << 16 | d[14] << 8 | d[15];
111 if (o + 4 * i > h->dcnt)
114 r = sat_calloc(i ? i : 1, sizeof(unsigned int));
117 for (o = 0; o < i; o++, d += 4)
118 r[o] = d[0] << 24 | d[1] << 16 | d[2] << 8 | d[3];
123 headint32(RpmHead *h, int tag)
126 unsigned char *d, taga[4];
133 for (i = 0; i < h->cnt; i++, d -= 16)
134 if (d[3] == taga[3] && d[2] == taga[2] && d[1] == taga[1] && d[0] == taga[0])
138 if (d[4] != 0 || d[5] != 0 || d[6] != 0 || d[7] != 4)
140 o = d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11];
141 i = d[12] << 24 | d[13] << 16 | d[14] << 8 | d[15];
142 if (i == 0 || o + 4 * i > h->dcnt)
145 return d[0] << 24 | d[1] << 16 | d[2] << 8 | d[3];
148 static unsigned int *
149 headint16array(RpmHead *h, int tag, int *cnt)
151 unsigned int i, o, *r;
152 unsigned char *d, taga[4];
159 for (i = 0; i < h->cnt; i++, d -= 16)
160 if (d[3] == taga[3] && d[2] == taga[2] && d[1] == taga[1] && d[0] == taga[0])
164 if (d[4] != 0 || d[5] != 0 || d[6] != 0 || d[7] != 3)
166 o = d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11];
167 i = d[12] << 24 | d[13] << 16 | d[14] << 8 | d[15];
168 if (o + 4 * i > h->dcnt)
171 r = sat_calloc(i ? i : 1, sizeof(unsigned int));
174 for (o = 0; o < i; o++, d += 2)
175 r[o] = d[0] << 8 | d[1];
180 headstring(RpmHead *h, int tag)
183 unsigned char *d, taga[4];
189 for (i = 0; i < h->cnt; i++, d -= 16)
190 if (d[3] == taga[3] && d[2] == taga[2] && d[1] == taga[1] && d[0] == taga[0])
194 /* 6: STRING, 9: I18NSTRING */
195 if (d[4] != 0 || d[5] != 0 || d[6] != 0 || (d[7] != 6 && d[7] != 9))
197 o = d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11];
198 return (char *)h->dp + o;
202 headstringarray(RpmHead *h, int tag, int *cnt)
205 unsigned char *d, taga[4];
213 for (i = 0; i < h->cnt; i++, d -= 16)
214 if (d[3] == taga[3] && d[2] == taga[2] && d[1] == taga[1] && d[0] == taga[0])
218 if (d[4] != 0 || d[5] != 0 || d[6] != 0 || d[7] != 8)
220 o = d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11];
221 i = d[12] << 24 | d[13] << 16 | d[14] << 8 | d[15];
222 r = sat_calloc(i ? i : 1, sizeof(char *));
226 for (o = 0; o < i; o++)
230 d += strlen((char *)d) + 1;
231 if (d >= h->dp + h->dcnt)
240 static char *headtoevr(RpmHead *h)
247 version = headstring(h, TAG_VERSION);
248 release = headstring(h, TAG_RELEASE);
249 epoch = headint32(h, TAG_EPOCH);
250 if (!version || !release)
252 fprintf(stderr, "headtoevr: bad rpm header\n");
255 for (v = version; *v >= 0 && *v <= '9'; v++)
257 if (epoch || (v != version && *v == ':'))
259 char epochbuf[11]; /* 32bit decimal will fit in */
260 sprintf(epochbuf, "%u", epoch);
261 evr = sat_malloc(strlen(epochbuf) + 1 + strlen(version) + 1 + strlen(release) + 1);
262 sprintf(evr, "%s:%s-%s", epochbuf, version, release);
266 evr = sat_malloc(strlen(version) + 1 + strlen(release) + 1);
267 sprintf(evr, "%s-%s", version, release);
273 makedeps(Pool *pool, Repo *repo, RpmHead *rpmhead, int tagn, int tagv, int tagf, int strong)
277 int i, cc, nc, vc, fc;
279 unsigned int olddeps;
282 n = headstringarray(rpmhead, tagn, &nc);
285 v = headstringarray(rpmhead, tagv, &vc);
291 f = headint32array(rpmhead, tagf, &fc);
298 if (nc != vc || nc != fc)
300 fprintf(stderr, "bad dependency entries\n");
308 for (i = 0; i < nc; i++)
309 if ((f[i] & DEP_STRONG) == (strong == 1 ? 0 : DEP_STRONG))
312 if ((f[i] & DEP_PRE) != 0)
318 for (i = 0; i < nc; i++)
319 if ((f[i] & DEP_PRE) != 0)
325 if (tagn != TAG_REQUIRENAME)
335 olddeps = repo_reserve_ids(repo, 0, cc);
336 ida = repo->idarraydata + olddeps;
345 *ida++ = SOLVABLE_PREREQMARKER;
347 if (strong && (f[i] & DEP_STRONG) != (strong == 1 ? 0 : DEP_STRONG))
349 if (haspre == 1 && (f[i] & DEP_PRE) != 0)
351 if (haspre == 2 && (f[i] & DEP_PRE) == 0)
353 if (f[i] & (DEP_LESS|DEP_GREATER|DEP_EQUAL))
357 if ((f[i] & DEP_LESS) != 0)
359 if ((f[i] & DEP_EQUAL) != 0)
361 if ((f[i] & DEP_GREATER) != 0)
363 name = str2id(pool, n[i], 1);
364 if (v[i][0] == '0' && v[i][1] == ':' && v[i][2])
365 evr = str2id(pool, v[i] + 2, 1);
367 evr = str2id(pool, v[i], 1);
368 *ida++ = rel2id(pool, name, evr, flags, 1);
371 *ida++ = str2id(pool, n[i], 1);
374 repo->idarraysize += cc + 1;
382 copydeps(Pool *pool, Repo *repo, Offset fromoff, Repo *fromrepo)
387 Pool *frompool = fromrepo->pool;
391 from = fromrepo->idarraydata + fromoff;
392 for (ida = from, cc = 0; *ida; ida++, cc++)
396 ido = repo_reserve_ids(repo, 0, cc);
397 ida = repo->idarraydata + ido;
398 if (frompool && pool != frompool)
405 Reldep *rd = GETRELDEP(frompool, id);
406 Id name = str2id(pool, id2str(frompool, rd->name), 1);
407 Id evr = str2id(pool, id2str(frompool, rd->evr), 1);
408 id = rel2id(pool, name, evr, rd->flags, 1);
411 id = str2id(pool, id2str(frompool, id), 1);
417 memcpy(ida, from, (cc + 1) * sizeof(Id));
418 repo->idarraysize += cc + 1;
423 #define FILEFILTER_EXACT 0
424 #define FILEFILTER_STARTS 1
425 #define FILEFILTER_CONTAINS 2
433 static struct filefilter filefilters[] = {
434 { FILEFILTER_CONTAINS, "/bin/", 0},
435 { FILEFILTER_CONTAINS, "/sbin/", 0},
436 { FILEFILTER_CONTAINS, "/lib/", 0},
437 { FILEFILTER_CONTAINS, "/lib64/", 0},
438 { FILEFILTER_CONTAINS, "/etc/", 0},
439 { FILEFILTER_STARTS, "/usr/games/", 0},
440 { FILEFILTER_EXACT, "/usr/share/dict/", "words"},
441 { FILEFILTER_STARTS, "/usr/share/", "magic.mime"},
442 { FILEFILTER_STARTS, "/opt/gnome/games/", 0},
446 adddudata(Pool *pool, Repo *repo, Repodata *repodata, Solvable *s, RpmHead *rpmhead, char **dn, unsigned int *di, int fc, int dic)
450 unsigned int *fkb, *fn, *fsz, *fm;
452 fsz = headint32array(rpmhead, TAG_FILESIZES, &fszc);
453 if (!fsz || fc != fszc)
458 /* stupid rpm recodrs sizes of directories, so we have to check the mode */
459 fm = headint16array(rpmhead, TAG_FILEMODES, &fszc);
460 if (!fm || fc != fszc)
466 fn = sat_calloc(dic, sizeof(unsigned int));
467 fkb = sat_calloc(dic, sizeof(unsigned int));
468 for (i = 0; i < fc; i++)
470 if (fsz[i] == 0 || !S_ISREG(fm[i]))
475 /* does not consider hard links. tough luck. */
476 fkb[di[i]] += fsz[i] / 1024 + 1;
481 repodata_extend(repodata, s - pool->solvables);
482 entry = (s - pool->solvables) - repodata->start;
483 for (i = 0; i < fc; i++)
487 did = repodata_str2dir(repodata, dn[i], 1);
488 repodata_add_dirnumnum(repodata, entry, id_diskusage, did, fkb[i], fn[i]);
494 /* assumes last processed array is provides! */
496 addfileprovides(Pool *pool, Repo *repo, Repodata *repodata, Solvable *s, RpmHead *rpmhead, unsigned int olddeps)
503 struct filefilter *ff;
509 bn = headstringarray(rpmhead, TAG_BASENAMES, &bnc);
512 dn = headstringarray(rpmhead, TAG_DIRNAMES, &dnc);
518 di = headint32array(rpmhead, TAG_DIRINDEXES, &dic);
527 fprintf(stderr, "bad filelist\n");
532 adddudata(pool, repo, repodata, s, rpmhead, dn, di, bnc, dic);
534 for (i = 0; i < bnc; i++)
537 for (j = 0; j < sizeof(filefilters)/sizeof(*filefilters); j++, ff++)
541 switch (ff->dirmatch)
543 case FILEFILTER_STARTS:
544 if (strncmp(dn[di[i]], ff->dir, strlen(ff->dir)))
547 case FILEFILTER_CONTAINS:
548 if (!strstr(dn[di[i]], ff->dir))
551 case FILEFILTER_EXACT:
553 if (strcmp(dn[di[i]], ff->dir))
560 if (strcmp(bn[i], ff->base))
565 if (j == sizeof(filefilters)/sizeof(*filefilters))
567 j = strlen(bn[i]) + strlen(dn[di[i]]) + 1;
571 fn = sat_realloc(fn, fna);
573 strcpy(fn, dn[di[i]]);
576 olddeps = repo_addid_dep(repo, olddeps, str2id(pool, fn, 1), SOLVABLE_FILEMARKER);
581 repodata_extend(repodata, s - pool->solvables);
582 entry = (s - pool->solvables) - repodata->start;
583 did = repodata_str2dir(repodata, dn[di[i]], 1);
584 repodata_add_dirstr(repodata, entry, id_filelist, did, bn[i]);
596 rpm2solv(Pool *pool, Repo *repo, Repodata *repodata, Solvable *s, RpmHead *rpmhead)
601 name = headstring(rpmhead, TAG_NAME);
602 if (!strcmp(name, "gpg-pubkey"))
604 s->name = str2id(pool, name, 1);
607 fprintf(stderr, "package has no name\n");
610 s->arch = str2id(pool, headstring(rpmhead, TAG_ARCH), 1);
612 s->arch = ARCH_NOARCH;
613 evr = headtoevr(rpmhead);
614 s->evr = str2id(pool, evr, 1);
616 s->vendor = str2id(pool, headstring(rpmhead, TAG_VENDOR), 1);
618 s->provides = makedeps(pool, repo, rpmhead, TAG_PROVIDENAME, TAG_PROVIDEVERSION, TAG_PROVIDEFLAGS, 0);
619 s->provides = addfileprovides(pool, repo, repodata, s, rpmhead, s->provides);
620 s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
621 s->requires = makedeps(pool, repo, rpmhead, TAG_REQUIRENAME, TAG_REQUIREVERSION, TAG_REQUIREFLAGS, 0);
622 s->conflicts = makedeps(pool, repo, rpmhead, TAG_CONFLICTNAME, TAG_CONFLICTVERSION, TAG_CONFLICTFLAGS, 0);
623 s->obsoletes = makedeps(pool, repo, rpmhead, TAG_OBSOLETENAME, TAG_OBSOLETEVERSION, TAG_OBSOLETEFLAGS, 0);
625 s->recommends = makedeps(pool, repo, rpmhead, TAG_SUGGESTSNAME, TAG_SUGGESTSVERSION, TAG_SUGGESTSFLAGS, 2);
626 s->suggests = makedeps(pool, repo, rpmhead, TAG_SUGGESTSNAME, TAG_SUGGESTSVERSION, TAG_SUGGESTSFLAGS, 1);
627 s->supplements = makedeps(pool, repo, rpmhead, TAG_ENHANCESNAME, TAG_ENHANCESVERSION, TAG_ENHANCESFLAGS, 2);
628 s->enhances = makedeps(pool, repo, rpmhead, TAG_ENHANCESNAME, TAG_ENHANCESVERSION, TAG_ENHANCESFLAGS, 1);
630 s->supplements = repo_fix_legacy(repo, s->provides, s->supplements);
638 repodata_extend(repodata, s - pool->solvables);
639 entry = (s - pool->solvables) - repodata->start;
640 str = headstring(rpmhead, TAG_SUMMARY);
642 repodata_set_str(repodata, entry, id_summary, str);
643 str = headstring(rpmhead, TAG_DESCRIPTION);
647 for (aut = str; (aut = strchr(aut, '\n')) != 0; aut++)
648 if (!strncmp(aut, "\nAuthors:\n--------\n", 19))
652 /* oh my, found SUSE special author section */
657 while (l > 0 && str[l - 1] == '\n')
660 repodata_set_str(repodata, entry, id_description, str);
662 aut = str; /* copy over */
663 while (*p == ' ' || *p == '\n')
676 while (aut != str && aut[-1] == '\n')
680 repodata_set_str(repodata, entry, id_authors, str);
684 repodata_set_str(repodata, entry, id_description, str);
686 str = headstring(rpmhead, TAG_GROUP);
688 repodata_set_poolstr(repodata, entry, id_group, str);
689 u32 = headint32(rpmhead, TAG_BUILDTIME);
691 repodata_set_num(repodata, entry, id_time, u32);
692 u32 = headint32(rpmhead, TAG_SIZE);
694 repodata_set_num(repodata, entry, id_installsize, (u32 + 1023) / 1024);
702 * read rpm db as repo
707 repo_add_rpmdb(Repo *repo, Repo *ref, const char *rootdir)
709 Pool *pool = repo->pool;
710 unsigned char buf[16];
715 unsigned char *dp, *dbidp;
717 struct rpmid *rpmids, *rp;
723 unsigned int refmask, h;
726 char dbpath[PATH_MAX];
728 if (repo->start != repo->end)
729 abort(); /* FIXME: rpmdbid */
731 repodata = repo_add_repodata(repo);
732 init_attr_ids(repo->pool);
734 if (ref && !(ref->nsolvables && ref->rpmdbid))
737 if (db_create(&db, 0, 0))
745 snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm/Packages", rootdir);
746 if (db->open(db, 0, dbpath, 0, DB_HASH, DB_RDONLY, 0664))
748 perror("db->open var/lib/rpm/Packages");
751 if (db->get_byteswapped(db, &byteswapped))
753 perror("db->get_byteswapped");
756 if (db->cursor(db, NULL, &dbc, 0))
758 perror("db->cursor");
761 dbidp = (unsigned char *)&dbid;
762 repo->rpmdbid = sat_calloc(256, sizeof(unsigned int));
768 while (dbc->c_get(dbc, &key, &data, DB_NEXT) == 0)
771 s = pool_id2solvable(pool, repo_add_solvable(repo));
774 repo->rpmdbid = sat_realloc(repo->rpmdbid, (asolv + 256) * sizeof(unsigned int));
775 memset(repo->rpmdbid + asolv, 0, 256 * sizeof(unsigned int));
780 fprintf(stderr, "corrupt Packages database (key size)\n");
792 memcpy(dbidp, dp, 4);
793 if (dbid == 0) /* the join key */
797 fprintf(stderr, "corrupt rpm database (size %u)\n", data.size);
800 if (data.size > rpmheadsize)
801 rpmhead = sat_realloc(rpmhead, sizeof(*rpmhead) + data.size);
802 memcpy(buf, data.data, 8);
803 rpmhead->cnt = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
804 rpmhead->dcnt = buf[4] << 24 | buf[5] << 16 | buf[6] << 8 | buf[7];
805 if (8 + rpmhead->cnt * 16 + rpmhead->dcnt > data.size)
807 fprintf(stderr, "corrupt rpm database (data size)\n");
810 memcpy(rpmhead->data, (unsigned char *)data.data + 8, rpmhead->cnt * 16 + rpmhead->dcnt);
811 rpmhead->dp = rpmhead->data + rpmhead->cnt * 16;
812 repo->rpmdbid[i] = dbid;
813 if (rpm2solv(pool, repo, repodata, s, rpmhead))
820 /* We can reuse this solvable, but make sure it's still
821 associated with this repo. */
822 memset(s, 0, sizeof(*s));
828 /* oops, could not reuse. free it instead */
829 repo_free_solvable_block(repo, s - pool->solvables, 1, 1);
838 snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm/Name", rootdir);
839 if (db->open(db, 0, dbpath, 0, DB_HASH, DB_RDONLY, 0664))
841 perror("db->open var/lib/rpm/Name");
844 if (db->get_byteswapped(db, &byteswapped))
846 perror("db->get_byteswapped");
849 if (db->cursor(db, NULL, &dbc, 0))
851 perror("db->cursor");
854 dbidp = (unsigned char *)&dbid;
857 while (dbc->c_get(dbc, &key, &data, DB_NEXT) == 0)
859 if (key.size == 10 && !memcmp(key.data, "gpg-pubkey", 10))
873 memcpy(dbidp, dp, 4);
874 if ((nrpmids & 255) == 0)
875 rpmids = sat_realloc(rpmids, sizeof(*rpmids) * (nrpmids + 256));
876 rpmids[nrpmids].dbid = dbid;
877 rpmids[nrpmids].name = sat_malloc((int)key.size + 1);
878 memcpy(rpmids[nrpmids].name, key.data, (int)key.size);
879 rpmids[nrpmids].name[(int)key.size] = 0;
890 dbidp = (unsigned char *)&dbid;
898 refmask = mkmask(ref->nsolvables);
899 refhash = sat_calloc(refmask + 1, sizeof(Id));
900 for (i = 0; i < ref->nsolvables; i++)
902 h = ref->rpmdbid[i] & refmask;
904 h = (h + 317) & refmask;
905 refhash[h] = i + 1; /* make it non-zero */
909 repo->rpmdbid = sat_calloc(nrpmids, sizeof(unsigned int));
911 s = pool_id2solvable(pool, repo_add_solvable_block(repo, nrpmids));
913 for (i = 0; i < nrpmids; i++, rp++, s++)
916 repo->rpmdbid[i] = dbid;
920 while ((id = refhash[h]))
922 if (ref->rpmdbid[id - 1] == dbid)
924 h = (h + 317) & refmask;
928 Solvable *r = ref->pool->solvables + ref->start + (id - 1);
929 if (pool == ref->pool)
934 s->vendor = r->vendor;
939 s->name = str2id(pool, id2str(ref->pool, r->name), 1);
941 s->evr = str2id(pool, id2str(ref->pool, r->evr), 1);
943 s->arch = str2id(pool, id2str(ref->pool, r->arch), 1);
945 s->vendor = str2id(pool, id2str(ref->pool, r->vendor), 1);
947 s->provides = copydeps(pool, repo, r->provides, ref);
948 s->requires = copydeps(pool, repo, r->requires, ref);
949 s->conflicts = copydeps(pool, repo, r->conflicts, ref);
950 s->obsoletes = copydeps(pool, repo, r->obsoletes, ref);
951 s->recommends = copydeps(pool, repo, r->recommends, ref);
952 s->suggests = copydeps(pool, repo, r->suggests, ref);
953 s->supplements = copydeps(pool, repo, r->supplements, ref);
954 s->enhances = copydeps(pool, repo, r->enhances, ref);
955 s->freshens = copydeps(pool, repo, r->freshens, ref);
961 if (db_create(&db, 0, 0))
966 snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm/Packages", rootdir);
967 if (db->open(db, 0, dbpath, 0, DB_HASH, DB_RDONLY, 0664))
969 perror("db->open var/lib/rpm/Packages");
972 if (db->get_byteswapped(db, &byteswapped))
974 perror("db->get_byteswapped");
986 memcpy(buf, dbidp, 4);
991 if (db->get(db, NULL, &key, &data, 0))
994 fprintf(stderr, "corrupt rpm database\n");
999 fprintf(stderr, "corrupt rpm database (size)\n");
1002 if (data.size > rpmheadsize)
1003 rpmhead = sat_realloc(rpmhead, sizeof(*rpmhead) + data.size);
1004 memcpy(buf, data.data, 8);
1005 rpmhead->cnt = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
1006 rpmhead->dcnt = buf[4] << 24 | buf[5] << 16 | buf[6] << 8 | buf[7];
1007 if (8 + rpmhead->cnt * 16 + rpmhead->dcnt > data.size)
1009 fprintf(stderr, "corrupt rpm database (data size)\n");
1012 memcpy(rpmhead->data, (unsigned char *)data.data + 8, rpmhead->cnt * 16 + rpmhead->dcnt);
1013 rpmhead->dp = rpmhead->data + rpmhead->cnt * 16;
1015 rpm2solv(pool, repo, repodata, s, rpmhead);
1022 for (i = 0; i < nrpmids; i++)
1023 sat_free(rpmids[i].name);
1032 repodata_internalize(repodata);
1035 /* XXX: delete me! */