aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-30 21:01:29 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-30 21:01:29 +0100
commit81548942254909768f91bd305dd32784b446308f (patch)
treeac06fbb4eb0905e9803ac3a6871b01fa88896951
parent50ac3877bc8491ceebfc9c2f8c0761db4aec7cb0 (diff)
downloadpaludis-81548942254909768f91bd305dd32784b446308f.tar.gz
paludis-81548942254909768f91bd305dd32784b446308f.tar.xz
install -s is bad for exheres-0
-rw-r--r--.gitignore1
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc18
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh42
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash8
-rw-r--r--paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am15
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/exheres-0/install-wrapper43
6 files changed, 124 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index c6c754c..ec35057 100644
--- a/.gitignore
+++ b/.gitignore
@@ -236,6 +236,7 @@ paludis-*.*.*.tar.bz2
/paludis/repositories/e/ebuild/utils/exheres-0/dosed
/paludis/repositories/e/ebuild/utils/exheres-0/ecompress
/paludis/repositories/e/ebuild/utils/exheres-0/ecompressdir
+/paludis/repositories/e/ebuild/utils/exheres-0/install
/paludis/repositories/e/ebuild/utils/exheres-0/prepall
/paludis/repositories/e/ebuild/utils/exheres-0/prepalldocs
/paludis/repositories/e/ebuild/utils/exheres-0/prepallinfo
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index cd471fb..a841fbe 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -2513,6 +2513,24 @@ namespace test_cases
TEST_CHECK(id);
TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
}
+
+ {
+ TestMessageSuffix suffix("install", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/install-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("install s", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/install-s-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ }
}
} test_e_repository_install_exheres_0;
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 92f6e6f..80eac11 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -2622,6 +2622,48 @@ src_compile() {
default
}
END
+mkdir -p "packages/cat/install"
+cat <<'END' > packages/cat/install/install-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ touch -- -s
+}
+
+src_install() {
+ install -v -- -s dest
+ [[ -x dest ]] || die "install didn't work"
+}
+END
+mkdir -p "packages/cat/install-s"
+cat <<'END' > packages/cat/install-s/install-s-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ touch src
+}
+
+src_install() {
+ install -s src dest
+ [[ -x dest ]] && die "install didn't fail"
+}
+END
mkdir -p "packages/cat/doman-nonfatal"
cat <<'END' > packages/cat/doman-nonfatal/doman-nonfatal-0.ebuild || exit 1
DESCRIPTION="The Long Description"
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 0b4122f..346fec4 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -27,15 +27,21 @@ set +C
ebuild_sanitise_envvars()
{
+ local p
+
# Force a few more things into PATH, since some users have crazy setups.
# See ticket:374.
export PATH="/bin:/sbin:/usr/bin:/usr/sbin${PATH:+:${PATH}}"
+ # Automake likes to scatter our utilities over two directories.
if [[ -n "${PALUDIS_EBUILD_DIR_FALLBACK}" ]] ; then
export PATH="${PALUDIS_EBUILD_DIR_FALLBACK}/utils:${PATH}"
+ for p in ${PALUDIS_UTILITY_PATH_SUFFIXES} ; do
+ export PATH="${PALUDIS_EBUILD_DIR_FALLBACK}/utils/${p}:${PATH}"
+ done
fi
+
export PATH="${PALUDIS_EBUILD_DIR}/utils:${PATH}"
- local p
for p in ${PALUDIS_UTILITY_PATH_SUFFIXES} ; do
export PATH="${PALUDIS_EBUILD_DIR}/utils/${p}:${PATH}"
done
diff --git a/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am b/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am
index 59dce24..d8c0189 100644
--- a/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am
+++ b/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am
@@ -29,6 +29,16 @@ libexecprog_SCRIPTS = \
ecompressdir \
banned_in_eapi_exheres-0
+all-local :
+ ln -sf $(srcdir)/install-wrapper install
+
+install-data-local :
+ install -d $(DESTDIR)/$(libexecprogdir)
+ install $(srcdir)/install-wrapper $(DESTDIR)/$(libexecprogdir)/install
+
+uninstall-local :
+ rm -f $(DESTDIR)/$(libexecprogdir)/install
+
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
TESTS_ENVIRONMENT = env \
@@ -48,13 +58,14 @@ TESTS =
EXTRA_DIST = \
$(check_SCRIPTS) \
$(libexecprog_SCRIPTS) \
- $(TESTS)
+ $(TESTS) \
+ install-wrapper
bannedscripts = prepall prepallstrip prepstrip prepallman prepman prepallinfo \
prepinfo prepdocs prepalldocs dohard donewins dosed dohtml \
ecompress ecompressdir
-CLEANFILES = *~ $(bannedscripts) *.epicfail
+CLEANFILES = *~ $(bannedscripts) *.epicfail install
$(bannedscripts) : banned_in_eapi_exheres-0
cat $? > $@
diff --git a/paludis/repositories/e/ebuild/utils/exheres-0/install-wrapper b/paludis/repositories/e/ebuild/utils/exheres-0/install-wrapper
new file mode 100755
index 0000000..0500360
--- /dev/null
+++ b/paludis/repositories/e/ebuild/utils/exheres-0/install-wrapper
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2009 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
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+source "${PALUDIS_EBUILD_DIR}"/die_functions.bash
+
+for a in "$@" ; do
+ case $a in
+ -s|--strip)
+ paludis_die_or_error "caught a naughty build system doing 'install $a'"
+ exit 1
+ ;;
+
+ --)
+ break
+ ;;
+ esac
+done
+
+new_path=
+IFS=':'
+for p in ${PATH} ; do
+ [[ "$(canonicalise $(dirname ${0} ) )" == "$(canonicalise ${p} )" ]] && continue
+ new_path="${new_path:+${new_path}:}${p}"
+done
+
+export PATH="${new_path}"
+exec install "$@"