aboutsummaryrefslogtreecommitdiffstats
path: root/src/package.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2008-11-07 19:18:53 +0200
committerTimo Teras <timo.teras@iki.fi>2008-11-07 19:18:53 +0200
commit791cf6f05bc71118925343528edd44fd4a671bb3 (patch)
tree5107b32f40d8100aeaea7ab7466338b6d9bae896 /src/package.c
parent0bf7a1a2cc45086d594e4af64e1e1a8c96274f47 (diff)
downloadaports-791cf6f05bc71118925343528edd44fd4a671bb3.tar.gz
aports-791cf6f05bc71118925343528edd44fd4a671bb3.tar.bz2
aports-791cf6f05bc71118925343528edd44fd4a671bb3.tar.xz
pkg: speed up indexing of version 2 .apks
Diffstat (limited to 'src/package.c')
-rw-r--r--src/package.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/package.c b/src/package.c
index 9132b184f8..44cc387835 100644
--- a/src/package.c
+++ b/src/package.c
@@ -54,8 +54,10 @@ static apk_blob_t trim(apk_blob_t str)
if (str.ptr == NULL || str.len < 1)
return str;
- if (str.ptr[str.len-2] == '\n')
+ if (str.ptr[str.len-1] == '\n') {
+ str.ptr[str.len-1] = 0;
return APK_BLOB_PTR_LEN(str.ptr, str.len-1);
+ }
return str;
}
@@ -281,9 +283,9 @@ static int read_info_entry(void *ctx, const struct apk_archive_entry *ae,
apk_blob_t blob = apk_blob_from_istream(is, ae->size);
apk_blob_for_each_segment(blob, "\n", read_info_line, ctx);
free(blob.ptr);
- /* FIXME: all done after checking if .INSTALL exists */
- return 0;
+ return 1;
}
+ /* FIXME: Check for .INSTALL */
} else if (strncmp(ae->name, "var/db/apk/", 11) == 0) {
/* APK 1.0 format */
if (!S_ISREG(ae->mode))