Subject: [alpine-devel] [PATCH] testing/btrfs-progs: update to git master

From: Cameron Banta <[email-masked]>
Date: Wed, 11 Apr 2012 17:00:49 +0000

This update now includes btrfsck
---
 testing/btrfs-progs/APKBUILD |   31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/testing/btrfs-progs/APKBUILD b/testing/btrfs-progs/APKBUILD
index b33e3d5..c8a36e0 100644
--- a/testing/btrfs-progs/APKBUILD
+++ b/testing/btrfs-progs/APKBUILD
@@ -1,18 +1,37 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=btrfs-progs
-pkgver=0.19
-pkgrel=1
+_snapshot=20120411
+pkgver=0.19_p${_snapshot}
+_commit=1957076ab4fefa47b6efed3da541bc974c83eed7
+pkgrel=0
 pkgdesc="Tools for the btrfs"
 url="https://btrfs.wiki.kernel.org/"
 arch="all"
 license="GPL"
 depends=
-makedepends="util-linux-dev bash"
+makedepends="util-linux-dev bash libuuid attr-dev zlib-dev acl-dev e2fsprogs-dev"
 install=
 subpackages="$pkgname-doc"
-source="http://www.kernel.org/pub/linux/kernel/people/mason/btrfs/btrfs-progs-$pkgver.tar.bz2"
+source="saveas-http://git.kernel.org/?p=linux/kernel/git/mason/$pkgname.git;a=snapshot;h=$_commit;sf=tgz#/$pkgname-$_commit.tar.gz"
 
-_builddir="$srcdir"/$pkgname-$pkgver
+snapshot() {
+	current_head=$(curl "http://git.kernel.org/?p=linux/kernel/git/mason/$pkgname.git;a=patch" | head -n1 | cut -d" " -f2)
+	current_snapshot=$(grep -e "^_snapshot=.*$" APKBUILD | cut -d"=" -f2)
+	new_snapshot=$(date +"%Y%m%d")
+	if [ "$current_snapshot" = "$new_snapshot" ]; then
+		old_pkgrel=$(grep -e "^pkgrel=.*$" APKBUILD | cut -d"=" -f2)
+		new_pkgrel=$(expr $old_pkgrel + 1 )
+	else
+		new_pkgrel=0
+	fi
+	sed -i "s/^_commit=.*$/_commit=$current_head/" APKBUILD
+	sed -i "s/^pkgrel=.*$/pkgrel=$new_pkgrel/" APKBUILD
+	sed -i "s/^_snapshot=.*$/_snapshot=$new_snapshot/" APKBUILD
+	abuild fetch
+	abuild checksum
+}
+
+_builddir="$srcdir/$pkgname-${_commit:0:7}"
 prepare() {
 	cd "$_builddir"
 }
@@ -31,4 +50,4 @@ package() {
 	# install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
 }
 
-md5sums="5854728d080cc76f21a83bdc99b6ddaa  btrfs-progs-0.19.tar.bz2"
+md5sums="03bb2c38d37ceaebc2b9362ff8f01681  btrfs-progs-1957076ab4fefa47b6efed3da541bc974c83eed7.tar.gz"
-- 
1.7.9.6

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---