main/apk-tools: upgrade to 2.4.1

This commit is contained in:
Timo Teräs 2014-03-12 15:11:12 +02:00
parent 76a20f7b1a
commit 2aa42e430f
5 changed files with 5 additions and 198 deletions

View File

@ -1,49 +0,0 @@
From b06a43a465f596289c73be8dc7eb6cd732a27114 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Mon, 6 Jan 2014 10:51:17 +0100
Subject: [PATCH] apk: new option --print-arch
Simply print the default arch and exit.
This is so scripts don't need to parse the output of -V.
---
src/apk.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/apk.c b/src/apk.c
index 8a3c7ef..6cd01de 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -70,6 +70,7 @@ static struct apk_option generic_options[] = {
{ 0x111, "overlay-from-stdin", "Read list of overlay files from stdin" },
{ 0x112, "arch", "Use architecture with --root",
required_argument, "ARCH" },
+ { 0x114, "print-arch", "Print default arch and exit" },
#ifdef TEST_MODE
{ 0x200, "test-repo", "Repository", required_argument, "REPO" },
{ 0x201, "test-instdb", "Installed db", required_argument, "INSTALLED" },
@@ -86,6 +87,12 @@ static int version(void)
return 0;
}
+static int show_arch(void)
+{
+ puts(APK_DEFAULT_ARCH);
+ return 0;
+}
+
static int format_option(char *buf, size_t len, struct apk_option *o,
const char *separator)
{
@@ -418,6 +425,9 @@ int main(int argc, char **argv)
case 0x112:
dbopts.arch = optarg;
break;
+ case 0x114:
+ r = show_arch();
+ goto err;
#ifdef TEST_MODE
case 0x200:
*apk_string_array_add(&test_repos) = (char*) optarg;
--
1.8.5.2

View File

@ -1,25 +0,0 @@
From a6c4103df550ec7c1d99af6a5573c2e3f946b408 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Wed, 2 Oct 2013 16:06:10 +0300
Subject: [PATCH 1/3] db: allow using cached packages with --no-network
---
src/database.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/database.c b/src/database.c
index afe0a8c..9eadb44 100644
--- a/src/database.c
+++ b/src/database.c
@@ -2151,7 +2151,7 @@ int apk_db_add_repository(apk_database_t _db, apk_blob_t _repository)
db->available_repos &= ~BIT(repo_num);
r = 0;
} else {
- db->repo_tags[tag_id].allowed_repos |= BIT(repo_num) & db->available_repos;
+ db->repo_tags[tag_id].allowed_repos |= BIT(repo_num);
}
return 0;
--
1.8.5.1

View File

@ -1,78 +0,0 @@
From 517378721855280d2e23d25d7529e6b9cbae9136 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 11 Oct 2013 14:52:34 +0300
Subject: [PATCH 2/3] print: use stdout instead of stderr for logging and
progress
stdout is the proper place for it. this also fixes the progress
bar in musl, which seems to not support using line buffering for
stderr.
---
src/apk.c | 1 -
src/print.c | 20 ++++++++++----------
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/apk.c b/src/apk.c
index 8744de6..8a3c7ef 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -266,7 +266,6 @@ static void on_sigwinch(int s)
static void setup_terminal(void)
{
- setvbuf(stderr, NULL, _IOLBF, BUFSIZ);
signal(SIGWINCH, on_sigwinch);
signal(SIGPIPE, SIG_IGN);
}
diff --git a/src/print.c b/src/print.c
index 6d00064..aafe2ef 100644
--- a/src/print.c
+++ b/src/print.c
@@ -35,7 +35,7 @@ int apk_get_screen_width(void)
if (apk_screen_width == 0) {
apk_screen_width = 50;
- if (ioctl(STDERR_FILENO, TIOCGWINSZ, &w) == 0 &&
+ if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) == 0 &&
w.ws_col > 50)
apk_screen_width = w.ws_col;
}
@@ -77,14 +77,14 @@ void apk_print_progress(size_t done, size_t total)
last_percent = percent;
apk_progress_force = 0;
- fprintf(stderr, "\e7%3i%% [", percent);
+ fprintf(stdout, "\e7%3i%% [", percent);
for (i = 0; i < bar; i++)
- fputc('#', stderr);
+ fputc('#', stdout);
for (; i < bar_width; i++)
- fputc(' ', stderr);
- fputc(']', stderr);
- fflush(stderr);
- fputs("\e8\e[0K", stderr);
+ fputc(' ', stdout);
+ fputc(']', stdout);
+ fflush(stdout);
+ fputs("\e8\e[0K", stdout);
}
int apk_print_indented(struct apk_indent *i, apk_blob_t blob)
@@ -144,11 +144,11 @@ void apk_log(const char *prefix, const char *format, ...)
va_list va;
if (prefix != NULL)
- fprintf(stderr, "%s", prefix);
+ fprintf(stdout, "%s", prefix);
va_start(va, format);
- vfprintf(stderr, format, va);
+ vfprintf(stdout, format, va);
va_end(va);
- fprintf(stderr, "\n");
+ fprintf(stdout, "\n");
apk_progress_force = 1;
}
--
1.8.5.1

View File

@ -1,25 +0,0 @@
From 1f8b79347187ab0933b595ded32b69217903037c Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 5 Dec 2013 10:58:23 +0100
Subject: [PATCH 3/3] print: flush on apk_log
Makes it more useful whith pipes.
---
src/print.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/print.c b/src/print.c
index aafe2ef..d8b0f3f 100644
--- a/src/print.c
+++ b/src/print.c
@@ -149,6 +149,7 @@ void apk_log(const char *prefix, const char *format, ...)
vfprintf(stdout, format, va);
va_end(va);
fprintf(stdout, "\n");
+ fflush(stdout);
apk_progress_force = 1;
}
--
1.8.5.1

View File

@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=apk-tools
pkgver=2.4.0
pkgrel=6
pkgver=2.4.1
pkgrel=0
pkgdesc="Alpine Package Keeper - package manager for alpine"
subpackages="$pkgname-static"
depends=
@ -13,10 +13,6 @@ if [ "$CBUILD" == "$CHOST" ]; then
makedepends="$makedepends lua5.2-dev"
fi
source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.xz
0001-db-allow-using-cached-packages-with-no-network.patch
0002-print-use-stdout-instead-of-stderr-for-logging-and-p.patch
0003-print-flush-on-apk_log.patch
0001-apk-new-option-print-arch.patch
"
url="http://git.alpinelinux.org/cgit/apk-tools/"
@ -86,18 +82,6 @@ luaapk() {
mv "$pkgdir"/usr/lib "$subpkgdir"/usr/lib/
}
md5sums="8446c69882d26c8bba38500b6e5577eb apk-tools-2.4.0.tar.xz
1dd6a336016814ef44805f1974961d6b 0001-db-allow-using-cached-packages-with-no-network.patch
a4d39e02bb7e8cee4c4daf69d684e691 0002-print-use-stdout-instead-of-stderr-for-logging-and-p.patch
bfc313d60890b25b4eea7f7a8284d815 0003-print-flush-on-apk_log.patch
e4058882e126225a4a46a214b9c2c18f 0001-apk-new-option-print-arch.patch"
sha256sums="ac717df2c512c43e6ea3dd103fcea725ee9135936fe6a177de5021c36735a578 apk-tools-2.4.0.tar.xz
92bf5e0d28933a907ddb74b343d322db484be4f909ccb33ac0ec9f320c323fde 0001-db-allow-using-cached-packages-with-no-network.patch
886ea0b40511c694ef9689bd74e8f861c69d5648c774cad80c622c39a979468e 0002-print-use-stdout-instead-of-stderr-for-logging-and-p.patch
83cf87712f77d6db296c1775e5cf4b1fb458b732830dc23d9ea46065ccba1260 0003-print-flush-on-apk_log.patch
585d36c5e356fb133e89958645c6723fcd057c9698b26eb93bbc50ca85329893 0001-apk-new-option-print-arch.patch"
sha512sums="97dae73ed34e56349be5027d73720bdb8cf136b6bf0ede6f9fd5199386977d6c718f3593ea0f566aef0c5cdaf59e078f22a4bb1a22132b00dae82dc5927a8279 apk-tools-2.4.0.tar.xz
305c669fd98534e8438af656c6be5aa30b23253fa21cf155bc230a7b87f0b85c221f353717c25f2ef84072c34ebcc99ecca54e9cac31139a8f3a636c3bbb5981 0001-db-allow-using-cached-packages-with-no-network.patch
7f0c9107ff1ba3ab3a5443d53ccb98b47cab3f1b8467457d2c333ece8f92d17c684bfbf9e8db51f91ff759d1ba334708c0190ba0fdeaef85dd922138e2317271 0002-print-use-stdout-instead-of-stderr-for-logging-and-p.patch
d2ffae4736671db9fa6a60fa04d495d3d31c9998ad099a2f23c0920f0827571fa5ac85ba6522afe16a1d7eba072e25a390fa15d07e7339d0adeb7840af117399 0003-print-flush-on-apk_log.patch
88f276f6eaf1d394f751f4ced5880fb9d4a8587f6a3a867c1fa2d3add7e0ba995961b19979c764fc70766aa66d04760ea124b69240442769afa5ebcb3cb520c8 0001-apk-new-option-print-arch.patch"
md5sums="223e2cdb08404ec174a849cfc233667f apk-tools-2.4.1.tar.xz"
sha256sums="4812133631fa9f93bf185cbdc76651cef16e1d0a2d9336d3c37fc03c0e11fe0e apk-tools-2.4.1.tar.xz"
sha512sums="c045512c3e231928c85b75b245a3b79bd0d64baea6f3b8f3a6933279c9a05bd9815633b8e7e8daf85e3a01760c3679f01dc9ea525800e60a09d32d67a357bdbc apk-tools-2.4.1.tar.xz"