aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-03-16 00:37:27 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-03-16 00:37:27 +0000
commita3680a82747e8e5ef06ac27bb64859c09862219d (patch)
tree3b0718065201179964f5c4e1f84ec48eafeaddaf
parentf9f3ea46eb555645d310866837efa1ef66d8fb17 (diff)
downloadpaludis-a3680a82747e8e5ef06ac27bb64859c09862219d.tar.gz
paludis-a3680a82747e8e5ef06ac27bb64859c09862219d.tar.xz
More install work
-rw-r--r--ebuild/Makefile.am1
-rw-r--r--ebuild/builtin_merge.bash32
-rw-r--r--ebuild/builtin_tidyup.bash34
-rwxr-xr-xebuild/ebuild.bash10
-rw-r--r--ebuild/portage_stubs.bash3
-rw-r--r--ebuild/utils/dolib7
-rw-r--r--ebuild/utils/fperms2
-rw-r--r--paludis/portage_repository.cc9
8 files changed, 84 insertions, 14 deletions
diff --git a/ebuild/Makefile.am b/ebuild/Makefile.am
index 1dd7bbe..19efbba 100644
--- a/ebuild/Makefile.am
+++ b/ebuild/Makefile.am
@@ -26,6 +26,7 @@ libexecprog_SCRIPTS = \
src_compile.bash \
builtin_fetch.bash \
builtin_merge.bash \
+ builtin_tidyup.bash \
src_install.bash \
src_test.bash \
src_unpack.bash \
diff --git a/ebuild/builtin_merge.bash b/ebuild/builtin_merge.bash
index a1d219a..50e34ce 100644
--- a/ebuild/builtin_merge.bash
+++ b/ebuild/builtin_merge.bash
@@ -20,7 +20,37 @@
builtin_merge()
{
install -d "${ROOT}/" || die "couldn't make \${ROOT} (\"${ROOT}\")"
- cp -vdfpR "${D}/"* "${ROOT}/" || die "builtin_merge failed"
+ if [[ -d "${D}" ]] ; then
+ cp -vdfpR "${D}/"* "${ROOT}/" || die "builtin_merge failed"
+ fi
+
+ local dbdir="${ROOT}"/var/db/pkg/"${CATEGORY}/${PF}"
+ install -d "${dbdir}" || die "couldn't make pkg db directory (\"${dbdir}\")"
+
+ local v
+ for v in CATEGORY CBUILD CFLAGS CHOST CXXFLAGS DEPEND DESCRIPTION EAPI \
+ FEATURES HOMEPAGE INHERITED IUSE KEYWORDS LICENSE PDEPEND PF \
+ PROVIDE RDEPEND SLOT SRC_URI USE ; do
+ echo "${!v}" > "${dbdir}"/${v} || die "pkg db write ${v} failed"
+ done
+
+ [[ -f "${EBUILD}" ]] && cp "${EBUILD}" ${dbdir}/
+ env | bzip2 > ${dbdir}/environment.bz2
+
+ touch ${dbdir}/CONTENTS || die "pkg db write CONTENTS failed"
+ local f ff
+ find "${D}/" | \
+ while read f ; do
+ ff=${f#${D}}
+ ff=${ff//+(\/)/\/}
+ if [[ -d "${f}" ]] ; then
+ echo "dir ${ff}" >> ${dbdir}/CONTENTS
+ elif [[ -l "${f}" ]] ; then
+ echo "sym ${ff} -> $(readlink ${f} ) $(stat -c '%Y' ${f} )" >> ${dbdir}/CONTENTS
+ else
+ echo "obj ${ff} $(md5sum ${f} | cut -d ' ' -f1 ) $(stat -c '%Y' ${f} )" >> ${dbdir}/CONTENTS
+ fi
+ done
}
ebuild_f_merge()
diff --git a/ebuild/builtin_tidyup.bash b/ebuild/builtin_tidyup.bash
new file mode 100644
index 0000000..19b465d
--- /dev/null
+++ b/ebuild/builtin_tidyup.bash
@@ -0,0 +1,34 @@
+#!/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_tidyup()
+{
+ if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" ]] ; then
+ rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove work"
+ fi
+}
+
+ebuild_f_tidyup()
+{
+ ebuild_section "Starting builtin_tidyup"
+ builtin_tidyup
+ ebuild_section "Done builtin_tidyup"
+}
+
+
diff --git a/ebuild/ebuild.bash b/ebuild/ebuild.bash
index 559db40..4e8542d 100755
--- a/ebuild/ebuild.bash
+++ b/ebuild/ebuild.bash
@@ -70,9 +70,15 @@ ebuild_load_module eclass_functions
ebuild_load_ebuild()
{
- [[ -f "${1}" ]] || die "Ebuild '${1}' is not a file"
export EBUILD="${1}"
- source ${1} || die "Error sourcing ebuild '${1}'"
+ if [[ "${CATEGORY}" == "virtual" ]] ; then
+ if [[ -f "${1}" ]] ; then
+ source ${1} || die "Error sourcing ebuild '${1}'"
+ fi
+ else
+ [[ -f "${1}" ]] || die "Ebuild '${1}' is not a file"
+ source ${1} || die "Error sourcing ebuild '${1}'"
+ fi
[[ ${RDEPEND-unset} == "unset" ]] && RDEPEND="${DEPEND}"
}
diff --git a/ebuild/portage_stubs.bash b/ebuild/portage_stubs.bash
index ea5e229..674a9df 100644
--- a/ebuild/portage_stubs.bash
+++ b/ebuild/portage_stubs.bash
@@ -23,7 +23,8 @@
has_version()
{
- die "has_version not implemented"
+# die "has_version not implemented"
+ false
}
portageq()
diff --git a/ebuild/utils/dolib b/ebuild/utils/dolib
index c35b202..4a1b06d 100644
--- a/ebuild/utils/dolib
+++ b/ebuild/utils/dolib
@@ -26,13 +26,6 @@ if [[ ! -d ${D} ]]; then
exit 247
fi
-if [[ ! -d ${PALUDIS_EBUILD_MODULES_DIR} ]]; then
- echo "${0}: \${PALUDIS_EBUILD_MODULES_DIR} not valid; aborting" >&2
- exit 1
-fi
-
-source "${PALUDIS_EBUILD_MODULES_DIR}/multilib_functions.bash"
-
libdir="${D}${DESTTREE}/$(ebuild_get_libdir)"
if [[ ${#} -lt 1 ]]; then
diff --git a/ebuild/utils/fperms b/ebuild/utils/fperms
index 6623dcb..04c5db7 100644
--- a/ebuild/utils/fperms
+++ b/ebuild/utils/fperms
@@ -21,4 +21,4 @@
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA
-chmod "${@/#\//${D}\/}"
+chmod "${@/#\//${D}/}"
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index cc8c601..dbef676 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -925,14 +925,19 @@ 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";
+ else
+ actions = "merge";
+
std::string cmd(make_env_command(
getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
"/ebuild.bash '" +
stringify(_imp->location) + "/" +
stringify(q.get<qpn_category>()) + "/" +
stringify(q.get<qpn_package>()) + "/" +
- stringify(q.get<qpn_package>()) + "-" + stringify(v) + ".ebuild' " +
- "init fetch setup unpack compile test install preinst merge postinst tidyup")
+ stringify(q.get<qpn_package>()) + "-" + stringify(v) + ".ebuild' " + actions)
("P", stringify(q.get<qpn_package>()) + "-" + stringify(v.remove_revision()))
("PV", stringify(v.remove_revision()))
("PR", v.revision_only())