aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-03-24 22:54:44 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-03-24 22:54:44 +0000
commitb1b396587f22b96bd32f3aa0ede7a6cda4470179 (patch)
tree96cd4b83725a11958b81f2fbb8224a6055ee641d
parentd818cd29755e19cdb5ba22477e09fdaae9707300 (diff)
downloadpaludis-b1b396587f22b96bd32f3aa0ede7a6cda4470179.tar.gz
paludis-b1b396587f22b96bd32f3aa0ede7a6cda4470179.tar.xz
Add strip phase (currently does nothing). Add SKIP_FUNCTIONS support.
-rw-r--r--ebuild/Makefile.am1
-rw-r--r--ebuild/builtin_fetch.bash12
-rw-r--r--ebuild/builtin_init.bash12
-rw-r--r--ebuild/builtin_merge.bash12
-rw-r--r--ebuild/builtin_strip.bash39
-rw-r--r--ebuild/builtin_tidyup.bash12
-rwxr-xr-xebuild/ebuild.bash6
-rw-r--r--ebuild/pkg_postinst.bash12
-rw-r--r--ebuild/pkg_preinst.bash12
-rw-r--r--ebuild/pkg_setup.bash12
-rw-r--r--ebuild/src_compile.bash13
-rw-r--r--ebuild/src_install.bash13
-rw-r--r--ebuild/src_test.bash2
-rw-r--r--ebuild/src_unpack.bash13
-rw-r--r--paludis/portage_repository.cc2
15 files changed, 140 insertions, 33 deletions
diff --git a/ebuild/Makefile.am b/ebuild/Makefile.am
index 19efbba..b03ae2b 100644
--- a/ebuild/Makefile.am
+++ b/ebuild/Makefile.am
@@ -27,6 +27,7 @@ libexecprog_SCRIPTS = \
builtin_fetch.bash \
builtin_merge.bash \
builtin_tidyup.bash \
+ builtin_strip.bash \
src_install.bash \
src_test.bash \
src_unpack.bash \
diff --git a/ebuild/builtin_fetch.bash b/ebuild/builtin_fetch.bash
index 6812393..971c477 100644
--- a/ebuild/builtin_fetch.bash
+++ b/ebuild/builtin_fetch.bash
@@ -59,9 +59,15 @@ builtin_fetch()
ebuild_f_fetch()
{
- ebuild_section "Starting builtin_fetch"
- builtin_fetch
- ebuild_section "Done builtin_fetch"
+ if hasq "fetch" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_fetch (RESTRICT)"
+ elif hasq "fetch" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_fetch (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_fetch"
+ builtin_fetch
+ ebuild_section "Done builtin_fetch"
+ fi
}
diff --git a/ebuild/builtin_init.bash b/ebuild/builtin_init.bash
index b6a9c86..fc4aa04 100644
--- a/ebuild/builtin_init.bash
+++ b/ebuild/builtin_init.bash
@@ -50,8 +50,14 @@ builtin_init()
ebuild_f_init()
{
- ebuild_section "Starting builtin_init"
- builtin_init
- ebuild_section "Done builtin_init"
+ if hasq "init" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_init (RESTRICT)"
+ elif hasq "init" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_init (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_init"
+ builtin_init
+ ebuild_section "Done builtin_init"
+ fi
}
diff --git a/ebuild/builtin_merge.bash b/ebuild/builtin_merge.bash
index 2f75238..9f11235 100644
--- a/ebuild/builtin_merge.bash
+++ b/ebuild/builtin_merge.bash
@@ -71,8 +71,14 @@ builtin_merge()
ebuild_f_merge()
{
- ebuild_section "Starting builtin_merge"
- builtin_merge
- ebuild_section "Done builtin_merge"
+ if hasq "merge" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_merge (RESTRICT)"
+ elif hasq "merge" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_merge (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_merge"
+ builtin_merge
+ ebuild_section "Done builtin_merge"
+ fi
}
diff --git a/ebuild/builtin_strip.bash b/ebuild/builtin_strip.bash
new file mode 100644
index 0000000..92e84c4
--- /dev/null
+++ b/ebuild/builtin_strip.bash
@@ -0,0 +1,39 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaranm@gentoo.org>
+#
+# 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
+
+builtin_strip()
+{
+ :
+}
+
+ebuild_f_strip()
+{
+ if hasq "strip" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_strip (RESTRICT)"
+ elif hasq "strip" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_strip (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_strip"
+ builtin_strip
+ ebuild_section "Done builtin_strip"
+ fi
+}
+
+
+
diff --git a/ebuild/builtin_tidyup.bash b/ebuild/builtin_tidyup.bash
index 19b465d..98ddee7 100644
--- a/ebuild/builtin_tidyup.bash
+++ b/ebuild/builtin_tidyup.bash
@@ -26,9 +26,15 @@ builtin_tidyup()
ebuild_f_tidyup()
{
- ebuild_section "Starting builtin_tidyup"
- builtin_tidyup
- ebuild_section "Done builtin_tidyup"
+ if hasq "tidyup" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_tidyup (RESTRICT)"
+ elif hasq "tidyup" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_tidyup (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_tidyup"
+ builtin_tidyup
+ ebuild_section "Done builtin_tidyup"
+ fi
}
diff --git a/ebuild/ebuild.bash b/ebuild/ebuild.bash
index 04d3663..b0befa0 100755
--- a/ebuild/ebuild.bash
+++ b/ebuild/ebuild.bash
@@ -30,7 +30,7 @@ shopt -s expand_aliases
EBUILD_KILL_PID=$$
alias die='diefunc "$FUNCNAME" "$LINENO"'
alias assert='_pipestatus="${PIPESTATUS[*]}"; [[ -z "${_pipestatus//[ 0]/}" ]] || diefunc "$FUNCNAME" "$LINENO" "$_pipestatus"'
-trap 'echo "exiting with error." ; exit 250' 15
+trap 'echo "die trap: exiting with error." ; exit 250' 15
diefunc()
{
@@ -91,6 +91,8 @@ ebuild_load_ebuild()
if [[ "${CATEGORY}" == "virtual" ]] ; then
if [[ -f "${1}" ]] ; then
source ${1} || die "Error sourcing ebuild '${1}'"
+ elif [[ -e "${1}" ]] ; then
+ die "'${1}' exists but is not a regular file"
fi
else
[[ -f "${1}" ]] || die "Ebuild '${1}' is not a file"
@@ -116,7 +118,7 @@ ebuild_main()
ebuild_f_depend || die "${action} failed"
;;
- init|fetch|merge|tidyup)
+ init|fetch|merge|tidyup|strip)
ebuild_load_module builtin_${action}
ebuild_load_ebuild "${ebuild}"
ebuild_f_${action} || die "${action} failed"
diff --git a/ebuild/pkg_postinst.bash b/ebuild/pkg_postinst.bash
index b996286..ccc7d4e 100644
--- a/ebuild/pkg_postinst.bash
+++ b/ebuild/pkg_postinst.bash
@@ -28,8 +28,14 @@ pkg_postinst()
ebuild_f_postinst()
{
- ebuild_section "Starting pkg_postinst"
- pkg_postinst
- ebuild_section "Done pkg_postinst"
+ if hasq "postinst" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_postinst (RESTRICT)"
+ elif hasq "postinst" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_postinst (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_postinst"
+ pkg_postinst
+ ebuild_section "Done pkg_postinst"
+ fi
}
diff --git a/ebuild/pkg_preinst.bash b/ebuild/pkg_preinst.bash
index 4bdefcc..8864464 100644
--- a/ebuild/pkg_preinst.bash
+++ b/ebuild/pkg_preinst.bash
@@ -28,8 +28,14 @@ pkg_preinst()
ebuild_f_preinst()
{
- ebuild_section "Starting pkg_preinst"
- pkg_preinst
- ebuild_section "Done pkg_preinst"
+ if hasq "preinst" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_preinst (RESTRICT)"
+ elif hasq "preinst" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_preinst (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_preinst"
+ pkg_preinst
+ ebuild_section "Done pkg_preinst"
+ fi
}
diff --git a/ebuild/pkg_setup.bash b/ebuild/pkg_setup.bash
index 2707164..3cf1e71 100644
--- a/ebuild/pkg_setup.bash
+++ b/ebuild/pkg_setup.bash
@@ -28,8 +28,14 @@ pkg_setup()
ebuild_f_setup()
{
- ebuild_section "Starting pkg_setup"
- pkg_setup
- ebuild_section "Done pkg_setup"
+ if hasq "setup" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_setup (RESTRICT)"
+ elif hasq "setup" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_setup (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_setup"
+ pkg_setup
+ ebuild_section "Done pkg_setup"
+ fi
}
diff --git a/ebuild/src_compile.bash b/ebuild/src_compile.bash
index 6ddce3b..996df4e 100644
--- a/ebuild/src_compile.bash
+++ b/ebuild/src_compile.bash
@@ -31,10 +31,17 @@ src_compile()
ebuild_f_compile()
{
- ebuild_section "Starting src_compile"
mkdir -p ${S}
cd ${S} || die "cd to \${S} (\"${S}\") failed"
- src_compile
- ebuild_section "Done src_compile"
+
+ if hasq "compile" ${RESTRICT} ; then
+ ebuild_section "Skipping src_compile (RESTRICT)"
+ elif hasq "compile" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_compile (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting src_compile"
+ src_compile
+ ebuild_section "Done src_compile"
+ fi
}
diff --git a/ebuild/src_install.bash b/ebuild/src_install.bash
index 5322da4..73ecba5 100644
--- a/ebuild/src_install.bash
+++ b/ebuild/src_install.bash
@@ -28,9 +28,16 @@ src_install()
ebuild_f_install()
{
- ebuild_section "Starting src_install"
cd ${S} || die "cd to \${S} (\"${S}\") failed"
- src_install
- ebuild_section "Done src_install"
+
+ if hasq "install" ${RESTRICT} ; then
+ ebuild_section "Skipping src_install (RESTRICT)"
+ elif hasq "install" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_install (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting src_install"
+ src_install
+ ebuild_section "Done src_install"
+ fi
}
diff --git a/ebuild/src_test.bash b/ebuild/src_test.bash
index 02d612c..469ba2a 100644
--- a/ebuild/src_test.bash
+++ b/ebuild/src_test.bash
@@ -34,6 +34,8 @@ ebuild_f_test()
{
if hasq "test" ${RESTRICT} ; then
ebuild_section "Skipping src_test (RESTRICT)"
+ elif hasq "test" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_test (SKIP_FUNCTIONS)"
else
ebuild_section "Starting src_test"
src_test
diff --git a/ebuild/src_unpack.bash b/ebuild/src_unpack.bash
index 1e06e9d..40f07d9 100644
--- a/ebuild/src_unpack.bash
+++ b/ebuild/src_unpack.bash
@@ -28,9 +28,16 @@ src_unpack()
ebuild_f_unpack()
{
- ebuild_section "Starting src_unpack"
cd ${WORKDIR} || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
- src_unpack
- ebuild_section "Done src_unpack"
+
+ if hasq "unpack" ${RESTRICT} ; then
+ ebuild_section "Skipping src_unpack (RESTRICT)"
+ elif hasq "unpack" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_unpack (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting src_unpack"
+ src_unpack
+ ebuild_section "Done src_unpack"
+ fi
}
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 69dbb50..3667110 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -930,7 +930,7 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
std::string actions;
if (metadata->get(vmk_virtual).empty())
- actions = "init fetch setup unpack compile test install preinst merge postinst tidyup";
+ actions = "init fetch setup unpack compile test install strip preinst merge postinst tidyup";
else
actions = "merge";