diff options
author | Timo Teräs <timo.teras@iki.fi> | 2011-10-29 05:18:21 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2011-10-29 05:18:21 +0300 |
commit | 500f8d4a7d7b17871647392e79e4c7a17c210534 (patch) | |
tree | 47d4b1cd04e374d88e26e352eeac9f51da083451 /src/blob.c | |
parent | e682e6596c101d634b3780a98773c8433b3baadb (diff) | |
download | apk-tools-500f8d4a7d7b17871647392e79e4c7a17c210534.tar.gz apk-tools-500f8d4a7d7b17871647392e79e4c7a17c210534.tar.bz2 apk-tools-500f8d4a7d7b17871647392e79e4c7a17c210534.tar.xz apk-tools-500f8d4a7d7b17871647392e79e4c7a17c210534.zip |
solver, db: implement repository pinning
Improves /etc/apk/repositories format so you can say:
http://nl.alpinelinux.org/alpine/v2.3/main
@edge http://nl.alpinelinux.org/alpine/edge/main
@testing http://nl.alpinelinux.org/alpine/edge/testing
After which you can pin dependencies to these tags using:
apk add stableapp newapp@edge bleedingapp@testing
Apk will now by default only use the untagged repositories,
but adding a tag to specific dependency:
1. will prefer that tag for the name
2. allowing pulling in dependencies from that tag (though,
it prefers untagged packages to satisfy deps if possible)
fixes #575
Diffstat (limited to 'src/blob.c')
-rw-r--r-- | src/blob.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -44,8 +44,10 @@ int apk_blob_spn(apk_blob_t blob, const char *accept, apk_blob_t *l, apk_blob_t for (i = 0; i < blob.len; i++) { if (strchr(accept, blob.ptr[i]) == NULL) { - *l = APK_BLOB_PTR_LEN(blob.ptr, i); - *r = APK_BLOB_PTR_LEN(blob.ptr+i, blob.len-i); + if (l != NULL) + *l = APK_BLOB_PTR_LEN(blob.ptr, i); + if (r != NULL) + *r = APK_BLOB_PTR_LEN(blob.ptr+i, blob.len-i); return 1; } } @@ -58,8 +60,10 @@ int apk_blob_cspn(apk_blob_t blob, const char *reject, apk_blob_t *l, apk_blob_t for (i = 0; i < blob.len; i++) { if (strchr(reject, blob.ptr[i]) != NULL) { - *l = APK_BLOB_PTR_LEN(blob.ptr, i); - *r = APK_BLOB_PTR_LEN(blob.ptr+i, blob.len-i); + if (l != NULL) + *l = APK_BLOB_PTR_LEN(blob.ptr, i); + if (r != NULL) + *r = APK_BLOB_PTR_LEN(blob.ptr+i, blob.len-i); return 1; } } |