summaryrefslogtreecommitdiff
path: root/src/package.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-11 14:03:55 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-11 14:03:55 +0000
commit09385545d99ecd20034b9c369396b20982b79351 (patch)
treed76e5a8d2816ec1323a7f9db984bc8fd812db577 /src/package.c
parent9423906606a9e8d6e225043745058b908cfa6c47 (diff)
downloadapk-tools-09385545d99ecd20034b9c369396b20982b79351.tar.gz
apk-tools-09385545d99ecd20034b9c369396b20982b79351.tar.bz2
apk-tools-09385545d99ecd20034b9c369396b20982b79351.tar.xz
apk-tools-09385545d99ecd20034b9c369396b20982b79351.zip
db, package: new dependency format, second try
dependencies are separated with single space rather than ', '. makes db file slightly easier to parse from a shell script which might be handy.
Diffstat (limited to 'src/package.c')
-rw-r--r--src/package.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/package.c b/src/package.c
index 9f33201..6978ede 100644
--- a/src/package.c
+++ b/src/package.c
@@ -123,13 +123,13 @@ void apk_deps_parse(struct apk_database *db,
int i;
start = blob.ptr;
- for (i = 0; i < blob.len; i++) {
- if (blob.ptr[i] != ',' && blob.ptr[i] != '\n')
+ for (i = 0; i < blob.len && blob.ptr[i] != '\n'; i++) {
+ if (blob.ptr[i] != ' ')
continue;
parse_depend(db, depends,
APK_BLOB_PTR_PTR(start, &blob.ptr[i-1]));
- start = &blob.ptr[i+1];
+ start = &blob.ptr[i];
}
parse_depend(db, depends,
APK_BLOB_PTR_PTR(start, &blob.ptr[i-1]));
@@ -145,7 +145,7 @@ int apk_deps_format(char *buf, int size,
for (i = 0; i < depends->num - 1; i++)
n += snprintf(&buf[n], size-n,
- "%s, ",
+ "%s ",
depends->item[i].name->name);
n += snprintf(&buf[n], size-n,
"%s\n",