summaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-23 11:35:40 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-23 11:35:40 +0300
commita388f4bfa6e92a06d95de576aee94f2ae5695cfe (patch)
treea9c6266888ab79be0c49715efabec769802816fa /src/index.c
parent90aaa28a95f28206e6bf4ed0d5a798595165cb8c (diff)
downloadapk-tools-a388f4bfa6e92a06d95de576aee94f2ae5695cfe.tar.gz
apk-tools-a388f4bfa6e92a06d95de576aee94f2ae5695cfe.tar.bz2
apk-tools-a388f4bfa6e92a06d95de576aee94f2ae5695cfe.tar.xz
apk-tools-a388f4bfa6e92a06d95de576aee94f2ae5695cfe.zip
index: more informative error message
when failed to load an existing index.
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/index.c b/src/index.c
index cd0c0b5..c27d020 100644
--- a/src/index.c
+++ b/src/index.c
@@ -86,7 +86,7 @@ static int index_main(void *ctx, int argc, char **argv)
struct counts counts = {0};
struct apk_ostream *os;
struct apk_file_info fi;
- int total, i, j, found, newpkgs = 0;
+ int total, r, i, j, found, newpkgs = 0;
struct index_ctx *ictx = (struct index_ctx *) ctx;
if (isatty(STDOUT_FILENO) && ictx->output == NULL &&
@@ -100,10 +100,10 @@ static int index_main(void *ctx, int argc, char **argv)
ictx->method = APK_SIGN_GENERATE;
apk_db_open(&db, NULL, APK_OPENF_READ);
- if (index_read_file(&db, ictx) < 0) {
+ if ((r = index_read_file(&db, ictx)) < 0) {
apk_db_close(&db);
- apk_error("The index is corrupt, or of unknown format.");
- return -1;
+ apk_error("%s: %s", ictx->index, apk_error_str(r));
+ return r;
}
for (i = 0; i < argc; i++) {