aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-09-06 18:25:35 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2008-09-06 19:14:36 +0100
commiteca10c830311c47692c5216dbe99d342fc50658a (patch)
tree519fd47bc9603528e9d61f2e2a535d17414ef80b
parent70f3752ce413eeaf1651c2c572bbc4583ba6fb94 (diff)
downloadpaludis-eca10c830311c47692c5216dbe99d342fc50658a.tar.gz
paludis-eca10c830311c47692c5216dbe99d342fc50658a.tar.xz
Support for unpacking gitweb snapshots.
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc30
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh31
-rw-r--r--paludis/repositories/e/eapi.cc1
-rw-r--r--paludis/repositories/e/eapi.hh2
-rw-r--r--paludis/repositories/e/eapis/0.conf1
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf1
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf1
-rw-r--r--paludis/repositories/e/ebuild.cc2
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/unpack16
9 files changed, 83 insertions, 2 deletions
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 4d80645..713c29a 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1196,6 +1196,16 @@ namespace test_cases
}
{
+ TestMessageSuffix suffix("no stupid gitweb hack 0", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/stupid-gitweb-hack-0",
+ &env, UserPackageDepSpecOptions()))))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "0");
+ id->perform_action(action);
+ }
+
+ {
TestMessageSuffix suffix("no src_prepare 0", true);
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-0",
@@ -1336,6 +1346,16 @@ namespace test_cases
}
{
+ TestMessageSuffix suffix("no stupid gitweb hack 1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/stupid-gitweb-hack-1",
+ &env, UserPackageDepSpecOptions()))))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "1");
+ id->perform_action(action);
+ }
+
+ {
TestMessageSuffix suffix("no src_prepare 1", true);
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-1",
@@ -1422,6 +1442,16 @@ namespace test_cases
}
{
+ TestMessageSuffix suffix("stupid gitweb hack 2", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/stupid-gitweb-hack-2",
+ &env, UserPackageDepSpecOptions()))))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
+ id->perform_action(action);
+ }
+
+ {
TestMessageSuffix suffix("src_prepare 2", true);
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-2",
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index b3a9a71..470f9e3 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -913,6 +913,37 @@ pkg_preinst() {
[[ -d "${T}" ]] || die "T not a dir"
}
END
+mkdir -p "cat/stupid-gitweb-hack"
+cat <<END > cat/stupid-gitweb-hack/stupid-gitweb-hack-0.ebuild
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_unpack() {
+ touch "\${T}/foogz"
+ tar czf 'foo;sf=tgz' -C "\${T}" .
+ rm "\${T}/foogz"
+ [[ -f 'foo;sf=tgz' ]] || die
+ [[ -f foogz ]] && die
+ unpack './foo;sf=tgz'
+ [[ -f foogz ]] && die # MEH
+
+ touch "\${T}/foobz2"
+ tar cjf 'foo;sf=tbz2' -C "\${T}" .
+ rm "\${T}/foobz2"
+ [[ -f 'foo;sf=tbz2' ]] || die
+ [[ -f foobz2 ]] && die
+ unpack './foo;sf=tbz2'
+ [[ -f foobz2 ]] && die # MEH
+}
+END
+cp cat/stupid-gitweb-hack/stupid-gitweb-hack-{0,1}.ebuild || exit 1
+sed -e '/MEH/s/&&/||/' cat/stupid-gitweb-hack/stupid-gitweb-hack-0.ebuild > cat/stupid-gitweb-hack/stupid-gitweb-hack-2.ebuild || exit 1
mkdir -p "cat/src_prepare"
cat <<END > cat/src_prepare/src_prepare-0.ebuild || exit 1
EAPI="\${PV}"
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 78a0deb..43999a4 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -201,6 +201,7 @@ namespace
value_for<n::dosym_mkdir>(destringify_key<bool>(k, "dosym_mkdir")),
value_for<n::failure_is_fatal>(destringify_key<bool>(k, "failure_is_fatal")),
value_for<n::unpack_fix_permissions>(destringify_key<bool>(k, "unpack_fix_permissions")),
+ value_for<n::unpack_stupid_gitweb_hack>(destringify_key<bool>(k, "unpack_stupid_gitweb_hack")),
value_for<n::unpack_unrecognised_is_fatal>(destringify_key<bool>(k, "unpack_unrecognised_is_fatal"))
)));
}
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 33f8fae..12a81cd 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -131,6 +131,7 @@ namespace paludis
struct supported;
struct tools_options;
struct unpack_fix_permissions;
+ struct unpack_stupid_gitweb_hack;
struct unpack_unrecognised_is_fatal;
struct upstream_changelog;
struct upstream_documentation;
@@ -335,6 +336,7 @@ namespace paludis
NamedValue<n::dosym_mkdir, bool> dosym_mkdir;
NamedValue<n::failure_is_fatal, bool> failure_is_fatal;
NamedValue<n::unpack_fix_permissions, bool> unpack_fix_permissions;
+ NamedValue<n::unpack_stupid_gitweb_hack, bool> unpack_stupid_gitweb_hack;
NamedValue<n::unpack_unrecognised_is_fatal, bool> unpack_unrecognised_is_fatal;
};
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 51fd238..6e9b512 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -232,6 +232,7 @@ pipe_commands_no_slot_or_repo = true
unpack_unrecognised_is_fatal = false
unpack_fix_permissions = true
+unpack_stupid_gitweb_hack = false
doman_lang_filenames = false
dosym_mkdir = true
failure_is_fatal = false
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 63afb8f..1b59113 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -267,6 +267,7 @@ pipe_commands_no_slot_or_repo = false
unpack_unrecognised_is_fatal = true
unpack_fix_permissions = false
+unpack_stupid_gitweb_hack = false
doman_lang_filenames = true
dosym_mkdir = false
failure_is_fatal = true
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index baee76f..cac58f2 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -247,6 +247,7 @@ pipe_commands_no_slot_or_repo = true
unpack_unrecognised_is_fatal = false
unpack_fix_permissions = false
+unpack_stupid_gitweb_hack = true
doman_lang_filenames = true
dosym_mkdir = false
failure_is_fatal = false
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 3f3183b..e909afb 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -189,6 +189,8 @@ EbuildCommand::operator() ()
params.package_id()->eapi()->supported()->tools_options()->unpack_unrecognised_is_fatal() ? "yes" : "")
.with_setenv("PALUDIS_UNPACK_FIX_PERMISSIONS",
params.package_id()->eapi()->supported()->tools_options()->unpack_fix_permissions() ? "yes" : "")
+ .with_setenv("PALUDIS_UNPACK_STUPID_GITWEB_HACK",
+ params.package_id()->eapi()->supported()->tools_options()->unpack_stupid_gitweb_hack() ? "yes" : "")
.with_setenv("PALUDIS_DOMAN_LANG_FILENAMES",
params.package_id()->eapi()->supported()->tools_options()->doman_lang_filenames() ? "yes" : "")
.with_setenv("PALUDIS_DOSYM_NO_MKDIR",
diff --git a/paludis/repositories/e/ebuild/utils/unpack b/paludis/repositories/e/ebuild/utils/unpack
index 7f60310..4ac933d 100755
--- a/paludis/repositories/e/ebuild/utils/unpack
+++ b/paludis/repositories/e/ebuild/utils/unpack
@@ -52,18 +52,30 @@ unpack_one()
esac
fi
+ local gitwebtgz gitwebtbz2
+ if [[ -n ${PALUDIS_UNPACK_STUPID_GITWEB_HACK} ]]; then
+ gitwebtgz=';sf=tgz'
+ gitwebtbz2=';sf=tbz2'
+ elif [[ ${x} == *xyzzy ]]; then
+ gitwebtgz=plugh
+ gitwebtbz2=plugh
+ else
+ gitwebtgz=xyzzy
+ gitwebtbz2=xyzzy
+ fi
+
case "${x}" in
*.tar)
echo tar xf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" 1>&2
tar xf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" || die "Couldn't unpack ${1}"
;;
- *.tar.gz|*.tgz|*.tar.Z)
+ *.tar.gz|*.tgz|*.tar.Z|*${gitwebtgz})
echo tar zxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" 1>&2
tar zxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" || die "Couldn't unpack ${1}"
;;
- *.tar.bz2|*.tbz2|*.tbz)
+ *.tar.bz2|*.tbz2|*.tbz|*${gitwebtbz2})
echo tar jxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" ${UNPACKONLY} 1>&2
tar jxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" ${UNPACKONLY} || die "Couldn't unpack ${1}"
;;