aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/apk-tools/0001-fetch-fix-fetching-of-packages-with-arch.patch4
-rw-r--r--main/apk-tools/0002-upgrade-Improve-english-messages-on-apk-tools-baseli.patch33
-rw-r--r--main/apk-tools/0003-state-make-the-progress-bar-look-nice.patch35
-rw-r--r--main/apk-tools/0004-db-Allow-override-arch-when-using-root.patch85
-rw-r--r--main/apk-tools/0005-apk-default-screen-width-70-if-ioctl-says-0-as-width.patch25
-rw-r--r--main/apk-tools/0006-db-remount-ro-cache-to-rw-earlier-for-update-to-work.patch61
-rw-r--r--main/apk-tools/0007-state-make-some-of-the-interactive-messages-line-up-.patch31
-rw-r--r--main/apk-tools/APKBUILD16
8 files changed, 286 insertions, 4 deletions
diff --git a/main/apk-tools/0001-fetch-fix-fetching-of-packages-with-arch.patch b/main/apk-tools/0001-fetch-fix-fetching-of-packages-with-arch.patch
index 40f934e417..7972dadd08 100644
--- a/main/apk-tools/0001-fetch-fix-fetching-of-packages-with-arch.patch
+++ b/main/apk-tools/0001-fetch-fix-fetching-of-packages-with-arch.patch
@@ -1,7 +1,7 @@
From 91c4cc6c188bc20eddcd40e9b9b30f20dc2f36cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Thu, 7 Apr 2011 14:14:27 +0300
-Subject: [PATCH] fetch: fix fetching of packages with arch
+Subject: [PATCH 1/7] fetch: fix fetching of packages with arch
---
src/apk_database.h | 3 +++
@@ -100,5 +100,5 @@ index 09e3b9d..72b481d 100644
if (fctx->flags & FETCH_STDOUT) {
fd = STDOUT_FILENO;
--
-1.7.4.4
+1.7.4.5
diff --git a/main/apk-tools/0002-upgrade-Improve-english-messages-on-apk-tools-baseli.patch b/main/apk-tools/0002-upgrade-Improve-english-messages-on-apk-tools-baseli.patch
new file mode 100644
index 0000000000..178b66d0e2
--- /dev/null
+++ b/main/apk-tools/0002-upgrade-Improve-english-messages-on-apk-tools-baseli.patch
@@ -0,0 +1,33 @@
+From 2911d0cad2a2aceda8f617754d5290f6f3ae96f4 Mon Sep 17 00:00:00 2001
+From: William Pitcock <nenolod@dereferenced.org>
+Date: Sat, 9 Apr 2011 08:05:49 -0500
+Subject: [PATCH 2/7] upgrade: Improve english messages on apk-tools/baselibs
+ upgrade transaction.
+
+---
+ src/upgrade.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/upgrade.c b/src/upgrade.c
+index 4db0c00..ec0dc91 100644
+--- a/src/upgrade.c
++++ b/src/upgrade.c
+@@ -46,13 +46,13 @@ int apk_do_self_upgrade(struct apk_database *db, struct apk_state *state)
+ return 0;
+ }
+
+- apk_message("Uprading first to new apk-tools:");
++ apk_message("Upgrading critical system libraries and apk-tools:");
+ state->print_ok = 0;
+ r = apk_state_commit(state);
+ apk_state_unref(state);
+ apk_db_close(db);
+
+- apk_message("Performing rest of the operation:");
++ apk_message("Continuing the upgrade transaction with new apk-tools:");
+ execvp(apk_argv[0], apk_argv);
+
+ apk_error("PANIC! Failed to re-execute new apk-tools!");
+--
+1.7.4.5
+
diff --git a/main/apk-tools/0003-state-make-the-progress-bar-look-nice.patch b/main/apk-tools/0003-state-make-the-progress-bar-look-nice.patch
new file mode 100644
index 0000000000..5dbedc3a24
--- /dev/null
+++ b/main/apk-tools/0003-state-make-the-progress-bar-look-nice.patch
@@ -0,0 +1,35 @@
+From 762e0c717bcae8c2d0f46ba4f35232b773ac8419 Mon Sep 17 00:00:00 2001
+From: William Pitcock <nenolod@dereferenced.org>
+Date: Sat, 9 Apr 2011 08:16:46 -0500
+Subject: [PATCH 3/7] state: make the progress bar look nice
+
+---
+ src/state.c | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/state.c b/src/state.c
+index cbc0f25..6de3629 100644
+--- a/src/state.c
++++ b/src/state.c
+@@ -712,15 +712,15 @@ static void apk_count_change(struct apk_change *change, struct apk_stats *stats)
+
+ static void apk_draw_progress(int percent)
+ {
+- const int bar_width = (apk_screen_width - 15);
++ const int bar_width = (apk_screen_width - 7);
+ int i;
+
+- fputs("\e7-[", stderr);
++ fprintf(stderr, "\e7%3i%% [", percent);
+ for (i = 0; i < bar_width * percent / 100; i++)
+ fputc('#', stderr);
+ for (; i < bar_width; i++)
+ fputc(' ', stderr);
+- fprintf(stderr, "]- %3i%%", percent);
++ fputc(']', stderr);
+ fflush(stderr);
+ fputs("\e8\e[0K", stderr);
+ }
+--
+1.7.4.5
+
diff --git a/main/apk-tools/0004-db-Allow-override-arch-when-using-root.patch b/main/apk-tools/0004-db-Allow-override-arch-when-using-root.patch
new file mode 100644
index 0000000000..fe1a64b6b4
--- /dev/null
+++ b/main/apk-tools/0004-db-Allow-override-arch-when-using-root.patch
@@ -0,0 +1,85 @@
+From cec1fa2b0f414e980c4dc56a5cc4dc9ff48bddb8 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 14 Apr 2011 21:48:49 +0200
+Subject: [PATCH 4/7] db: Allow override arch when using --root
+
+This is so we can do x86 --root installs on x86_64 hosts.
+
+Using --arch without --root can make great damage so we only enable it
+if --root is used.
+---
+ src/apk.c | 5 +++++
+ src/apk_database.h | 1 +
+ src/database.c | 7 +++++--
+ 3 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/src/apk.c b/src/apk.c
+index 55963b0..c40cc20 100644
+--- a/src/apk.c
++++ b/src/apk.c
+@@ -66,6 +66,8 @@ static struct apk_option generic_options[] = {
+ required_argument, "REPOFILE" },
+ { 0x109, "no-network", "Do not use network (cache is still used)" },
+ { 0x111, "overlay-from-stdin", "Read list of overlay files from stdin" },
++ { 0x112, "arch", "Use architecture with --root",
++ required_argument, "ARCH" },
+ };
+
+ static int version(void)
+@@ -369,6 +371,9 @@ int main(int argc, char **argv)
+ case 0x111:
+ apk_flags |= APK_OVERLAY_FROM_STDIN;
+ break;
++ case 0x112:
++ dbopts.arch = optarg;
++ break;
+ default:
+ if (applet == NULL || applet->parse == NULL ||
+ applet->parse(ctx, &dbopts, r,
+diff --git a/src/apk_database.h b/src/apk_database.h
+index 68bba08..9b032e7 100644
+--- a/src/apk_database.h
++++ b/src/apk_database.h
+@@ -95,6 +95,7 @@ struct apk_db_options {
+ int lock_wait;
+ unsigned long open_flags;
+ char *root;
++ char *arch;
+ char *keys_dir;
+ char *repositories_file;
+ struct list_head repository_list;
+diff --git a/src/database.c b/src/database.c
+index 1376ec3..45960d2 100644
+--- a/src/database.c
++++ b/src/database.c
+@@ -49,7 +49,6 @@ enum {
+
+ int apk_verbosity = 1;
+ unsigned int apk_flags = 0;
+-const char *apk_arch = APK_DEFAULT_ARCH;
+
+ const char * const apkindex_tar_gz = "APKINDEX.tar.gz";
+ static const char * const apk_static_cache_dir = "var/cache/apk";
+@@ -1149,6 +1148,11 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
+ apk_string_array_init(&db->protected_paths);
+ db->permanent = 1;
+
++ if (dbopts->root && dbopts->arch) {
++ db->arch = apk_blob_atomize(APK_BLOB_STR(dbopts->arch));
++ } else {
++ db->arch = apk_blob_atomize(APK_BLOB_STR(APK_DEFAULT_ARCH));
++ }
+ db->root = strdup(dbopts->root ?: "/");
+ db->root_fd = openat(AT_FDCWD, db->root, O_RDONLY | O_CLOEXEC);
+ if (db->root_fd < 0 && (dbopts->open_flags & APK_OPENF_CREATE)) {
+@@ -1226,7 +1230,6 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
+ db->cachetmp_fd = db->cache_fd;
+ }
+
+- db->arch = apk_blob_atomize(APK_BLOB_STR(apk_arch));
+ db->keys_fd = openat(db->root_fd,
+ dbopts->keys_dir ?: "etc/apk/keys",
+ O_RDONLY | O_CLOEXEC);
+--
+1.7.4.5
+
diff --git a/main/apk-tools/0005-apk-default-screen-width-70-if-ioctl-says-0-as-width.patch b/main/apk-tools/0005-apk-default-screen-width-70-if-ioctl-says-0-as-width.patch
new file mode 100644
index 0000000000..887e646a66
--- /dev/null
+++ b/main/apk-tools/0005-apk-default-screen-width-70-if-ioctl-says-0-as-width.patch
@@ -0,0 +1,25 @@
+From 595c66595c549b7d595463cdfb932afe8d3c3540 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Fri, 22 Apr 2011 11:13:32 +0300
+Subject: [PATCH 5/7] apk: default screen width 70 if ioctl says 0 as width
+
+---
+ src/apk.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/apk.c b/src/apk.c
+index c40cc20..f0349e4 100644
+--- a/src/apk.c
++++ b/src/apk.c
+@@ -249,7 +249,7 @@ static void setup_terminal(void)
+ setvbuf(stderr, NULL, _IOLBF, BUFSIZ);
+ if (ioctl(STDERR_FILENO,TIOCGWINSZ, &w) == 0)
+ apk_screen_width = w.ws_col;
+- else
++ if (apk_screen_width == 0)
+ apk_screen_width = 70;
+ if (isatty(STDOUT_FILENO) && isatty(STDERR_FILENO) && isatty(STDIN_FILENO))
+ apk_flags |= APK_PROGRESS;
+--
+1.7.4.5
+
diff --git a/main/apk-tools/0006-db-remount-ro-cache-to-rw-earlier-for-update-to-work.patch b/main/apk-tools/0006-db-remount-ro-cache-to-rw-earlier-for-update-to-work.patch
new file mode 100644
index 0000000000..28c837be69
--- /dev/null
+++ b/main/apk-tools/0006-db-remount-ro-cache-to-rw-earlier-for-update-to-work.patch
@@ -0,0 +1,61 @@
+From 99010588913344cf037aa163a47acd469fff5594 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Fri, 22 Apr 2011 11:24:02 +0300
+Subject: [PATCH 6/7] db: remount ro cache to rw earlier for update to work
+
+---
+ src/database.c | 31 ++++++++++++++++---------------
+ 1 files changed, 16 insertions(+), 15 deletions(-)
+
+diff --git a/src/database.c b/src/database.c
+index 45960d2..bc17ff2 100644
+--- a/src/database.c
++++ b/src/database.c
+@@ -1263,6 +1263,22 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
+ }
+ }
+ }
++
++ if ((dbopts->open_flags & (APK_OPENF_WRITE | APK_OPENF_CACHE_WRITE)) &&
++ db->ro_cache) {
++ /* remount cache read-write */
++ db->cache_remount_dir = find_mountpoint(db->root_fd, db->cache_dir);
++ if (db->cache_remount_dir == NULL) {
++ apk_warning("Unable to find cache directory mount point");
++ } else if (do_remount(db->cache_remount_dir, "rw") != 0) {
++ free(db->cache_remount_dir);
++ db->cache_remount_dir = NULL;
++ apk_error("Unable to remount cache read-write");
++ r = EROFS;
++ goto ret_r;
++ }
++ }
++
+ if (!(dbopts->open_flags & APK_OPENF_NO_SYS_REPOS)) {
+ list_for_each_entry(repo, &dbopts->repository_list, list) {
+ r = apk_db_add_repository(db, APK_BLOB_STR(repo->url));
+@@ -1293,21 +1309,6 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
+ "might not function properly");
+ }
+
+- if ((dbopts->open_flags & (APK_OPENF_WRITE | APK_OPENF_CACHE_WRITE)) &&
+- db->ro_cache) {
+- /* remount cache read-write */
+- db->cache_remount_dir = find_mountpoint(db->root_fd, db->cache_dir);
+- if (db->cache_remount_dir == NULL) {
+- apk_warning("Unable to find cache directory mount point");
+- } else if (do_remount(db->cache_remount_dir, "rw") != 0) {
+- free(db->cache_remount_dir);
+- db->cache_remount_dir = NULL;
+- apk_error("Unable to remount cache read-write");
+- r = EROFS;
+- goto ret_r;
+- }
+- }
+-
+ return rr;
+
+ ret_errno:
+--
+1.7.4.5
+
diff --git a/main/apk-tools/0007-state-make-some-of-the-interactive-messages-line-up-.patch b/main/apk-tools/0007-state-make-some-of-the-interactive-messages-line-up-.patch
new file mode 100644
index 0000000000..3f32121314
--- /dev/null
+++ b/main/apk-tools/0007-state-make-some-of-the-interactive-messages-line-up-.patch
@@ -0,0 +1,31 @@
+From 9f219e4f466806dd163a75373af85cd92eee66cf Mon Sep 17 00:00:00 2001
+From: William Pitcock <nenolod@dereferenced.org>
+Date: Tue, 26 Apr 2011 22:49:06 -0500
+Subject: [PATCH 7/7] state: make some of the interactive messages line up
+ with apt which weren't already
+
+---
+ src/state.c | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/state.c b/src/state.c
+index 6de3629..8641e9b 100644
+--- a/src/state.c
++++ b/src/state.c
+@@ -989,10 +989,10 @@ int apk_state_commit(struct apk_state *state)
+ "The following NEW packages will be installed");
+ dump_packages(state, cmp_upgrade,
+ "The following packages will be upgraded");
+- printf("%d kB of %s\n", abs(size_diff),
++ printf("After this operation, %d kB of %s\n", abs(size_diff),
+ (size_diff < 0) ?
+- "disk space will be freed" :
+- "additional disk space will be used");
++ "disk space will be freed." :
++ "additional disk space will be used.");
+ }
+ if (apk_flags & APK_INTERACTIVE) {
+ printf("Do you want to continue [Y/n]? ");
+--
+1.7.4.5
+
diff --git a/main/apk-tools/APKBUILD b/main/apk-tools/APKBUILD
index 31aa71a53c..c6f429c7a6 100644
--- a/main/apk-tools/APKBUILD
+++ b/main/apk-tools/APKBUILD
@@ -1,13 +1,19 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=apk-tools
pkgver=2.1.0_rc1
-pkgrel=1
+pkgrel=2
pkgdesc="Alpine Package Keeper - package manager for alpine"
subpackages="$pkgname-static"
depends=
makedepends="zlib-dev openssl-dev pkgconfig"
source="http://git.alpinelinux.org/cgit/$pkgname.git/snapshot/$pkgname-$pkgver.tar.bz2
0001-fetch-fix-fetching-of-packages-with-arch.patch
+ 0002-upgrade-Improve-english-messages-on-apk-tools-baseli.patch
+ 0003-state-make-the-progress-bar-look-nice.patch
+ 0004-db-Allow-override-arch-when-using-root.patch
+ 0005-apk-default-screen-width-70-if-ioctl-says-0-as-width.patch
+ 0006-db-remount-ro-cache-to-rw-earlier-for-update-to-work.patch
+ 0007-state-make-some-of-the-interactive-messages-line-up-.patch
"
url="http://git.alpinelinux.org/cgit/apk-tools/"
@@ -50,4 +56,10 @@ static() {
}
md5sums="cc3ee58fa9672bc003cadc2b20bf33d2 apk-tools-2.1.0_rc1.tar.bz2
-c868a4d8a997294d0ca570586f78f3ab 0001-fetch-fix-fetching-of-packages-with-arch.patch"
+b13a24a11604d4e6fc8384c5a254ca67 0001-fetch-fix-fetching-of-packages-with-arch.patch
+f7af0d74f4d59c56b3fd92145be11592 0002-upgrade-Improve-english-messages-on-apk-tools-baseli.patch
+83561b3c964a78f790d818bcc13e5ee3 0003-state-make-the-progress-bar-look-nice.patch
+5cd969ed8464432c9372eac456b4db8e 0004-db-Allow-override-arch-when-using-root.patch
+665ef14de27cce640799013b175f8826 0005-apk-default-screen-width-70-if-ioctl-says-0-as-width.patch
+46a25e0a2cee674235850e337e685f3b 0006-db-remount-ro-cache-to-rw-earlier-for-update-to-work.patch
+321e42a3b13ec6451ac9747230e6c974 0007-state-make-some-of-the-interactive-messages-line-up-.patch"