summaryrefslogtreecommitdiff
path: root/src/apk_defines.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-02-22 08:45:40 +0200
committerTimo Teräs <timo.teras@iki.fi>2012-02-22 08:45:40 +0200
commitbf82e2e5fd45f4ba425a128ae4fdb6144c82f218 (patch)
treeb7d97e0aede851d3d0222ee30141cb00bccf217f /src/apk_defines.h
parent568d57336d84179b3e97a301872890dc51969a36 (diff)
downloadapk-tools-bf82e2e5fd45f4ba425a128ae4fdb6144c82f218.tar.gz
apk-tools-bf82e2e5fd45f4ba425a128ae4fdb6144c82f218.tar.bz2
apk-tools-bf82e2e5fd45f4ba425a128ae4fdb6144c82f218.tar.xz
apk-tools-bf82e2e5fd45f4ba425a128ae4fdb6144c82f218.zip
db, solver, io: scan cache items at startup
It is faster to just scan the cache directory for existing packages at startup than trying to faccessat() them on demand. It also makes quite a few parts of the code more readable and simpler.
Diffstat (limited to 'src/apk_defines.h')
-rw-r--r--src/apk_defines.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/apk_defines.h b/src/apk_defines.h
index 2ef0c3b..61690b1 100644
--- a/src/apk_defines.h
+++ b/src/apk_defines.h
@@ -64,6 +64,26 @@ extern char **apk_argv;
#define APK_NO_NETWORK 0x1000
#define APK_OVERLAY_FROM_STDIN 0x2000
+/* default architecture for APK packages. */
+#if defined(__x86_64__)
+#define APK_DEFAULT_ARCH "x86_64"
+#elif defined(__i386__)
+#define APK_DEFAULT_ARCH "x86"
+#elif defined(__powerpc__) && !defined(__powerpc64__)
+#define APK_DEFAULT_ARCH "ppc"
+#elif defined(__powerpc64__)
+#define APK_DEFAULT_ARCH "ppc64"
+#elif defined(__arm__)
+#define APK_DEFAULT_ARCH "arm"
+#else
+#warning APK_DEFAULT_ARCH is not set for this architecture
+#define APK_DEFAULT_ARCH "noarch"
+#endif
+
+#define APK_MAX_REPOS 31 /* see struct apk_package */
+#define APK_MAX_TAGS 16 /* see solver; unsigned short */
+#define APK_CACHE_CSUM_BYTES 4
+
static inline size_t apk_calc_installed_size(size_t size)
{
const size_t bsize = 4 * 1024;