aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-31 13:08:24 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-31 13:08:24 +0000
commitc7278e7a8f8cf25b0ef1113cc1a6a9536debebd8 (patch)
treeba467c439f20b654f2e2ca29c34b6586b7405f81
parent4d990a5c7db918393d4807e5d81c0d50e19084aa (diff)
downloadpaludis-c7278e7a8f8cf25b0ef1113cc1a6a9536debebd8.tar.gz
paludis-c7278e7a8f8cf25b0ef1113cc1a6a9536debebd8.tar.xz
Recognise .tbz for unpack. Implement unpack --if-compressed for exheres. Fixes: ticket:487. Fixes: ticket:497.
-rw-r--r--paludis/repositories/e/eapi-fwd.hh3
-rw-r--r--paludis/repositories/e/eapi.cc5
-rw-r--r--paludis/repositories/e/eapi.sr20
-rw-r--r--paludis/repositories/e/eapis/0.conf2
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf2
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf1
-rw-r--r--paludis/repositories/e/ebuild.cc2
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/src_unpack.bash2
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/unpack45
9 files changed, 56 insertions, 26 deletions
diff --git a/paludis/repositories/e/eapi-fwd.hh b/paludis/repositories/e/eapi-fwd.hh
index 0ca85cd..7b1a9ae 100644
--- a/paludis/repositories/e/eapi-fwd.hh
+++ b/paludis/repositories/e/eapi-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -34,6 +34,7 @@ namespace paludis
class EAPIEbuildOptions;
class EAPILabels;
class EAPIPipeCommands;
+ class EAPIToolsOptions;
}
}
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index f92b912..5cea2f5 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -215,6 +215,11 @@ namespace paludis
.dependency_labels(make_shared_ptr(new EAPILabels(k.get("dependency_labels"))))
+ .tools_options(make_shared_ptr(new EAPIToolsOptions(
+ EAPIToolsOptions::create()
+ .unpack_unrecognised_is_fatal(destringify<bool>(
+ k.get("unpack_unrecognised_is_fatal"))))))
+
))));
tokenise_whitespace(k.get("restrict_fetch"),
diff --git a/paludis/repositories/e/eapi.sr b/paludis/repositories/e/eapi.sr
index d76534b..e3a4c26 100644
--- a/paludis/repositories/e/eapi.sr
+++ b/paludis/repositories/e/eapi.sr
@@ -108,6 +108,25 @@ make_class_EAPIEbuildEnvironmentVariables()
END
}
+make_class_EAPIToolsOptions()
+{
+ visible
+ allow_named_args cc
+
+ key unpack_unrecognised_is_fatal bool
+
+ doxygen_comment << "END"
+ /**
+ * Information about a supported EAPI's tool options.
+ *
+ * \see EAPIData
+ * \see EAPI
+ * \ingroup grpeapi
+ * \nosubgrouping
+ */
+END
+}
+
make_class_EAPIEbuildOptions()
{
visible
@@ -188,6 +207,7 @@ make_class_SupportedEAPI()
key uri_labels "tr1::shared_ptr<const EAPILabels>"
key dependency_labels "tr1::shared_ptr<const EAPILabels>"
key pipe_commands "tr1::shared_ptr<const EAPIPipeCommands>"
+ key tools_options "tr1::shared_ptr<const EAPIToolsOptions>"
doxygen_comment << "END"
/**
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index c59882c..b289533 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -168,3 +168,5 @@ restrict_primaryuri = primaryuri
pipe_commands_rewrite_virtuals = true
pipe_commands_no_slot_or_repo = true
+unpack_unrecognised_is_fatal = false
+
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 1bf0a04..d3b2fd2 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -193,3 +193,5 @@ restrict_primaryuri =
pipe_commands_rewrite_virtuals = false
pipe_commands_no_slot_or_repo = false
+unpack_unrecognised_is_fatal = true
+
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index f0c4c6a..9ea3592 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -185,3 +185,4 @@ restrict_primaryuri =
pipe_commands_rewrite_virtuals = true
pipe_commands_no_slot_or_repo = false
+unpack_unrecognised_is_fatal = false
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 758c3b7..86987a8 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -176,6 +176,8 @@ EbuildCommand::operator() ()
params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_variables)
.with_setenv("PALUDIS_BINARY_DISTDIR_VARIABLE",
params.package_id->eapi()->supported->ebuild_environment_variables->env_distdir)
+ .with_setenv("PALUDIS_UNPACK_UNRECOGNISED_IS_FATAL",
+ params.package_id->eapi()->supported->tools_options->unpack_unrecognised_is_fatal ? "yes" : "")
.with_setenv("PALUDIS_PIPE_COMMANDS_SUPPORTED", "yes")
)
.with_setenv("SLOT", "")
diff --git a/paludis/repositories/e/ebuild/exheres-0/src_unpack.bash b/paludis/repositories/e/ebuild/exheres-0/src_unpack.bash
index e10a40b..34ef371 100644
--- a/paludis/repositories/e/ebuild/exheres-0/src_unpack.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/src_unpack.bash
@@ -22,7 +22,7 @@
default_src_unpack()
{
- [[ -n "${A}" ]] && unpack ${A}
+ [[ -n "${A}" ]] && unpack --if-compressed ${A}
}
src_unpack()
diff --git a/paludis/repositories/e/ebuild/utils/unpack b/paludis/repositories/e/ebuild/utils/unpack
index c31300f..deff16f 100755
--- a/paludis/repositories/e/ebuild/utils/unpack
+++ b/paludis/repositories/e/ebuild/utils/unpack
@@ -40,7 +40,7 @@ unpack_one()
if [[ -n "${UNPACKONLY}" ]] ; then
case "${x}" in
- *.tar.bz2|*.tbz2)
+ *.tar.bz2|*.tbz2|*.tbz)
;;
*)
@@ -60,7 +60,7 @@ unpack_one()
tar zxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" || die "Couldn't unpack ${1}"
;;
- *.tar.bz2|*.tbz2)
+ *.tar.bz2|*.tbz2|*.tbz)
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}"
;;
@@ -107,35 +107,32 @@ unpack_one()
;;
*)
- echo "Skipping unpack for ${1}"
+ if [[ -n "${PALUDIS_UNPACK_UNRECOGNISED_IS_FATAL}" ]] ; then
+ die "Don't know how to unpack ${x}"
+ else
+ echo "Skipping unpack for ${1}"
+ fi
;;
esac
-
}
export UNPACKFROMDIR="${DISTDIR}"
export UNPACKTODIR="${PWD}"
-
-if [[ "${1}" == "--binary" ]] ; then
- export UNPACKFROMDIR="${PKGDIR}"
- export UNPACKTODIR="${IMAGE}"
- IS_BINARY=yes
- shift
-else
- IS_BINARY=
-fi
-
unset UNPACKONLY
-if [[ "${1}" == "--only" ]] ; then
- shift
- export UNPACKONLY="${1}"
- shift
-fi
-
TAR_OPTIONS=( )
-while [[ "${1}" == --tar-option=* ]] ; do
- TAR_OPTIONS[${#TAR_OPTIONS[@]}]="${1#*=}"
- shift
+
+while [[ "${1#--}" != "${1}" ]] ; do
+ if [[ "${1}" == "--only" ]] ; then
+ shift
+ export UNPACKONLY="${1}"
+ shift
+ elif [[ "${1}" == "--if-compressed" ]] ; then
+ export PALUDIS_UNPACK_UNRECOGNISED_IS_FATAL=
+ shift
+ elif [[ "${1}" == --tar-option=* ]] ; then
+ TAR_OPTIONS[${#TAR_OPTIONS[@]}]="${1#*=}"
+ shift
+ fi
done
[[ -z "$@" ]] && die "No arguments given to unpack"
@@ -149,5 +146,5 @@ for x in "$@" ; do
unpack_one "${x}"
done
-[[ -z ${IS_BINARY} ]] && find ${UNPACKTODIR} -mindepth 1 ! -type l -print0 | xargs -0 chmod a+rX,u+w,go-w
+find ${UNPACKTODIR} -mindepth 1 ! -type l -print0 | xargs -0 chmod a+rX,u+w,go-w