diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-07-17 07:16:38 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-07-17 13:10:16 +0000 |
commit | f38fb0a22170382f18a44eb1520fcdb3b53d5ad0 (patch) | |
tree | fd17d2a91ddfc567610af646baac66bc76b46d5e | |
parent | 451f2026b9908506ff879bb5bae989ea1a699dcc (diff) | |
download | alpine_aports-f38fb0a22170382f18a44eb1520fcdb3b53d5ad0.tar.bz2 alpine_aports-f38fb0a22170382f18a44eb1520fcdb3b53d5ad0.tar.xz alpine_aports-f38fb0a22170382f18a44eb1520fcdb3b53d5ad0.zip |
main/apk-tools: upgrade to 2.3.2
fixes #1241
(cherry picked from commit 3882d7fb0dc347b5f9880b48fcd1b47175cc4260)
6 files changed, 3 insertions, 203 deletions
diff --git a/main/apk-tools/0001-db-strip-leading-and-trailing-slashes-from-protected.patch b/main/apk-tools/0001-db-strip-leading-and-trailing-slashes-from-protected.patch deleted file mode 100644 index aeb3926c96..0000000000 --- a/main/apk-tools/0001-db-strip-leading-and-trailing-slashes-from-protected.patch +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | From 38c1e65afbb334af0107c6bdd5362303473d866f Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> | ||
3 | Date: Tue, 1 May 2012 14:30:06 +0300 | ||
4 | Subject: [PATCH 1/5] db: strip leading and trailing slashes from protected | ||
5 | path spec | ||
6 | |||
7 | --- | ||
8 | src/database.c | 6 ++++++ | ||
9 | 1 file changed, 6 insertions(+) | ||
10 | |||
11 | diff --git a/src/database.c b/src/database.c | ||
12 | index 26774be..bcc707f 100644 | ||
13 | --- a/src/database.c | ||
14 | +++ b/src/database.c | ||
15 | @@ -1181,6 +1181,12 @@ static int add_protected_path(void *ctx, apk_blob_t blob) | ||
16 | break; | ||
17 | } | ||
18 | |||
19 | + /* skip leading and trailing path separators */ | ||
20 | + while (blob.len && blob.ptr[0] == '/') | ||
21 | + blob.ptr++, blob.len--; | ||
22 | + while (blob.len && blob.ptr[blob.len-1] == '/') | ||
23 | + blob.len--; | ||
24 | + | ||
25 | *apk_protected_path_array_add(&db->protected_paths) = (struct apk_protected_path) { | ||
26 | .relative_pattern = apk_blob_cstr(blob), | ||
27 | .protected = protected, | ||
28 | -- | ||
29 | 1.7.10 | ||
30 | |||
diff --git a/main/apk-tools/0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch b/main/apk-tools/0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch deleted file mode 100644 index 1e855baff1..0000000000 --- a/main/apk-tools/0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | From c9a43a14697fa955f31e495a8b03a523975ad285 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> | ||
3 | Date: Tue, 1 May 2012 15:40:31 +0300 | ||
4 | Subject: [PATCH 2/5] audit: apply protected_paths.d masks to individual files | ||
5 | |||
6 | --- | ||
7 | src/audit.c | 21 ++++++++++++++++++--- | ||
8 | 1 file changed, 18 insertions(+), 3 deletions(-) | ||
9 | |||
10 | diff --git a/src/audit.c b/src/audit.c | ||
11 | index 071ff4d..03f977b 100644 | ||
12 | --- a/src/audit.c | ||
13 | +++ b/src/audit.c | ||
14 | @@ -14,6 +14,7 @@ | ||
15 | #include <fcntl.h> | ||
16 | #include <unistd.h> | ||
17 | #include <dirent.h> | ||
18 | +#include <fnmatch.h> | ||
19 | #include <sys/stat.h> | ||
20 | #include "apk_applet.h" | ||
21 | #include "apk_database.h" | ||
22 | @@ -199,14 +200,28 @@ recurse_check: | ||
23 | atctx->pathlen--; | ||
24 | } else { | ||
25 | struct apk_db_file *dbf; | ||
26 | + struct apk_protected_path_array *ppaths = dbd->protected_paths; | ||
27 | + int i, protected = dbd->protected, symlinks_only = dbd->symlinks_only; | ||
28 | + | ||
29 | + /* inherit file's protection mask */ | ||
30 | + for (i = 0; i < ppaths->num; i++) { | ||
31 | + struct apk_protected_path *ppath = &ppaths->item[i]; | ||
32 | + char *slash = strchr(ppath->relative_pattern, '/'); | ||
33 | + if (slash == NULL) { | ||
34 | + if (fnmatch(ppath->relative_pattern, name, FNM_PATHNAME) != 0) | ||
35 | + continue; | ||
36 | + protected = ppath->protected; | ||
37 | + symlinks_only = ppath->symlinks_only; | ||
38 | + } | ||
39 | + } | ||
40 | |||
41 | if (actx->mode == MODE_BACKUP) { | ||
42 | - if (!dbd->protected) | ||
43 | + if (!protected) | ||
44 | goto done; | ||
45 | - if (dbd->symlinks_only && !S_ISLNK(fi.mode)) | ||
46 | + if (symlinks_only && !S_ISLNK(fi.mode)) | ||
47 | goto done; | ||
48 | } else { | ||
49 | - if (dbd->protected) | ||
50 | + if (protected) | ||
51 | goto done; | ||
52 | } | ||
53 | |||
54 | -- | ||
55 | 1.7.10 | ||
56 | |||
diff --git a/main/apk-tools/0003-ver-print-when-package-is-not-available-in-any-repo.patch b/main/apk-tools/0003-ver-print-when-package-is-not-available-in-any-repo.patch deleted file mode 100644 index 6d589c61ae..0000000000 --- a/main/apk-tools/0003-ver-print-when-package-is-not-available-in-any-repo.patch +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | From 9154b8b5e44859ce0a1fd0ba292b26bf8dc8d046 Mon Sep 17 00:00:00 2001 | ||
2 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
3 | Date: Mon, 7 May 2012 08:51:02 +0200 | ||
4 | Subject: [PATCH 3/5] ver: print '?' when package is not available in any repo | ||
5 | |||
6 | This makes it possible to differ between downgradable packages (-l '<') | ||
7 | and unavailable in repos (-l '?'). | ||
8 | --- | ||
9 | src/apk_version.h | 1 + | ||
10 | src/ver.c | 3 ++- | ||
11 | 2 files changed, 3 insertions(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/src/apk_version.h b/src/apk_version.h | ||
14 | index dcbf20f..4275343 100644 | ||
15 | --- a/src/apk_version.h | ||
16 | +++ b/src/apk_version.h | ||
17 | @@ -14,6 +14,7 @@ | ||
18 | |||
19 | #include "apk_blob.h" | ||
20 | |||
21 | +#define APK_VERSION_UNKNOWN 0 | ||
22 | #define APK_VERSION_EQUAL 1 | ||
23 | #define APK_VERSION_LESS 2 | ||
24 | #define APK_VERSION_GREATER 4 | ||
25 | diff --git a/src/ver.c b/src/ver.c | ||
26 | index 4bfd607..90b6cd6 100644 | ||
27 | --- a/src/ver.c | ||
28 | +++ b/src/ver.c | ||
29 | @@ -125,7 +125,8 @@ static void ver_print_package_status(struct ver_ctx *ictx, struct apk_database * | ||
30 | break; | ||
31 | } | ||
32 | } | ||
33 | - r = apk_version_compare_blob(*pkg->version, *latest); | ||
34 | + r = latest->len ? apk_version_compare_blob(*pkg->version, *latest) | ||
35 | + : APK_VERSION_UNKNOWN; | ||
36 | opstr = apk_version_op_string(r); | ||
37 | if ((ictx->limchars != NULL) && (strchr(ictx->limchars, *opstr) == NULL)) | ||
38 | return; | ||
39 | -- | ||
40 | 1.7.10 | ||
41 | |||
diff --git a/main/apk-tools/0004-ver-make-quiet-output-suitable-for-scripting-piping.patch b/main/apk-tools/0004-ver-make-quiet-output-suitable-for-scripting-piping.patch deleted file mode 100644 index 36eb225cd4..0000000000 --- a/main/apk-tools/0004-ver-make-quiet-output-suitable-for-scripting-piping.patch +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | From 08595072ae2156a399253d34b41748da99e84bfc Mon Sep 17 00:00:00 2001 | ||
2 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
3 | Date: Mon, 7 May 2012 08:54:41 +0200 | ||
4 | Subject: [PATCH 4/5] ver: make --quiet output suitable for scripting/piping | ||
5 | |||
6 | Do not print version numbers or compare result char when in quiet | ||
7 | mode. This makes the output suitable for be used in scripts or pipes. | ||
8 | |||
9 | For example: | ||
10 | |||
11 | # Upgrade all packages that matches a given regexp | ||
12 | apk version --limit '<' --quiet | grep $regexp | apk fix --reinstall | ||
13 | |||
14 | # Delete all packages that are removed from repository | ||
15 | apk version --limit '?' --quiet | xargs apk del | ||
16 | --- | ||
17 | src/ver.c | 4 ++++ | ||
18 | 1 file changed, 4 insertions(+) | ||
19 | |||
20 | diff --git a/src/ver.c b/src/ver.c | ||
21 | index 90b6cd6..05ffce9 100644 | ||
22 | --- a/src/ver.c | ||
23 | +++ b/src/ver.c | ||
24 | @@ -130,6 +130,10 @@ static void ver_print_package_status(struct ver_ctx *ictx, struct apk_database * | ||
25 | opstr = apk_version_op_string(r); | ||
26 | if ((ictx->limchars != NULL) && (strchr(ictx->limchars, *opstr) == NULL)) | ||
27 | return; | ||
28 | + if (apk_verbosity <= 0) { | ||
29 | + printf("%s\n", pkg->name->name); | ||
30 | + return; | ||
31 | + } | ||
32 | snprintf(pkgname, sizeof(pkgname), PKG_VER_FMT, | ||
33 | PKG_VER_PRINTF(pkg)); | ||
34 | printf("%-40s%s " BLOB_FMT, pkgname, opstr, BLOB_PRINTF(*latest)); | ||
35 | -- | ||
36 | 1.7.10 | ||
37 | |||
diff --git a/main/apk-tools/0005-ver-show-all-packages-with-v.patch b/main/apk-tools/0005-ver-show-all-packages-with-v.patch deleted file mode 100644 index dee3e5a45e..0000000000 --- a/main/apk-tools/0005-ver-show-all-packages-with-v.patch +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | From a6b28beef055c9c454fba49d02995765e6f3aeab Mon Sep 17 00:00:00 2001 | ||
2 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
3 | Date: Mon, 7 May 2012 10:53:45 +0200 | ||
4 | Subject: [PATCH 5/5] ver: show all packages with -v | ||
5 | |||
6 | ref #1122 | ||
7 | --- | ||
8 | src/ver.c | 2 +- | ||
9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/src/ver.c b/src/ver.c | ||
12 | index 05ffce9..c20547a 100644 | ||
13 | --- a/src/ver.c | ||
14 | +++ b/src/ver.c | ||
15 | @@ -161,7 +161,7 @@ static int ver_main(void *ctx, struct apk_database *db, int argc, char **argv) | ||
16 | if (ictx->limchars) { | ||
17 | if (strlen(ictx->limchars) == 0) | ||
18 | ictx->limchars = NULL; | ||
19 | - } else if (argc == 0) { | ||
20 | + } else if (argc == 0 && apk_verbosity == 1) { | ||
21 | ictx->limchars = "<"; | ||
22 | } | ||
23 | |||
24 | -- | ||
25 | 1.7.10 | ||
26 | |||
diff --git a/main/apk-tools/APKBUILD b/main/apk-tools/APKBUILD index e28da1b819..ab1ff34ad0 100644 --- a/main/apk-tools/APKBUILD +++ b/main/apk-tools/APKBUILD | |||
@@ -1,17 +1,12 @@ | |||
1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
2 | pkgname=apk-tools | 2 | pkgname=apk-tools |
3 | pkgver=2.3.1 | 3 | pkgver=2.3.2 |
4 | pkgrel=2 | 4 | pkgrel=0 |
5 | pkgdesc="Alpine Package Keeper - package manager for alpine" | 5 | pkgdesc="Alpine Package Keeper - package manager for alpine" |
6 | subpackages="$pkgname-static lua-apk:luaapk" | 6 | subpackages="$pkgname-static lua-apk:luaapk" |
7 | depends= | 7 | depends= |
8 | makedepends="zlib-dev openssl-dev lua-dev" | 8 | makedepends="zlib-dev openssl-dev lua-dev" |
9 | source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2 | 9 | source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2 |
10 | 0001-db-strip-leading-and-trailing-slashes-from-protected.patch | ||
11 | 0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch | ||
12 | 0003-ver-print-when-package-is-not-available-in-any-repo.patch | ||
13 | 0004-ver-make-quiet-output-suitable-for-scripting-piping.patch | ||
14 | 0005-ver-show-all-packages-with-v.patch | ||
15 | " | 10 | " |
16 | 11 | ||
17 | url="http://git.alpinelinux.org/cgit/apk-tools/" | 12 | url="http://git.alpinelinux.org/cgit/apk-tools/" |
@@ -63,9 +58,4 @@ luaapk() { | |||
63 | mv "$pkgdir"/usr/lib "$subpkgdir"/usr/lib/ | 58 | mv "$pkgdir"/usr/lib "$subpkgdir"/usr/lib/ |
64 | } | 59 | } |
65 | 60 | ||
66 | md5sums="e343935cc2680a42f3da0f442045f046 apk-tools-2.3.1.tar.bz2 | 61 | md5sums="813b7c9fd7f6159972dc4fa5dfcc97c5 apk-tools-2.3.2.tar.bz2" |
67 | e88cc45d942821dc7f222f1f4c1e6292 0001-db-strip-leading-and-trailing-slashes-from-protected.patch | ||
68 | ad846965eb7826818d27c083fda6cc60 0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch | ||
69 | e4f00e434f66770cb28bbd4b1e97eb40 0003-ver-print-when-package-is-not-available-in-any-repo.patch | ||
70 | 3474af2f6db2794a4a2075a9d9b5af64 0004-ver-make-quiet-output-suitable-for-scripting-piping.patch | ||
71 | be6b5f7298d625876ae0f4ae3a117d7c 0005-ver-show-all-packages-with-v.patch" | ||