diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2018-08-17 13:18:18 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-08-17 13:19:34 +0000 |
commit | 09b110fc99a36f12c0b49e6029a231a231ce920d (patch) | |
tree | 211eb6b1402d3132b2ec58a3ffbd10ccec1a6b82 /main/apk-tools | |
parent | f7882fd0f55ba9f745e4206fb1b19eb73ffdacf4 (diff) | |
download | aports-09b110fc99a36f12c0b49e6029a231a231ce920d.tar.bz2 aports-09b110fc99a36f12c0b49e6029a231a231ce920d.tar.xz |
main/apk-tools: don't update index on delete
backport from upstream
Diffstat (limited to 'main/apk-tools')
-rw-r--r-- | main/apk-tools/0001-prevent-automatic-repository-index-update-for-apk-de.patch | 73 | ||||
-rw-r--r-- | main/apk-tools/APKBUILD | 8 |
2 files changed, 78 insertions, 3 deletions
diff --git a/main/apk-tools/0001-prevent-automatic-repository-index-update-for-apk-de.patch b/main/apk-tools/0001-prevent-automatic-repository-index-update-for-apk-de.patch new file mode 100644 index 0000000000..b9c130a1b5 --- /dev/null +++ b/main/apk-tools/0001-prevent-automatic-repository-index-update-for-apk-de.patch @@ -0,0 +1,73 @@ +From e1a05c74cb8ae6ab41ee960343cc64a0a9af95a5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> +Date: Wed, 18 Jul 2018 13:28:49 +0300 +Subject: [PATCH] prevent automatic repository index update for 'apk del' + +ref #9063 +--- + src/apk_database.h | 3 ++- + src/database.c | 6 ++++-- + src/del.c | 2 +- + 3 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/src/apk_database.h b/src/apk_database.h +index 19bafcd..2a7cb3b 100644 +--- a/src/apk_database.h ++++ b/src/apk_database.h +@@ -156,7 +156,7 @@ struct apk_database { + unsigned int pending_triggers; + int performing_self_upgrade : 1; + int permanent : 1; +- int open_write : 1; ++ int autoupdate : 1; + int open_complete : 1; + int compat_newfeatures : 1; + int compat_notinstallable : 1; +@@ -211,6 +211,7 @@ struct apk_db_file *apk_db_file_query(struct apk_database *db, + #define APK_OPENF_NO_SYS_REPOS 0x0100 + #define APK_OPENF_NO_INSTALLED_REPO 0x0200 + #define APK_OPENF_CACHE_WRITE 0x0400 ++#define APK_OPENF_NO_AUTOUPDATE 0x0800 + + #define APK_OPENF_NO_REPOS (APK_OPENF_NO_SYS_REPOS | \ + APK_OPENF_NO_INSTALLED_REPO) +diff --git a/src/database.c b/src/database.c +index db34ed3..70a1053 100644 +--- a/src/database.c ++++ b/src/database.c +@@ -1519,7 +1519,9 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts) + r = -1; + goto ret_r; + } +- if (dbopts->open_flags & APK_OPENF_WRITE) db->open_write = 1; ++ if ((dbopts->open_flags & APK_OPENF_WRITE) && ++ !(dbopts->open_flags & APK_OPENF_NO_AUTOUPDATE)) ++ db->autoupdate = 1; + if (!dbopts->cache_dir) dbopts->cache_dir = "etc/apk/cache"; + + apk_db_setup_repositories(db, dbopts->cache_dir); +@@ -2266,7 +2268,7 @@ int apk_db_add_repository(apk_database_t _db, apk_blob_t _repository) + r = apk_repo_format_real_url(db, repo, NULL, buf, sizeof(buf)); + if (r == 0) apk_message("fetch %s", buf); + } else { +- if (db->open_write) apk_repository_update(db, repo); ++ if (db->autoupdate) apk_repository_update(db, repo); + r = apk_repo_format_cache_index(APK_BLOB_BUF(buf), repo); + } + } else { +diff --git a/src/del.c b/src/del.c +index d1a6015..8e149ab 100644 +--- a/src/del.c ++++ b/src/del.c +@@ -161,7 +161,7 @@ static struct apk_applet apk_del = { + .name = "del", + .help = "Remove PACKAGEs from 'world' and uninstall them", + .arguments = "PACKAGE...", +- .open_flags = APK_OPENF_WRITE, ++ .open_flags = APK_OPENF_WRITE | APK_OPENF_NO_AUTOUPDATE, + .command_groups = APK_COMMAND_GROUP_INSTALL, + .context_size = sizeof(struct del_ctx), + .optgroups = { &optgroup_global, &optgroup_commit, &optgroup_applet }, +-- +2.18.0 + diff --git a/main/apk-tools/APKBUILD b/main/apk-tools/APKBUILD index 59016fdb97..17c3401d70 100644 --- a/main/apk-tools/APKBUILD +++ b/main/apk-tools/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=apk-tools pkgver=2.10.0 -pkgrel=1 +pkgrel=2 pkgdesc="Alpine Package Keeper - package manager for alpine" subpackages="$pkgname-static" depends= @@ -13,7 +13,8 @@ if [ "$CBUILD" = "$CHOST" ]; then makedepends="$makedepends lua5.2-dev" fi source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.xz - 0001-list-fix-segmentation-fault-with-virtual-packages.patch" + 0001-list-fix-segmentation-fault-with-virtual-packages.patch + 0001-prevent-automatic-repository-index-update-for-apk-de.patch" url="https://git.alpinelinux.org/cgit/apk-tools/" arch="all" @@ -83,4 +84,5 @@ luaapk() { } sha512sums="96b840fa5fb7342bb5f6ad5c25e837f705299256e168130d6ef5c1940569df3e7dfa50d36128c0f9a76e662c80b342dd92a8270acd82b4eb91093020b599fcc6 apk-tools-2.10.0.tar.xz -1e83e68b67dd66a0a8ccdbb6ca34ccb7748eff82d032d0d9101b7155a0ff768dc2a849e99387cb9970f0fd9ff5606d08fca9f3bd1a5a561b8b0995d97c69e971 0001-list-fix-segmentation-fault-with-virtual-packages.patch" +1e83e68b67dd66a0a8ccdbb6ca34ccb7748eff82d032d0d9101b7155a0ff768dc2a849e99387cb9970f0fd9ff5606d08fca9f3bd1a5a561b8b0995d97c69e971 0001-list-fix-segmentation-fault-with-virtual-packages.patch +8fb88998baa470b4ea498a3f75f19d981e7f41055e472fabf24a2c6ae478aa34f686c43b615b3c492ee4805369a1cbff3ee0a2e81b31257b080845b3d492872d 0001-prevent-automatic-repository-index-update-for-apk-de.patch" |