Id id, evrid;
char *sp[4];
- i = split(line + 5, sp, 4); /* name, <op>, evr, ? */
- if (i != 1 && i != 3) /* expect either 'name' or 'name' <op> 'evr' */
+ if (*line=='/')
{
- fprintf(stderr, "Bad dependency line: %d: %s\n", pd->lineno, line);
- exit(1);
+ /* Allow spaces in file dependencies. Autobuild may generate
+ such filedeps into the provides list. */
+ id = str2id(pool, line, 1);
}
- if (kind)
- id = str2id(pool, join2(kind, ":", sp[0]), 1);
else
- id = str2id(pool, sp[0], 1);
- if (i == 3)
{
- evrid = makeevr(pool, sp[2]);
- for (flags = 0; flags < 6; flags++)
- if (!strcmp(sp[1], flagtab[flags]))
- break;
- if (flags == 6)
- {
- fprintf(stderr, "Unknown relation %d: '%s'\n", pd->lineno, sp[1]);
- exit(1);
- }
- id = rel2id(pool, id, evrid, flags + 1, 1);
+ i = split(line + 5, sp, 4); /* name, <op>, evr, ? */
+ if (i != 1 && i != 3) /* expect either 'name' or 'name' <op> 'evr' */
+ {
+ fprintf(stderr, "Bad dependency line: %d: %s\n", pd->lineno, line);
+ exit(1);
+ }
+ if (kind)
+ id = str2id(pool, join2(kind, ":", sp[0]), 1);
+ else
+ id = str2id(pool, sp[0], 1);
+ if (i == 3)
+ {
+ evrid = makeevr(pool, sp[2]);
+ for (flags = 0; flags < 6; flags++)
+ if (!strcmp(sp[1], flagtab[flags]))
+ break;
+ if (flags == 6)
+ {
+ fprintf(stderr, "Unknown relation %d: '%s'\n", pd->lineno, sp[1]);
+ exit(1);
+ }
+ id = rel2id(pool, id, evrid, flags + 1, 1);
+ }
}
return repo_addid_dep(pd->repo, olddeps, id, marker);
}
/*
* add_location
- *
+ *
*/
static void
/*
* add_source
- *
+ *
*/
static void
repodata_set_id(pd->data, handle, SOLVABLE_SOURCEEVR, evr);
repodata_set_constantid(pd->data, handle, SOLVABLE_SOURCEARCH, arch);
}
-
+
/*
* add_dirline
* add a line with directory information
- *
+ *
*/
static void
/*
* id3_cmp
- * compare
- *
+ * compare
+ *
*/
static int
/*
* commit_diskusage
- *
+ *
*/
static void
/*
* tag_from_string
- *
+ *
*/
static inline unsigned
/*
* repo_add_susetags
* Parse susetags file passed in fp, fill solvables into repo
- *
+ *
* susetags is key,value based
* for short values
* =key: value
* See http://en.opensuse.org/Standards/YaST2_Repository_Metadata
* and http://en.opensuse.org/Standards/YaST2_Repository_Metadata/packages
* and http://en.opensuse.org/Standards/YaST2_Repository_Metadata/pattern
- *
+ *
* Assumptions:
* All keys have 3 characters and end in ':'
*/
/*
* parse susetags
- *
+ *
* fp: file to read from
* product: solvable representing the product (0 if none)
* language: current language (0 if none)
Id blanr = -1;
Id handle = 0;
Id vendor = 0;
-
+
if ((flags & SUSETAGS_EXTEND) && repo->nrepodata)
indesc = 1;
if (repo->nrepodata)
if (!strncmp (id2str(pool, pool->solvables[product].name), "product:", 8))
vendor = pool->solvables[product].vendor;
}
-
+
memset(&pd, 0, sizeof(pd));
line = malloc(1024);
aline = 1024;
blanr = 0;
/*
* read complete file
- *
+ *
* collect values in 'struct parsedata pd'
* then build .solv (and .attr) file
*/
-
+
for (;;)
{
unsigned tag;
if (intag)
{
/* check for multi-line value tags (+Key:/-Key:) */
-
+
int is_end = (linep[-intag - keylen + 1] == '-')
&& (linep[-1] == ':')
&& (linep == line + 1 + intag + 1 + 1 + 1 + intag + 1 || linep[-intag - keylen] == '\n');
continue;
if ( line[4] == '.')
{
- char *endlang;
+ char *endlang;
endlang = strchr(line + 5, ':');
if (endlang)
{
* =Pkg: <name> <version> <release> <architecture>
* (=Pat: ...)
*/
-
+
if ((tag == CTAG('=', 'P', 'k', 'g')
|| tag == CTAG('=', 'P', 'a', 't')))
{
/*
* define kind
*/
-
+
pd.kind = 0;
if (line[3] == 't')
pd.kind = "pattern";
/*
* parse nevra
*/
-
+
if (split(line + 5, sp, 5) != 4)
{
fprintf(stderr, "Bad line: %d: %s\n", pd.lineno, line);
int n, nn;
/* Now look for a solvable with the given name,evr,arch.
Our input is structured so, that the second set of =Pkg
- lines comes in roughly the same order as the first set, so we
+ lines comes in roughly the same order as the first set, so we
have a hint at where to start our search, namely were we found
the last entry. */
for (n = repo->start, nn = n + last_found_pack; n < repo->end; n++, nn++)
handle = repodata_get_handle(data, last_found_pack);
}
}
-
+
/* And if we still don't have a solvable, create a new one. */
if (!s)
if (s)
finish_solvable(&pd, s, handle, freshens);
-
+
/* Shared attributes
* (e.g. multiple binaries built from same source)
*/