summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2014-08-01 09:14:12 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2014-08-01 09:14:12 +0000
commitf47e253fb69f2dde5c25c4ea1f8a2bfdd3fbcd66 (patch)
tree7c91791fdb5f032fffaa02a4e10e2e77d172279f /sys-block
parentfix installation on PaX kernels (thanks to yangjay) (diff)
downloadgentoo-2-f47e253fb69f2dde5c25c4ea1f8a2bfdd3fbcd66.tar.gz
gentoo-2-f47e253fb69f2dde5c25c4ea1f8a2bfdd3fbcd66.tar.bz2
gentoo-2-f47e253fb69f2dde5c25c4ea1f8a2bfdd3fbcd66.zip
Fix portability with, for exaexample, sys-libs/uclibc using upstream patch http://github.com/jthornber/thin-provisioning-tools/commit/e77e8715b0a91a60cf2c4b85933b1063385da122
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
Diffstat (limited to 'sys-block')
-rw-r--r--sys-block/thin-provisioning-tools/ChangeLog11
-rw-r--r--sys-block/thin-provisioning-tools/files/thin-provisioning-tools-0.3.2-Remove-ambiguity-between-boost-uint64_t-and-uint64_t.patch214
-rw-r--r--sys-block/thin-provisioning-tools/thin-provisioning-tools-0.3.2-r1.ebuild51
3 files changed, 275 insertions, 1 deletions
diff --git a/sys-block/thin-provisioning-tools/ChangeLog b/sys-block/thin-provisioning-tools/ChangeLog
index 79db516fd528..21146b414a89 100644
--- a/sys-block/thin-provisioning-tools/ChangeLog
+++ b/sys-block/thin-provisioning-tools/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for sys-block/thin-provisioning-tools
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/thin-provisioning-tools/ChangeLog,v 1.45 2014/07/31 22:21:11 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/thin-provisioning-tools/ChangeLog,v 1.46 2014/08/01 09:14:12 ssuominen Exp $
+
+*thin-provisioning-tools-0.3.2-r1 (01 Aug 2014)
+
+ 01 Aug 2014; Samuli Suominen <ssuominen@gentoo.org> +files/thin-provisioning-t
+ ools-0.3.2-Remove-ambiguity-between-boost-uint64_t-and-uint64_t.patch,
+ +thin-provisioning-tools-0.3.2-r1.ebuild:
+ Fix portability with, for exaexample, sys-libs/uclibc using upstream patch
+ http://github.com/jthornber/thin-provisioning-
+ tools/commit/e77e8715b0a91a60cf2c4b85933b1063385da122
31 Jul 2014; Samuli Suominen <ssuominen@gentoo.org>
-files/thin-provisioning-tools-0.1.5-LDFLAGS.patch,
diff --git a/sys-block/thin-provisioning-tools/files/thin-provisioning-tools-0.3.2-Remove-ambiguity-between-boost-uint64_t-and-uint64_t.patch b/sys-block/thin-provisioning-tools/files/thin-provisioning-tools-0.3.2-Remove-ambiguity-between-boost-uint64_t-and-uint64_t.patch
new file mode 100644
index 000000000000..9dd978070312
--- /dev/null
+++ b/sys-block/thin-provisioning-tools/files/thin-provisioning-tools-0.3.2-Remove-ambiguity-between-boost-uint64_t-and-uint64_t.patch
@@ -0,0 +1,214 @@
+From e77e8715b0a91a60cf2c4b85933b1063385da122 Mon Sep 17 00:00:00 2001
+From: Joe Thornber <ejt@redhat.com>
+Date: Wed, 2 Jul 2014 08:19:20 +0000
+Subject: Remove ambiguity between boost::uint64_t and ::uint64_t.
+
+This has been causing people problems on uclibc builds.
+---
+ caching/cache_metadata_size.cc | 15 +++++++--------
+ caching/xml_format.cc | 7 +++----
+ era/superblock.cc | 5 ++---
+ era/writeset_tree.cc | 5 ++---
+ persistent-data/data-structures/bitset.cc | 7 +++----
+ thin-provisioning/device_tree.h | 4 +---
+ thin-provisioning/metadata_dumper.cc | 2 +-
+ 7 files changed, 19 insertions(+), 26 deletions(-)
+
+diff --git a/caching/cache_metadata_size.cc b/caching/cache_metadata_size.cc
+index 7584da6..5792c49 100644
+--- a/caching/cache_metadata_size.cc
++++ b/caching/cache_metadata_size.cc
+@@ -7,7 +7,6 @@
+ #include <stdint.h>
+ #include <stdexcept>
+
+-using namespace boost;
+ using namespace std;
+
+ //----------------------------------------------------------------
+@@ -18,9 +17,9 @@ namespace {
+ : max_hint_width(4) {
+ }
+
+- optional<uint64_t> device_size;
+- optional<uint32_t> block_size;
+- optional<uint64_t> nr_blocks;
++ boost::optional<uint64_t> device_size;
++ boost::optional<uint32_t> block_size;
++ boost::optional<uint64_t> nr_blocks;
+ uint32_t max_hint_width;
+ };
+
+@@ -58,19 +57,19 @@ namespace {
+ while ((c = getopt_long(argc, argv, short_opts, long_opts, NULL)) != -1) {
+ switch (c) {
+ case 0:
+- fs.block_size = lexical_cast<uint32_t>(optarg);
++ fs.block_size = boost::lexical_cast<uint32_t>(optarg);
+ break;
+
+ case 1:
+- fs.device_size = lexical_cast<uint64_t>(optarg);
++ fs.device_size = boost::lexical_cast<uint64_t>(optarg);
+ break;
+
+ case 2:
+- fs.nr_blocks = lexical_cast<uint64_t>(optarg);
++ fs.nr_blocks = boost::lexical_cast<uint64_t>(optarg);
+ break;
+
+ case 3:
+- fs.max_hint_width = lexical_cast<uint32_t>(optarg);
++ fs.max_hint_width = boost::lexical_cast<uint32_t>(optarg);
+ break;
+
+ case 'h':
+diff --git a/caching/xml_format.cc b/caching/xml_format.cc
+index cb03018..84d6fc2 100644
+--- a/caching/xml_format.cc
++++ b/caching/xml_format.cc
+@@ -5,7 +5,6 @@
+ #include <boost/lexical_cast.hpp>
+ #include <expat.h>
+
+-using namespace boost;
+ using namespace caching;
+ using namespace persistent_data;
+ using namespace std;
+@@ -189,14 +188,14 @@ namespace {
+
+ block_address cblock = get_attr<uint64_t>(attr, "cache_block");
+ decoded_or_error doe = base64_decode(get_attr<string>(attr, "data"));
+- if (!get<vector<unsigned char> >(&doe)) {
++ if (!boost::get<vector<unsigned char> >(&doe)) {
+ ostringstream msg;
+ msg << "invalid base64 encoding of hint for cache block "
+- << cblock << ": " << get<string>(doe);
++ << cblock << ": " << boost::get<string>(doe);
+ throw runtime_error(msg.str());
+ }
+
+- e->hint(cblock, get<vector<unsigned char> >(doe));
++ e->hint(cblock, boost::get<vector<unsigned char> >(doe));
+ }
+
+ // FIXME: why passing e by ptr?
+diff --git a/era/superblock.cc b/era/superblock.cc
+index 1bd1a4f..c319e9b 100644
+--- a/era/superblock.cc
++++ b/era/superblock.cc
+@@ -4,7 +4,6 @@
+ #include "persistent-data/errors.h"
+
+ using namespace base;
+-using namespace boost;
+ using namespace era;
+ using namespace superblock_damage;
+ using namespace persistent_data;
+@@ -149,8 +148,8 @@ superblock_traits::unpack(disk_type const &disk, value_type &value)
+
+ block_address ms = to_cpu<uint64_t>(disk.metadata_snap);
+ value.metadata_snap = (ms == SUPERBLOCK_LOCATION) ?
+- optional<block_address>() :
+- optional<block_address>(ms);
++ boost::optional<block_address>() :
++ boost::optional<block_address>(ms);
+ }
+
+ void
+diff --git a/era/writeset_tree.cc b/era/writeset_tree.cc
+index 54aa6a1..4e2c478 100644
+--- a/era/writeset_tree.cc
++++ b/era/writeset_tree.cc
+@@ -2,7 +2,6 @@
+ #include "persistent-data/data-structures/btree_damage_visitor.h"
+ #include "persistent-data/data-structures/bitset.h"
+
+-using namespace boost;
+ using namespace era;
+ using namespace writeset_tree_detail;
+ using namespace persistent_data;
+@@ -90,8 +89,8 @@ namespace {
+ private:
+ template <typename T>
+ run<uint32_t> to_uint32(run<T> const &r) {
+- return run<uint32_t>(optional<uint32_t>(r.begin_),
+- optional<uint32_t>(r.end_));
++ return run<uint32_t>(boost::optional<uint32_t>(r.begin_),
++ boost::optional<uint32_t>(r.end_));
+ }
+
+ damage_visitor &v_;
+diff --git a/persistent-data/data-structures/bitset.cc b/persistent-data/data-structures/bitset.cc
+index 5851e28..e49e19f 100644
+--- a/persistent-data/data-structures/bitset.cc
++++ b/persistent-data/data-structures/bitset.cc
+@@ -2,7 +2,6 @@
+ #include "persistent-data/data-structures/bitset.h"
+ #include "persistent-data/math_utils.h"
+
+-using namespace boost;
+ using namespace persistent_data;
+ using namespace persistent_data::bitset_detail;
+ using namespace std;
+@@ -12,7 +11,7 @@ using namespace std;
+ namespace {
+ struct bitset_traits {
+ typedef base::le64 disk_type;
+- typedef uint64_t value_type;
++ typedef ::uint64_t value_type;
+ typedef no_op_ref_counter<uint64_t> ref_counter;
+
+ static void unpack(disk_type const &disk, value_type &value) {
+@@ -118,11 +117,11 @@ namespace persistent_data {
+ }
+
+ private:
+- optional<uint32_t> lifted_mult64(optional<uint32_t> const &m) {
++ boost::optional<uint32_t> lifted_mult64(boost::optional<uint32_t> const &m) {
+ if (!m)
+ return m;
+
+- return optional<uint32_t>(*m * 64);
++ return boost::optional<uint32_t>(*m * 64);
+ }
+
+ bitset_visitor &v_;
+diff --git a/thin-provisioning/device_tree.h b/thin-provisioning/device_tree.h
+index 320eb73..23ae924 100644
+--- a/thin-provisioning/device_tree.h
++++ b/thin-provisioning/device_tree.h
+@@ -4,8 +4,6 @@
+ #include "persistent-data/data-structures/btree.h"
+ #include "persistent-data/run.h"
+
+-using namespace boost;
+-
+ //----------------------------------------------------------------
+
+ namespace thin_provisioning {
+@@ -50,7 +48,7 @@ namespace thin_provisioning {
+
+ class damage_visitor {
+ public:
+- typedef shared_ptr<damage_visitor> ptr;
++ typedef boost::shared_ptr<damage_visitor> ptr;
+
+ virtual ~damage_visitor() {}
+
+diff --git a/thin-provisioning/metadata_dumper.cc b/thin-provisioning/metadata_dumper.cc
+index dfe18e0..0bd284e 100644
+--- a/thin-provisioning/metadata_dumper.cc
++++ b/thin-provisioning/metadata_dumper.cc
+@@ -226,7 +226,7 @@ thin_provisioning::metadata_dump(metadata::ptr md, emitter::ptr e, bool repair)
+ md->sb_.trans_id_,
+ md->sb_.data_block_size_,
+ md->data_sm_->get_nr_blocks(),
+- optional<block_address>());
++ boost::optional<block_address>());
+
+ {
+ mapping_tree_detail::damage_visitor::ptr md_policy(mapping_damage_policy(repair));
+--
+2.0.2
+
diff --git a/sys-block/thin-provisioning-tools/thin-provisioning-tools-0.3.2-r1.ebuild b/sys-block/thin-provisioning-tools/thin-provisioning-tools-0.3.2-r1.ebuild
new file mode 100644
index 000000000000..daad187ab68e
--- /dev/null
+++ b/sys-block/thin-provisioning-tools/thin-provisioning-tools-0.3.2-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-block/thin-provisioning-tools/thin-provisioning-tools-0.3.2-r1.ebuild,v 1.1 2014/08/01 09:14:12 ssuominen Exp $
+
+EAPI=5
+inherit autotools eutils
+
+DESCRIPTION="A suite of tools for thin provisioning on Linux."
+HOMEPAGE="http://github.com/jthornber/thin-provisioning-tools"
+EXT=.tar.gz
+BASE_A=${P}${EXT}
+SRC_URI="http://github.com/jthornber/${PN}/archive/v${PV}${EXT} -> ${BASE_A}"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="test"
+
+RDEPEND="dev-libs/expat"
+# || ( ) is a non-future proof workaround for Portage unefficiency wrt #477050
+DEPEND="${RDEPEND}
+ test? (
+ || ( dev-lang/ruby:2.9 dev-lang/ruby:2.8 dev-lang/ruby:2.7 dev-lang/ruby:2.6 dev-lang/ruby:2.5 dev-lang/ruby:2.4 dev-lang/ruby:2.3 dev-lang/ruby:2.2 dev-lang/ruby:2.1 dev-lang/ruby:2.0 dev-lang/ruby:1.9 dev-lang/ruby:1.8 )
+ dev-cpp/gmock
+ dev-util/cucumber
+ dev-util/aruba
+ )
+ dev-libs/boost"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-Remove-ambiguity-between-boost-uint64_t-and-uint64_t.patch
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --prefix="${EPREFIX}"/ \
+ --bindir="${EPREFIX}"/sbin \
+ --with-optimisation='' \
+ $(use_enable test testing)
+}
+
+src_install() {
+ emake install DESTDIR="${D}" MANDIR=/usr/share/man
+ dodoc README.md TODO.org
+}
+
+src_test() {
+ emake unit-test
+}