diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-10-20 09:29:01 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-10-20 09:36:42 +0000 |
commit | 9fa13facca8d489a38f9bb3a120bdd9f4e886044 (patch) | |
tree | 56bb400120ae7694c9d73fc9abe49f4f4c825fc7 | |
parent | 3438ca7110038748172d38f87f7ad095af2bbb56 (diff) | |
download | alpine_aports-9fa13facca8d489a38f9bb3a120bdd9f4e886044.tar.bz2 alpine_aports-9fa13facca8d489a38f9bb3a120bdd9f4e886044.tar.xz alpine_aports-9fa13facca8d489a38f9bb3a120bdd9f4e886044.zip |
main/apk-tools: upgrade to 2.2.0_pre1
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 @@ | |||
1 | From 38e54240a38266c0c1864e51e4ca7468a429646e Mon Sep 17 00:00:00 2001 | ||
2 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
3 | Date: Fri, 27 May 2011 11:38:50 +0000 | ||
4 | Subject: [PATCH 1/2] db: remount read-only after the file handles have been | ||
5 | closed | ||
6 | |||
7 | The apk cache might be on the readonly media so we need wait with | ||
8 | remounting til after atleast this filehandle is closed. | ||
9 | --- | ||
10 | src/database.c | 12 ++++++------ | ||
11 | 1 files changed, 6 insertions(+), 6 deletions(-) | ||
12 | |||
13 | diff --git a/src/database.c b/src/database.c | ||
14 | index 1d4c573..0fc59df 100644 | ||
15 | --- a/src/database.c | ||
16 | +++ b/src/database.c | ||
17 | @@ -1397,12 +1397,6 @@ void apk_db_close(struct apk_database *db) | ||
18 | struct hlist_node *dc, *dn; | ||
19 | int i; | ||
20 | |||
21 | - if (db->cache_remount_dir) { | ||
22 | - do_remount(db->cache_remount_dir, "ro"); | ||
23 | - free(db->cache_remount_dir); | ||
24 | - db->cache_remount_dir = NULL; | ||
25 | - } | ||
26 | - | ||
27 | apk_id_cache_free(&db->id_cache); | ||
28 | |||
29 | list_for_each_entry(ipkg, &db->installed.packages, installed_pkgs_list) { | ||
30 | @@ -1436,6 +1430,12 @@ void apk_db_close(struct apk_database *db) | ||
31 | close(db->lock_fd); | ||
32 | if (db->root != NULL) | ||
33 | free(db->root); | ||
34 | + | ||
35 | + if (db->cache_remount_dir) { | ||
36 | + do_remount(db->cache_remount_dir, "ro"); | ||
37 | + free(db->cache_remount_dir); | ||
38 | + db->cache_remount_dir = NULL; | ||
39 | + } | ||
40 | } | ||
41 | |||
42 | static int fire_triggers(apk_hash_item item, void *ctx) | ||
43 | -- | ||
44 | 1.7.5.2 | ||
45 | |||
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 @@ | |||
1 | From 95555ede4d732878d576415e5d338b0104b78ad6 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> | ||
3 | Date: Fri, 27 May 2011 16:49:25 +0300 | ||
4 | Subject: [PATCH 2/2] db: more fix for read-only cache remounting | ||
5 | |||
6 | remount to read-write before trying to create the cache directory | ||
7 | subdirs. fix a fd leak that might prevent remounting back to rw. | ||
8 | --- | ||
9 | src/apk_database.h | 1 - | ||
10 | src/database.c | 31 ++++++++++++++----------------- | ||
11 | src/url.c | 1 + | ||
12 | 3 files changed, 15 insertions(+), 18 deletions(-) | ||
13 | |||
14 | diff --git a/src/apk_database.h b/src/apk_database.h | ||
15 | index 9b032e7..b28a77b 100644 | ||
16 | --- a/src/apk_database.h | ||
17 | +++ b/src/apk_database.h | ||
18 | @@ -110,7 +110,6 @@ struct apk_database { | ||
19 | apk_blob_t *arch; | ||
20 | unsigned int local_repos; | ||
21 | int permanent : 1; | ||
22 | - int ro_cache : 1; | ||
23 | int compat_newfeatures : 1; | ||
24 | int compat_notinstallable : 1; | ||
25 | |||
26 | diff --git a/src/database.c b/src/database.c | ||
27 | index 0fc59df..9617b4e 100644 | ||
28 | --- a/src/database.c | ||
29 | +++ b/src/database.c | ||
30 | @@ -1218,10 +1218,22 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts) | ||
31 | |||
32 | db->cache_dir = apk_linked_cache_dir; | ||
33 | db->cache_fd = fd; | ||
34 | + if ((dbopts->open_flags & (APK_OPENF_WRITE | APK_OPENF_CACHE_WRITE)) && | ||
35 | + fstatvfs(fd, &stvfs) == 0 && (stvfs.f_flag & ST_RDONLY) != 0) { | ||
36 | + /* remount cache read-write */ | ||
37 | + db->cache_remount_dir = find_mountpoint(db->root_fd, db->cache_dir); | ||
38 | + if (db->cache_remount_dir == NULL) { | ||
39 | + apk_warning("Unable to find cache directory mount point"); | ||
40 | + } else if (do_remount(db->cache_remount_dir, "rw") != 0) { | ||
41 | + free(db->cache_remount_dir); | ||
42 | + db->cache_remount_dir = NULL; | ||
43 | + apk_error("Unable to remount cache read-write"); | ||
44 | + r = EROFS; | ||
45 | + goto ret_r; | ||
46 | + } | ||
47 | + } | ||
48 | mkdirat(db->cache_fd, "tmp", 0644); | ||
49 | db->cachetmp_fd = openat(db->cache_fd, "tmp", O_RDONLY | O_CLOEXEC); | ||
50 | - if (fstatvfs(fd, &stvfs) == 0 && (stvfs.f_flag & ST_RDONLY) != 0) | ||
51 | - db->ro_cache = 1; | ||
52 | } else { | ||
53 | if (fd >= 0) | ||
54 | close(fd); | ||
55 | @@ -1264,21 +1276,6 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts) | ||
56 | } | ||
57 | } | ||
58 | |||
59 | - if ((dbopts->open_flags & (APK_OPENF_WRITE | APK_OPENF_CACHE_WRITE)) && | ||
60 | - db->ro_cache) { | ||
61 | - /* remount cache read-write */ | ||
62 | - db->cache_remount_dir = find_mountpoint(db->root_fd, db->cache_dir); | ||
63 | - if (db->cache_remount_dir == NULL) { | ||
64 | - apk_warning("Unable to find cache directory mount point"); | ||
65 | - } else if (do_remount(db->cache_remount_dir, "rw") != 0) { | ||
66 | - free(db->cache_remount_dir); | ||
67 | - db->cache_remount_dir = NULL; | ||
68 | - apk_error("Unable to remount cache read-write"); | ||
69 | - r = EROFS; | ||
70 | - goto ret_r; | ||
71 | - } | ||
72 | - } | ||
73 | - | ||
74 | if (!(dbopts->open_flags & APK_OPENF_NO_SYS_REPOS)) { | ||
75 | list_for_each_entry(repo, &dbopts->repository_list, list) { | ||
76 | r = apk_db_add_repository(db, APK_BLOB_STR(repo->url)); | ||
77 | diff --git a/src/url.c b/src/url.c | ||
78 | index 0a17a7a..1fa9d66 100644 | ||
79 | --- a/src/url.c | ||
80 | +++ b/src/url.c | ||
81 | @@ -136,6 +136,7 @@ int apk_url_download(const char *url, int atfd, const char *file) | ||
82 | exit(0); | ||
83 | } | ||
84 | |||
85 | + close(fd); | ||
86 | waitpid(pid, &status, 0); | ||
87 | status = translate_wget(status); | ||
88 | if (status != 0) { | ||
89 | -- | ||
90 | 1.7.5.2 | ||
91 | |||
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 @@ | |||
1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
2 | pkgname=apk-tools | 2 | pkgname=apk-tools |
3 | pkgver=2.1.0 | 3 | pkgver=2.2.0_pre1 |
4 | pkgrel=2 | 4 | pkgrel=0 |
5 | pkgdesc="Alpine Package Keeper - package manager for alpine" | 5 | pkgdesc="Alpine Package Keeper - package manager for alpine" |
6 | subpackages="$pkgname-static lua-apk:luaapk" | 6 | subpackages="$pkgname-static lua-apk:luaapk" |
7 | depends= | 7 | depends= |
8 | makedepends="zlib-dev openssl-dev lua-dev" | 8 | makedepends="zlib-dev openssl-dev lua-dev" |
9 | source="http://git.alpinelinux.org/cgit/$pkgname.git/snapshot/$pkgname-$pkgver.tar.bz2 | 9 | source="http://git.alpinelinux.org/cgit/$pkgname/snapshot/$pkgname-$pkgver.tar.bz2 |
10 | 0001-db-remount-read-only-after-the-file-handles-have-bee.patch | ||
11 | 0002-db-more-fix-for-read-only-cache-remounting.patch | ||
12 | " | 10 | " |
13 | 11 | ||
14 | url="http://git.alpinelinux.org/cgit/apk-tools/" | 12 | url="http://git.alpinelinux.org/cgit/apk-tools/" |
@@ -26,27 +24,22 @@ prepare() { | |||
26 | done | 24 | done |
27 | 25 | ||
28 | echo "FULL_VERSION=$pkgver-r$pkgrel" > config.mk || return 1 | 26 | echo "FULL_VERSION=$pkgver-r$pkgrel" > config.mk || return 1 |
27 | echo "LUAAPK=YesPlease" >> config.mk | ||
28 | echo "export LUAAPK" >> config.mk | ||
29 | } | 29 | } |
30 | 30 | ||
31 | build() { | 31 | build() { |
32 | cd "$_builddir" | 32 | cd "$_builddir" |
33 | make || return 1 | 33 | make || return 1 |
34 | make static || return 1 | 34 | make static || return 1 |
35 | ${CC:-gcc} $CFLAGS -fPIC -DAPK_VERSION=\"$pkgver-r$pkgrel\" $LDFLAGS -shared \ | ||
36 | -llua src/version.o src/lua-apk.c -o apk.so | ||
37 | } | 35 | } |
38 | 36 | ||
39 | package() { | 37 | package() { |
40 | cd "$_builddir" | 38 | cd "$_builddir" |
41 | make DESTDIR="$pkgdir" install | 39 | make DESTDIR="$pkgdir" install |
42 | cd "$pkgdir/sbin" | ||
43 | ln -s apk apk_add | ||
44 | ln -s apk apk_audit | ||
45 | ln -s apk apk_del | ||
46 | ln -s apk apk_index | ||
47 | ln -s apk apk_info | ||
48 | ln -s apk apk_version | ||
49 | install -d "$pkgdir"/var/lib/apk "$pkgdir"/var/cache/misc | 40 | install -d "$pkgdir"/var/lib/apk "$pkgdir"/var/cache/misc |
41 | # the shipped README is empty | ||
42 | rm -r "$pkgdir"/usr/share/ | ||
50 | } | 43 | } |
51 | 44 | ||
52 | static() { | 45 | static() { |
@@ -57,10 +50,8 @@ static() { | |||
57 | 50 | ||
58 | luaapk() { | 51 | luaapk() { |
59 | pkgdesc="Lua module for apk-tools" | 52 | pkgdesc="Lua module for apk-tools" |
60 | mkdir -p "$subpkgdir"/usr/lib/lua/5.1 | 53 | mkdir -p "$subpkgdir"/usr/ |
61 | install "$_builddir"/apk.so "$subpkgdir"/usr/lib/lua/5.1/ | 54 | mv "$pkgdir"/usr/lib "$subpkgdir"/usr/lib/ |
62 | } | 55 | } |
63 | 56 | ||
64 | md5sums="9f6d71c9be814afece7a4b73430bd078 apk-tools-2.1.0.tar.bz2 | 57 | md5sums="cda5172b66e7778b855dfda44e5f174f apk-tools-2.2.0_pre1.tar.bz2" |
65 | 6eb78a324be996c831d4850c81ad5821 0001-db-remount-read-only-after-the-file-handles-have-bee.patch | ||
66 | 9ca0a44c17b43e95a7f1bd8107db74da 0002-db-more-fix-for-read-only-cache-remounting.patch" | ||