summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-01-05 14:32:01 +0200
committerTimo Teräs <timo.teras@iki.fi>2011-01-05 14:33:16 +0200
commit0e450c5fb6356f612ef0be98d2ffab854e90dc67 (patch)
tree56859f6dabf6ee871ffe710981066d5e4369a350
parentd6a40aae5332e79898bb52efc5a61c81994b0166 (diff)
downloadapk-tools-0e450c5fb6356f612ef0be98d2ffab854e90dc67.tar.gz
apk-tools-0e450c5fb6356f612ef0be98d2ffab854e90dc67.tar.bz2
apk-tools-0e450c5fb6356f612ef0be98d2ffab854e90dc67.tar.xz
apk-tools-0e450c5fb6356f612ef0be98d2ffab854e90dc67.zip
add: use default arch instead of noarch, improve errors
Packages without architecture should get the platforms default architecture (so we are backwards compatible). Only the virtual packages should get 'noarch' by default. Also print full path to the index file which failed.
-rw-r--r--src/add.c1
-rw-r--r--src/database.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/src/add.c b/src/add.c
index 5f5f6c7..977c772 100644
--- a/src/add.c
+++ b/src/add.c
@@ -80,6 +80,7 @@ static int add_main(void *ctx, struct apk_database *db, int argc, char **argv)
apk_checksum_default(), &virtpkg->csum);
virtpkg->version = apk_blob_atomize(APK_BLOB_STR("0"));
virtpkg->description = strdup("virtual meta package");
+ virtpkg->arch = apk_blob_atomize(APK_BLOB_STR("noarch"));
apk_dep_from_pkg(&virtdep, db, virtpkg);
virtdep.name->flags |= APK_NAME_TOPLEVEL;
virtpkg = apk_db_pkg_add(db, virtpkg);
diff --git a/src/database.c b/src/database.c
index a536fb1..c985233 100644
--- a/src/database.c
+++ b/src/database.c
@@ -429,7 +429,7 @@ struct apk_package *apk_db_pkg_add(struct apk_database *db, struct apk_package *
if (pkg->license == NULL)
pkg->license = apk_blob_atomize(APK_BLOB_NULL);
if (pkg->arch == NULL)
- pkg->arch = apk_blob_atomize(APK_BLOB_STR("noarch"));
+ pkg->arch = apk_blob_atomize(APK_BLOB_STR(APK_DEFAULT_ARCH));
idb = apk_hash_get(&db->available.packages, APK_BLOB_CSUM(pkg->csum));
if (idb == NULL) {
@@ -1608,13 +1608,13 @@ int apk_db_add_repository(apk_database_t _db, apk_blob_t repository)
bs = apk_repo_file_open(repo, *db->arch, apkindex_tar_gz, buf, sizeof(buf));
}
if (bs == NULL) {
- apk_warning("Failed to open index for %s", repo->url);
+ apk_warning("%s: index failed to open", buf);
return 0;
}
r = load_index(db, bs, targz, r);
if (r != 0)
- apk_error("%s: Bad repository signature", repo->url);
+ apk_error("%s: BAD signature", buf);
return r;
}