aboutsummaryrefslogtreecommitdiffstats
path: root/main/apk-tools
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-10-20 09:29:01 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-10-20 09:36:42 +0000
commit9fa13facca8d489a38f9bb3a120bdd9f4e886044 (patch)
tree56bb400120ae7694c9d73fc9abe49f4f4c825fc7 /main/apk-tools
parent3438ca7110038748172d38f87f7ad095af2bbb56 (diff)
downloadaports-9fa13facca8d489a38f9bb3a120bdd9f4e886044.tar.bz2
aports-9fa13facca8d489a38f9bb3a120bdd9f4e886044.tar.xz
main/apk-tools: upgrade to 2.2.0_pre1
Diffstat (limited to 'main/apk-tools')
-rw-r--r--main/apk-tools/0001-db-remount-read-only-after-the-file-handles-have-bee.patch45
-rw-r--r--main/apk-tools/0002-db-more-fix-for-read-only-cache-remounting.patch91
-rw-r--r--main/apk-tools/APKBUILD29
3 files changed, 10 insertions, 155 deletions
diff --git a/main/apk-tools/0001-db-remount-read-only-after-the-file-handles-have-bee.patch b/main/apk-tools/0001-db-remount-read-only-after-the-file-handles-have-bee.patch
deleted file mode 100644
index 45b75a3329..0000000000
--- a/main/apk-tools/0001-db-remount-read-only-after-the-file-handles-have-bee.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 38e54240a38266c0c1864e51e4ca7468a429646e Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Fri, 27 May 2011 11:38:50 +0000
-Subject: [PATCH 1/2] db: remount read-only after the file handles have been
- closed
-
-The apk cache might be on the readonly media so we need wait with
-remounting til after atleast this filehandle is closed.
----
- src/database.c | 12 ++++++------
- 1 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/src/database.c b/src/database.c
-index 1d4c573..0fc59df 100644
---- a/src/database.c
-+++ b/src/database.c
-@@ -1397,12 +1397,6 @@ void apk_db_close(struct apk_database *db)
- struct hlist_node *dc, *dn;
- int i;
-
-- if (db->cache_remount_dir) {
-- do_remount(db->cache_remount_dir, "ro");
-- free(db->cache_remount_dir);
-- db->cache_remount_dir = NULL;
-- }
--
- apk_id_cache_free(&db->id_cache);
-
- list_for_each_entry(ipkg, &db->installed.packages, installed_pkgs_list) {
-@@ -1436,6 +1430,12 @@ void apk_db_close(struct apk_database *db)
- close(db->lock_fd);
- if (db->root != NULL)
- free(db->root);
-+
-+ if (db->cache_remount_dir) {
-+ do_remount(db->cache_remount_dir, "ro");
-+ free(db->cache_remount_dir);
-+ db->cache_remount_dir = NULL;
-+ }
- }
-
- static int fire_triggers(apk_hash_item item, void *ctx)
---
-1.7.5.2
-
diff --git a/main/apk-tools/0002-db-more-fix-for-read-only-cache-remounting.patch b/main/apk-tools/0002-db-more-fix-for-read-only-cache-remounting.patch
deleted file mode 100644
index 7fee4d7353..0000000000
--- a/main/apk-tools/0002-db-more-fix-for-read-only-cache-remounting.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 95555ede4d732878d576415e5d338b0104b78ad6 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
-Date: Fri, 27 May 2011 16:49:25 +0300
-Subject: [PATCH 2/2] db: more fix for read-only cache remounting
-
-remount to read-write before trying to create the cache directory
-subdirs. fix a fd leak that might prevent remounting back to rw.
----
- src/apk_database.h | 1 -
- src/database.c | 31 ++++++++++++++-----------------
- src/url.c | 1 +
- 3 files changed, 15 insertions(+), 18 deletions(-)
-
-diff --git a/src/apk_database.h b/src/apk_database.h
-index 9b032e7..b28a77b 100644
---- a/src/apk_database.h
-+++ b/src/apk_database.h
-@@ -110,7 +110,6 @@ struct apk_database {
- apk_blob_t *arch;
- unsigned int local_repos;
- int permanent : 1;
-- int ro_cache : 1;
- int compat_newfeatures : 1;
- int compat_notinstallable : 1;
-
-diff --git a/src/database.c b/src/database.c
-index 0fc59df..9617b4e 100644
---- a/src/database.c
-+++ b/src/database.c
-@@ -1218,10 +1218,22 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
-
- db->cache_dir = apk_linked_cache_dir;
- db->cache_fd = fd;
-+ if ((dbopts->open_flags & (APK_OPENF_WRITE | APK_OPENF_CACHE_WRITE)) &&
-+ fstatvfs(fd, &stvfs) == 0 && (stvfs.f_flag & ST_RDONLY) != 0) {
-+ /* 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;
-+ }
-+ }
- mkdirat(db->cache_fd, "tmp", 0644);
- db->cachetmp_fd = openat(db->cache_fd, "tmp", O_RDONLY | O_CLOEXEC);
-- if (fstatvfs(fd, &stvfs) == 0 && (stvfs.f_flag & ST_RDONLY) != 0)
-- db->ro_cache = 1;
- } else {
- if (fd >= 0)
- close(fd);
-@@ -1264,21 +1276,6 @@ 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));
-diff --git a/src/url.c b/src/url.c
-index 0a17a7a..1fa9d66 100644
---- a/src/url.c
-+++ b/src/url.c
-@@ -136,6 +136,7 @@ int apk_url_download(const char *url, int atfd, const char *file)
- exit(0);
- }
-
-+ close(fd);
- waitpid(pid, &status, 0);
- status = translate_wget(status);
- if (status != 0) {
---
-1.7.5.2
-
diff --git a/main/apk-tools/APKBUILD b/main/apk-tools/APKBUILD
index 170b1533ea..bdb79fd40e 100644
--- a/main/apk-tools/APKBUILD
+++ b/main/apk-tools/APKBUILD
@@ -1,14 +1,12 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=apk-tools
-pkgver=2.1.0
-pkgrel=2
+pkgver=2.2.0_pre1
+pkgrel=0
pkgdesc="Alpine Package Keeper - package manager for alpine"
subpackages="$pkgname-static lua-apk:luaapk"
depends=
makedepends="zlib-dev openssl-dev lua-dev"
-source="http://git.alpinelinux.org/cgit/$pkgname.git/snapshot/$pkgname-$pkgver.tar.bz2
- 0001-db-remount-read-only-after-the-file-handles-have-bee.patch
- 0002-db-more-fix-for-read-only-cache-remounting.patch
+source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2
"
url="http://git.alpinelinux.org/cgit/apk-tools/"
@@ -26,27 +24,22 @@ prepare() {
done
echo "FULL_VERSION=$pkgver-r$pkgrel" > config.mk || return 1
+ echo "LUAAPK=YesPlease" >> config.mk
+ echo "export LUAAPK" >> config.mk
}
build() {
cd "$_builddir"
make || return 1
make static || return 1
- ${CC:-gcc} $CFLAGS -fPIC -DAPK_VERSION=\"$pkgver-r$pkgrel\" $LDFLAGS -shared \
- -llua src/version.o src/lua-apk.c -o apk.so
}
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install
- cd "$pkgdir/sbin"
- ln -s apk apk_add
- ln -s apk apk_audit
- ln -s apk apk_del
- ln -s apk apk_index
- ln -s apk apk_info
- ln -s apk apk_version
install -d "$pkgdir"/var/lib/apk "$pkgdir"/var/cache/misc
+ # the shipped README is empty
+ rm -r "$pkgdir"/usr/share/
}
static() {
@@ -57,10 +50,8 @@ static() {
luaapk() {
pkgdesc="Lua module for apk-tools"
- mkdir -p "$subpkgdir"/usr/lib/lua/5.1
- install "$_builddir"/apk.so "$subpkgdir"/usr/lib/lua/5.1/
+ mkdir -p "$subpkgdir"/usr/
+ mv "$pkgdir"/usr/lib "$subpkgdir"/usr/lib/
}
-md5sums="9f6d71c9be814afece7a4b73430bd078 apk-tools-2.1.0.tar.bz2
-6eb78a324be996c831d4850c81ad5821 0001-db-remount-read-only-after-the-file-handles-have-bee.patch
-9ca0a44c17b43e95a7f1bd8107db74da 0002-db-more-fix-for-read-only-cache-remounting.patch"
+md5sums="cda5172b66e7778b855dfda44e5f174f apk-tools-2.2.0_pre1.tar.bz2"