aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-07-17 07:16:38 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-07-17 13:10:16 +0000
commitf38fb0a22170382f18a44eb1520fcdb3b53d5ad0 (patch)
treefd17d2a91ddfc567610af646baac66bc76b46d5e
parent451f2026b9908506ff879bb5bae989ea1a699dcc (diff)
downloadalpine_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)
-rw-r--r--main/apk-tools/0001-db-strip-leading-and-trailing-slashes-from-protected.patch30
-rw-r--r--main/apk-tools/0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch56
-rw-r--r--main/apk-tools/0003-ver-print-when-package-is-not-available-in-any-repo.patch41
-rw-r--r--main/apk-tools/0004-ver-make-quiet-output-suitable-for-scripting-piping.patch37
-rw-r--r--main/apk-tools/0005-ver-show-all-packages-with-v.patch26
-rw-r--r--main/apk-tools/APKBUILD16
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 @@
1From 38c1e65afbb334af0107c6bdd5362303473d866f Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
3Date: Tue, 1 May 2012 14:30:06 +0300
4Subject: [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
11diff --git a/src/database.c b/src/database.c
12index 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--
291.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 @@
1From c9a43a14697fa955f31e495a8b03a523975ad285 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
3Date: Tue, 1 May 2012 15:40:31 +0300
4Subject: [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
10diff --git a/src/audit.c b/src/audit.c
11index 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--
551.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 @@
1From 9154b8b5e44859ce0a1fd0ba292b26bf8dc8d046 Mon Sep 17 00:00:00 2001
2From: Natanael Copa <ncopa@alpinelinux.org>
3Date: Mon, 7 May 2012 08:51:02 +0200
4Subject: [PATCH 3/5] ver: print '?' when package is not available in any repo
5
6This makes it possible to differ between downgradable packages (-l '<')
7and 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
13diff --git a/src/apk_version.h b/src/apk_version.h
14index 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
25diff --git a/src/ver.c b/src/ver.c
26index 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--
401.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 @@
1From 08595072ae2156a399253d34b41748da99e84bfc Mon Sep 17 00:00:00 2001
2From: Natanael Copa <ncopa@alpinelinux.org>
3Date: Mon, 7 May 2012 08:54:41 +0200
4Subject: [PATCH 4/5] ver: make --quiet output suitable for scripting/piping
5
6Do not print version numbers or compare result char when in quiet
7mode. This makes the output suitable for be used in scripts or pipes.
8
9For 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
20diff --git a/src/ver.c b/src/ver.c
21index 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--
361.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 @@
1From a6b28beef055c9c454fba49d02995765e6f3aeab Mon Sep 17 00:00:00 2001
2From: Natanael Copa <ncopa@alpinelinux.org>
3Date: Mon, 7 May 2012 10:53:45 +0200
4Subject: [PATCH 5/5] ver: show all packages with -v
5
6ref #1122
7---
8 src/ver.c | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/src/ver.c b/src/ver.c
12index 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--
251.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>
2pkgname=apk-tools 2pkgname=apk-tools
3pkgver=2.3.1 3pkgver=2.3.2
4pkgrel=2 4pkgrel=0
5pkgdesc="Alpine Package Keeper - package manager for alpine" 5pkgdesc="Alpine Package Keeper - package manager for alpine"
6subpackages="$pkgname-static lua-apk:luaapk" 6subpackages="$pkgname-static lua-apk:luaapk"
7depends= 7depends=
8makedepends="zlib-dev openssl-dev lua-dev" 8makedepends="zlib-dev openssl-dev lua-dev"
9source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2 9source="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
17url="http://git.alpinelinux.org/cgit/apk-tools/" 12url="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
66md5sums="e343935cc2680a42f3da0f442045f046 apk-tools-2.3.1.tar.bz2 61md5sums="813b7c9fd7f6159972dc4fa5dfcc97c5 apk-tools-2.3.2.tar.bz2"
67e88cc45d942821dc7f222f1f4c1e6292 0001-db-strip-leading-and-trailing-slashes-from-protected.patch
68ad846965eb7826818d27c083fda6cc60 0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch
69e4f00e434f66770cb28bbd4b1e97eb40 0003-ver-print-when-package-is-not-available-in-any-repo.patch
703474af2f6db2794a4a2075a9d9b5af64 0004-ver-make-quiet-output-suitable-for-scripting-piping.patch
71be6b5f7298d625876ae0f4ae3a117d7c 0005-ver-show-all-packages-with-v.patch"