diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-05-23 13:40:46 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-05-23 13:40:55 +0000 |
commit | 6361c75dd52142737f3c52ff74102327c8c6963b (patch) | |
tree | e47ba3f4ad20cb745010b62e2920c64abe149414 /main/apk-tools | |
parent | a3de2cf1f7ccf2ba068ef3e7689b9013fb2ecac1 (diff) | |
download | aports-6361c75dd52142737f3c52ff74102327c8c6963b.tar.bz2 aports-6361c75dd52142737f3c52ff74102327c8c6963b.tar.xz |
main/apk-tools: upgrade to 2.1.0
Diffstat (limited to 'main/apk-tools')
8 files changed, 3 insertions, 391 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 deleted file mode 100644 index 7972dadd0..000000000 --- a/main/apk-tools/0001-fetch-fix-fetching-of-packages-with-arch.patch +++ /dev/null @@ -1,104 +0,0 @@ -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 1/7] fetch: fix fetching of packages with arch - ---- - src/apk_database.h | 3 +++ - src/database.c | 36 ++++++++++++++++++++---------------- - src/fetch.c | 4 +--- - 3 files changed, 24 insertions(+), 19 deletions(-) - -diff --git a/src/apk_database.h b/src/apk_database.h -index 988a668..68bba08 100644 ---- a/src/apk_database.h -+++ b/src/apk_database.h -@@ -183,6 +183,9 @@ int apk_db_add_repository(apk_database_t db, apk_blob_t repository); - struct apk_repository *apk_db_select_repo(struct apk_database *db, - struct apk_package *pkg); - int apk_repository_update(struct apk_database *db, struct apk_repository *repo); -+int apk_repo_format_filename(char *buf, size_t len, -+ const char *repourl, apk_blob_t *arch, -+ const char *pkgfile); - - int apk_db_cache_active(struct apk_database *db); - void apk_cache_format_index(apk_blob_t to, struct apk_repository *repo); -diff --git a/src/database.c b/src/database.c -index 8e9cb0d..1376ec3 100644 ---- a/src/database.c -+++ b/src/database.c -@@ -489,14 +489,7 @@ int apk_cache_download(struct apk_database *db, const char *url, apk_blob_t *arc - char fullurl[PATH_MAX]; - int r; - -- if (arch != NULL) -- snprintf(fullurl, sizeof(fullurl), "%s%s" BLOB_FMT "/%s", -- url, url[strlen(url)-1] == '/' ? "" : "/", -- BLOB_PRINTF(*arch), item); -- else -- snprintf(fullurl, sizeof(fullurl), "%s%s/%s", -- url, url[strlen(url)-1] == '/' ? "" : "/", -- item); -+ apk_repo_format_filename(fullurl, sizeof(fullurl), url, arch, item); - apk_message("fetch %s", fullurl); - - if (apk_flags & APK_SIMULATE) -@@ -1529,6 +1522,24 @@ struct apk_package *apk_db_get_file_owner(struct apk_database *db, - return dbf->diri->pkg; - } - -+int apk_repo_format_filename(char *buf, size_t len, -+ const char *repourl, apk_blob_t *arch, -+ const char *item) -+{ -+ int n; -+ -+ if (arch != NULL) -+ n = snprintf(buf, len, "%s%s" BLOB_FMT "/%s", -+ repourl, repourl[strlen(repourl)-1] == '/' ? "" : "/", -+ BLOB_PRINTF(*arch), item); -+ else -+ n = snprintf(buf, len, "%s%s%s", -+ repourl, repourl[strlen(repourl)-1] == '/' ? "" : "/", -+ item); -+ -+ return n; -+} -+ - static int apk_repo_is_remote(struct apk_repository *repo) - { - return repo->csum.type != APK_CHECKSUM_NONE; -@@ -1541,14 +1552,7 @@ static struct apk_bstream *apk_repo_file_open(struct apk_repository *repo, - { - const char *url = repo->url; - -- if (arch != NULL) -- snprintf(buf, buflen, "%s%s" BLOB_FMT "/%s", -- url, url[strlen(url)-1] == '/' ? "" : "/", -- BLOB_PRINTF(*arch), file); -- else -- snprintf(buf, buflen, "%s%s/%s", -- url, url[strlen(url)-1] == '/' ? "" : "/", -- file); -+ apk_repo_format_filename(buf, buflen, url, arch, file); - - if ((apk_flags & APK_NO_NETWORK) && apk_repo_is_remote(repo)) - return NULL; -diff --git a/src/fetch.c b/src/fetch.c -index 09e3b9d..72b481d 100644 ---- a/src/fetch.c -+++ b/src/fetch.c -@@ -120,9 +120,7 @@ static int fetch_package(struct fetch_ctx *fctx, - if (apk_flags & APK_SIMULATE) - return 0; - -- snprintf(url, sizeof(url), "%s%s%s", repo->url, -- repo->url[strlen(repo->url)-1] == '/' ? "" : "/", -- pkgfile); -+ apk_repo_format_filename(url, sizeof(url), repo->url, pkg->arch, pkgfile); - - if (fctx->flags & FETCH_STDOUT) { - fd = STDOUT_FILENO; --- -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 deleted file mode 100644 index 178b66d0e..000000000 --- a/main/apk-tools/0002-upgrade-Improve-english-messages-on-apk-tools-baseli.patch +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 5dbedc3a2..000000000 --- a/main/apk-tools/0003-state-make-the-progress-bar-look-nice.patch +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100644 index fe1a64b6b..000000000 --- a/main/apk-tools/0004-db-Allow-override-arch-when-using-root.patch +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100644 index 887e646a6..000000000 --- a/main/apk-tools/0005-apk-default-screen-width-70-if-ioctl-says-0-as-width.patch +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100644 index 28c837be6..000000000 --- a/main/apk-tools/0006-db-remount-ro-cache-to-rw-earlier-for-update-to-work.patch +++ /dev/null @@ -1,61 +0,0 @@ -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 deleted file mode 100644 index 3f3212131..000000000 --- a/main/apk-tools/0007-state-make-some-of-the-interactive-messages-line-up-.patch +++ /dev/null @@ -1,31 +0,0 @@ -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 c6f429c7a..f677bfae3 100644 --- a/main/apk-tools/APKBUILD +++ b/main/apk-tools/APKBUILD @@ -1,19 +1,12 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=apk-tools -pkgver=2.1.0_rc1 -pkgrel=2 +pkgver=2.1.0 +pkgrel=0 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/" @@ -55,11 +48,4 @@ static() { "$subpkgdir"/sbin/apk.static } -md5sums="cc3ee58fa9672bc003cadc2b20bf33d2 apk-tools-2.1.0_rc1.tar.bz2 -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" +md5sums="9f6d71c9be814afece7a4b73430bd078 apk-tools-2.1.0.tar.bz2" |