Exheredrey: Initial commit

Signed-off-by: Jacob Hrbek <kreyren@rixotstudio.cz>
This commit is contained in:
Jacob Hrbek 2020-10-21 17:15:50 +02:00
parent 3e45be57ee
commit 846effdb14
No known key found for this signature in database
GPG Key ID: FCBA0482B0AB9F10
68 changed files with 3443 additions and 1 deletions

@ -67,3 +67,5 @@ Ali Polatel <polatel@gmail.com>
Ingmar Vanhassel <ingmar@exherbo.org>
Contributor, zsh completion
Jacob Hrbek <kreyren@rixotstudio.cz>
Exheredrey

@ -243,7 +243,7 @@ set(ENVIRONMENT_GROUPS_DECLS "${ENVIRONMENT_GROUPS_DECLS} struct semicolon_goes_
# {{{ paludis distribution
set(PALUDIS_DEFAULT_DISTRIBUTION gentoo CACHE STRING
"paludis distribution (gentoo;exherbo)")
"paludis distribution (gentoo;exherbo;exheredrey)")
# }}}
# {{{ paludis clients

15
README

@ -11,3 +11,18 @@ documentation is available at:
http://paludis.exherbo.org/
.. vim: set spell spelllang=en tw=80 : ..
---
# Exheredludis
Standlone fork of the true mindfuck of a package mangler
### How to build
```sh
# Devuan-chimaera
apt-get install cmake libmagic-dev libpcre3-dev libgtest-dev
cmake .
make
```

@ -0,0 +1,9 @@
install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/e.conf"
"${CMAKE_CURRENT_SOURCE_DIR}/gems.conf"
"${CMAKE_CURRENT_SOURCE_DIR}/paludis.conf"
"${CMAKE_CURRENT_SOURCE_DIR}/repository_blacklist.conf"
DESTINATION
"${CMAKE_INSTALL_FULL_DATADIR}/paludis/distributions/exheredrey")

@ -0,0 +1,12 @@
default_buildroot = /var/tmp/paludis/build
default_distdir = /var/cache/paludis/distfiles
default_eapi_when_unknown = exheredrey-0
default_eapi_when_unspecified = exheredrey-0
default_layout = exheredrey
default_manifest_hashes =
default_names_cache = /var/cache/paludis/names
default_profile_eapi = exheredrey-0
default_profile_layout = exheredrey
default_thin_manifests = false
default_write_cache = /var/cache/paludis/metadata
news_directory = /var/lib/exheredrey/news

@ -0,0 +1,2 @@
default_buildroot = /var/tmp/paludis/build

@ -0,0 +1,15 @@
bashrc_filename = bashrc
info_messages_are_spam = false
keywords_filename_part = platforms
licenses_filename_part = licences
mandatory_userpriv = true
mirrors_filename_part = mirrors
output_filename_part = output
output_managers_directory = output_managers
package_mask_filename_part = package_mask
package_unmask_filename_part = package_unmask
repositories_directory = repositories
repository_defaults_filename_part = repository_defaults
suggestions_filename_part = suggestions
use_filename_part = options

@ -0,0 +1,2 @@
gentoo = Nice try, but it won't work.

@ -0,0 +1,9 @@
paludis_add_test(conditional_functions BASH EBUILD_MODULE_SUFFIXES exheredrey-0)
# DNM(Krey): Configure CMAKE
install(PROGRAMS
"${CMAKE_CURRENT_SOURCE_DIR}/build_functions.bash"
DESTINATION
"${CMAKE_INSTALL_FULL_LIBEXECDIR}/paludis/exheredrey-0")

@ -0,0 +1,217 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008, 2009, 2011 Ciaran McCreesh
# Copyright (c) 2008 Bo Ørsted Andresen
# Copyright (c) 2009 David Leverton
# Copyright (c) 2009 Mike Kelly
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
alias die_unless_nonfatal='paludis_die_unless_nonfatal_func "$FUNCNAME" "$LINENO"'
alias assert_unless_nonfatal='_pipestatus="${PIPESTATUS[*]}"; [[ -z "${_pipestatus//[ 0]/}" ]] || paludis_die_unless_nonfatal_func "$FUNCNAME" "$LINENO" "$_pipestatus"'
nonfatal()
{
PALUDIS_FAILURE_IS_FATAL= PALUDIS_FAILURE_IS_NONFATAL=yes "${@}"
}
is_nonfatal()
{
[[ -n ${PALUDIS_FAILURE_IS_NONFATAL} ]]
}
expatch()
{
if [[ "${!PALUDIS_EBUILD_PHASE_VAR}" != "prepare" ]] ; then
die "expatch called in phase ${!PALUDIS_EBUILD_PHASE_VAR}"
fi
local recognise= patchlevel= options=() cmd= appliedpatches=0 dirpatches=()
if [[ ${1} == "--recognised-suffixes" ]]; then
recognise=true
shift
fi
while [[ $# -gt 0 ]]; do
if [[ ${1} == -p*([[:digit:]]) ]]; then
patchlevel="${1}"
elif [[ ${1} == -+([^[:space:]]) ]]; then
options+=("${1}")
elif [[ -d ${1} ]]; then
dirpatches=("${1}"/*)
[[ -f ${dirpatches[0]} ]] || die "expatch called with empty directory $1"
expatch --recognised-suffixes ${patchlevel} "${options[@]}" "${1}"/* || return 247
((appliedpatches++))
else
case "${1}" in
*.bz2)
cmd="bzip2 -dc"
;;
*.gz|*.Z|*.z)
cmd="gzip -dc"
;;
*.zip|*.ZIP|*.jar)
cmd="unzip -p"
;;
*.diff|*.patch)
cmd="cat"
;;
*)
if [[ -n ${recognise} ]]; then
shift
continue
else
cmd="cat"
fi
;;
esac
echo "${cmd} -- '${1}' | patch -s -f ${patchlevel:--p1} ${options[@]}" 1>&2
${cmd} -- "${1}" | patch -s -f ${patchlevel:--p1} "${options[@]}"
paludis_assert_unless_nonfatal "applying '${1}' failed" || return 247
((appliedpatches++))
fi
shift
done
# Die if no patches were applied and no directories were supplied. Since
# directories get handled recursively by separate instances of expatch we cannot
# reliably count applied patches when directories were supplied.
[[ ${appliedpatches} -gt 0 || -n ${recognise} ]] || paludis_die_unless_nonfatal "No patches applied." || return 247
}
econf()
{
if [[ "${!PALUDIS_EBUILD_PHASE_VAR}" != "configure" ]] ; then
die "econf called in phase ${!PALUDIS_EBUILD_PHASE_VAR}"
fi
[[ -z "${ECONF_SOURCE}" ]] && ECONF_SOURCE=.
if [[ -x "${ECONF_SOURCE}/configure" ]] ; then
if [[ -d /usr/share/gnuconfig ]] ; then
local f
find "${WORKBASE}" -type f -name config.guess -or -name config.sub | while read f; do
echo "econf: updating ${f} with /usr/share/gnuconfig/${f##*/}"
cp -f "/usr/share/gnuconfig/${f##*/}" "${f}"
done
fi
# If the ebuild passed in --prefix, use that to set --libdir. KDE at least needs this.
ECONF_PREFIX=/usr
local i hates= econf_args=()
for i in "$@"; do
case "${i}" in
--prefix=*|--exec-prefix=*)
ECONF_PREFIX=${i#--*prefix=} ;;
--hates=*)
hates+=" ${i#--hates=} "; continue ;;
esac
econf_args+=( "${i}" )
done
if [[ ${FILESYSTEM_LAYOUT} == cross ]] ; then
local bindir=bin
fi
local j default_args=()
for i in \
--prefix=/usr \
--host=${CHOST} \
${CBUILD:+--build=${CBUILD}} \
${CTARGET:+--target=${CTARGET}} \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--datadir=/usr/share \
--docdir=/usr/share/doc/${PNVR} \
--sysconfdir=/etc \
--localstatedir=/var/lib \
--disable-dependency-tracking \
--disable-silent-rules \
--enable-fast-install \
--libdir=${ECONF_PREFIX}/${LIBDIR:-lib} \
--bindir=${ECONF_PREFIX}/${bindir:-bin} \
--sbindir=${ECONF_PREFIX}/${bindir:-sbin}; do
j=${i%%=*}
has ${j#--} ${hates} || default_args+=( "${i}" )
done
echo ${ECONF_WRAPPER} "${ECONF_SOURCE}"/configure \
"${default_args[@]}" "${econf_args[@]}" 1>&2
${ECONF_WRAPPER} "${ECONF_SOURCE}"/configure \
"${default_args[@]}" "${econf_args[@]}" || paludis_die_unless_nonfatal "econf failed" || return 247
else
paludis_die_unless_nonfatal "No configure script for econf" || return 247
fi
}
einstall()
{
die "Function 'einstall' banned in this EAPI"
}
emagicdocs()
{
local done_docs old_set f d p doc e
done_docs=
old_set=$(shopt | grep 'nocaseglob[[:space:]]*on')
shopt -s nocaseglob
for d in '' "${DEFAULT_SRC_INSTALL_EXTRA_SUBDIRS[@]}" ; do
if [[ -n ${d} ]]; then
[[ -d ${d} ]] || die "${d} is not a dir"
pushd "${d}" > /dev/null || die "Failed to enter ${d}"
local docdesttree="${DOCDESTTREE}"
docinto "${d}"
fi
for f in README Change{,s,Log} AUTHORS NEWS TODO ABOUT THANKS {KNOWN_,}BUGS SUBMITTING \
HACKING FAQ CREDITS PKG-INFO HISTORY PACKAGING MAINTAINER{,S} CONTRIBUT{E,ING,OR,ORS} RELEASE \
ANNOUNCE PORTING NOTES PROBLEMS NOTICE "${DEFAULT_SRC_INSTALL_EXTRA_DOCS[@]}"; do
for p in "${DEFAULT_SRC_INSTALL_EXTRA_PREFIXES[@]}" '' ; do
for doc in "${p}"*([[:digit:]])"${f}"{,+([._-])*} ; do
if [[ -s "${doc}" && ! -d "${doc}" ]] ; then
for e in "${DEFAULT_SRC_INSTALL_EXCLUDE[@]}" ; do
[[ ${doc} == ${e} ]] && continue 2
done
done_docs="${done_docs} ${d%/}${d:+/}${doc}"
dodoc "${doc}"
fi
done
done
done
if [[ -n ${d} ]]; then
docinto "${docdesttree}"
popd > /dev/null || die "Failed to leave ${d}"
fi
done
if [[ -n "${done_docs}" ]] ; then
echo "Installed docs ${done_docs# }"
else
echo "Didn't find any docs to install"
fi
[[ -n ${old_set} ]] || shopt -u nocaseglob
}
edo()
{
echo "$@" 1>&2
"$@" || paludis_die_unless_nonfatal "$* failed" || return 247
}

@ -0,0 +1,56 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# 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
# Public License, version 2, as published by the Free Software Foundation.
#
# 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_infovars()
{
local var
for var in ${PALUDIS_INFO_VARS} ; do
echo "${var}=${!var}"
done
}
exheres_internal_infovars()
{
if hasq "infovars" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping builtin_infovars (SKIP_FUNCTIONS)"
else
if [[ $(type -t pre_builtin_infovars ) == "function" ]] ; then
ebuild_section "Starting pre_builtin_infovars"
pre_builtin_infovars
ebuild_section "Done pre_builtin_infovars"
fi
ebuild_section "Starting builtin_infovars"
builtin_infovars
ebuild_section "Done builtin_infovars"
if [[ $(type -t post_builtin_infovars ) == "function" ]] ; then
ebuild_section "Starting post_builtin_infovars"
post_builtin_infovars
ebuild_section "Done post_builtin_infovars"
fi
fi
true
}
ebuild_f_infovars()
{
exheres_internal_infovars ""
}

@ -0,0 +1,105 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008, 2010 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, version 2, as published by the Free Software Foundation.
#
# 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_init()
{
local a
for a in ${PALUDIS_DIRECTORY_VARIABLES} ; do
a=${a#build:}
[[ -d "${!a}" ]] || die "\$${a} (\"${!a}\") not a directory"
done
for a in ${PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES} ; do
a=${a#build:}
[[ -e "${!a}" ]] && [[ ! -d "${!a}" ]] && \
die "\$${a} (\"${!a}\") exists but is not a directory"
done
for a in PALUDIS_TMPDIR ; do
if ! [[ -d "${!a}" ]] ; then
PALUDIS_EXTRA_DIE_MESSAGE="
!!! '${!a}' should be a directory, but does not exist. For,
!!! security reasons, Paludis will not try to create this directory
!!! automatically. Please create it by hand and give it appropriate
!!! permissions. Typically you should use:
!!! mkdir ${!a}
!!! chgrp ${PALUDIS_REDUCED_GID} ${!a}
!!! chmod g+rwx ${!a}
!!! although other values may be more appropriate for your system.
"
die "\$${a} (\"${!a}\") not a directory"
fi
done
if [[ -e "${PALUDIS_PACKAGE_BUILDDIR}" ]] ; then
if type -p chflags &>/dev/null; then
chflags -R 0 "${PALUDIS_PACKAGE_BUILDDIR}" || die "Couldn't remove flags from workdir"
fi
rm -fr "${PALUDIS_PACKAGE_BUILDDIR}" || die "Couldn't remove previous work"
fi
export WORKBASE="${PALUDIS_PACKAGE_BUILDDIR}/work"
mkdir -p "${WORKBASE}" || die "Couldn't create \$WORKBASE (\"${WORKBASE}\")"
declare -r WORKBASE="${WORKBASE}"
export TEMP="${PALUDIS_PACKAGE_BUILDDIR}/temp/"
mkdir -p "${TEMP}" || die "Couldn't create \$TEMP (\"${TEMP}\")"
declare -r TEMP="${TEMP}"
export HOME="${TEMP}"
export TMPDIR="${TEMP}"
touch ${TMPDIR}/build_start_time
export IMAGE="${PALUDIS_PACKAGE_BUILDDIR}/image/"
ebuild_cleanup_slashes IMAGE
mkdir -p "${IMAGE}" || die "Couldn't create \$IMAGE (\"${IMAGE}\")"
declare -r IMAGE="${IMAGE}"
export WORK="${WORKBASE}/${PNV}"
ebuild_load_em_up_dan
for a in ${PALUDIS_EBUILD_FUNCTIONS}; do
[[ $(type -t ${a}) == function ]] || continue
a="$(declare -f ${a})"
eval "${a/{/{ verify_not_called_cross_phase}"
done
for a in PALUDIS_NON_EMPTY_VARIABLES ${PALUDIS_NON_EMPTY_VARIABLES} ; do
a=${a#build:}
[[ -z "${!a}" ]] && die "\$${a} unset or empty"
declare -r ${a}="${!a}"
done
}
exheres_internal_init()
{
if 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
}
ebuild_f_init()
{
exheres_internal_init ""
}

@ -0,0 +1,87 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 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
# Public License, version 2, as published by the Free Software Foundation.
#
# 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_initmisc()
{
local a
for a in ${PALUDIS_DIRECTORY_VARIABLES} ; do
[[ "${a#build:}" != "${a}" ]] && continue
[[ -d "${!a}" ]] || die "\$${a} (\"${!a}\") not a directory"
done
for a in ${PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES} ; do
[[ "${a#build:}" != "${a}" ]] && continue
[[ -e "${!a}" ]] && [[ ! -d "${!a}" ]] && \
die "\$${a} (\"${!a}\") exists but is not a directory"
done
for a in PALUDIS_TMPDIR ; do
if ! [[ -d "${!a}" ]] ; then
PALUDIS_EXTRA_DIE_MESSAGE="
!!! '${!a}' should be a directory, but does not exist. For,
!!! security reasons, Paludis will not try to create this directory
!!! automatically. Please create it by hand and give it appropriate
!!! permissions. Typically you should use:
!!! mkdir ${!a}
!!! chgrp ${PALUDIS_REDUCED_GID} ${!a}
!!! chmod g+rwx ${!a}
!!! although other values may be more appropriate for your system.
"
die "\$${a} (\"${!a}\") not a directory"
fi
done
if [[ -e "${PALUDIS_PACKAGE_BUILDDIR}" ]] ; then
if type -p chflags &>/dev/null; then
chflags -R 0 "${PALUDIS_PACKAGE_BUILDDIR}" || die "Couldn't remove flags from workdir"
fi
rm -fr "${PALUDIS_PACKAGE_BUILDDIR}" || die "Couldn't remove previous work"
fi
export TEMP="${PALUDIS_PACKAGE_BUILDDIR}/temp/"
mkdir -p "${TEMP}" || die "Couldn't create \$TEMP (\"${TEMP}\")"
export HOME="${TEMP}"
export TMPDIR="${TEMP}"
ebuild_load_em_up_dan
declare -r TEMP="${TEMP}"
for a in PALUDIS_NON_EMPTY_VARIABLES ${PALUDIS_NON_EMPTY_VARIABLES} ; do
[[ "${a#build:}" != "${a}" ]] && continue
[[ -z "${!a}" ]] && die "\$${a} unset or empty"
declare -r ${a}="${!a}"
done
}
exheres_internal_initmisc()
{
if hasq "initmisc" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping builtin_initmisc (SKIP_FUNCTIONS)"
else
ebuild_section "Starting builtin_initmisc"
builtin_initmisc
ebuild_section "Done builtin_initmisc"
fi
}
ebuild_f_initmisc()
{
exheres_internal_initmisc ""
}

@ -0,0 +1,88 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 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
# Public License, version 2, as published by the Free Software Foundation.
#
# 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_initrm()
{
local a
for a in PALUDIS_NON_EMPTY_VARIABLES ${PALUDIS_NON_EMPTY_VARIABLES} ; do
[[ "${a#build:}" != "${a}" ]] && continue
[[ -z "${!a}" ]] && die "\$${a} unset or empty"
declare -r ${a}="${!a}"
done
for a in ${PALUDIS_DIRECTORY_VARIABLES} ; do
[[ "${a#build:}" != "${a}" ]] && continue
[[ -d "${!a}" ]] || die "\$${a} (\"${!a}\") not a directory"
done
for a in ${PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES} ; do
[[ "${a#build:}" != "${a}" ]] && continue
[[ -e "${!a}" ]] && [[ ! -d "${!a}" ]] && \
die "\$${a} (\"${!a}\") exists but is not a directory"
done
for a in PALUDIS_TMPDIR ; do
if ! [[ -d "${!a}" ]] ; then
PALUDIS_EXTRA_DIE_MESSAGE="
!!! '${!a}' should be a directory, but does not exist. For,
!!! security reasons, Paludis will not try to create this directory
!!! automatically. Please create it by hand and give it appropriate
!!! permissions. Typically you should use:
!!! mkdir ${!a}
!!! chgrp ${PALUDIS_REDUCED_GID} ${!a}
!!! chmod g+rwx ${!a}
!!! although other values may be more appropriate for your system.
"
die "\$${a} (\"${!a}\") not a directory"
fi
done
if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR:-${PF}}-uninstall" ]] ; then
if type -p chflags &>/dev/null; then
chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR:-${PF}}-uninstall" || die "Couldn't remove flags from workdir"
fi
rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR:-${PF}}-uninstall" || die "Couldn't remove previous work"
fi
export TEMP="${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR:-${PF}}-uninstall/temp/"
mkdir -p "${TEMP}" || die "Couldn't create \$TEMP (\"${TEMP}\")"
declare -r TEMP="${TEMP}"
export HOME="${TEMP}"
export TMPDIR="${TEMP}"
if [[ "${EBUILD}" != "-" ]] ; then
ebuild_load_ebuild "${EBUILD}"
fi
}
exheres_internal_initrm()
{
if hasq "initrm" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping builtin_initrm (SKIP_FUNCTIONS)"
else
ebuild_section "Starting builtin_initrm"
builtin_initrm
ebuild_section "Done builtin_initrm"
fi
}
ebuild_f_initrm()
{
exheres_internal_initrm ""
}

@ -0,0 +1,49 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 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
# Public License, version 2, as published by the Free Software Foundation.
#
# 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_killold()
{
local a
for a in PALUDIS_PACKAGE_BUILDDIR ; do
[[ -z "${!a}" ]] && die "\$${a} unset or empty"
done
if [[ -e "${PALUDIS_PACKAGE_BUILDDIR}" ]] ; then
if type -p chflags &>/dev/null; then
chflags -R 0 "${PALUDIS_PACKAGE_BUILDDIR}" || die "Couldn't remove flags from workdir"
fi
rm -fr "${PALUDIS_PACKAGE_BUILDDIR}" || die "Couldn't remove previous work"
fi
}
exheres_internal_killold()
{
if hasq "killold" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping builtin_killold (SKIP_FUNCTIONS)"
else
ebuild_section "Starting builtin_killold"
builtin_killold
ebuild_section "Done builtin_killold"
fi
}
ebuild_f_killold()
{
exheres_internal_killold ""
}

@ -0,0 +1,50 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 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
# Public License, version 2, as published by the Free Software Foundation.
#
# 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_killoldrm()
{
local a
for a in CATEGORY PALUDIS_TMPDIR ; do
[[ -z "${!a}" ]] && die "\$${a} unset or empty"
done
[[ -z "${PF}" && -z "${PNVR}" ]] && die "PF and PNVR both unset or empty"
if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR:-${PF}}-uninstall" ]] ; then
if type -p chflags &>/dev/null; then
chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR:-${PF}}-uninstall" || die "Couldn't remove flags from workdir"
fi
rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR:-${PF}}-uninstall" || die "Couldn't remove previous work"
fi
}
exheres_internal_killoldrm()
{
if hasq "killoldrm" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping builtin_killoldrm (SKIP_FUNCTIONS)"
else
ebuild_section "Starting builtin_killoldrm"
builtin_killoldrm
ebuild_section "Done builtin_killoldrm"
fi
}
ebuild_f_killoldrm()
{
exheres_internal_killoldrm ""
}

@ -0,0 +1,55 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# 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
# Public License, version 2, as published by the Free Software Foundation.
#
# 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_loadenv()
{
[[ -d "${PALUDIS_LOADSAVEENV_DIR}" ]] \
|| die "\$PALUDIS_LOADSAVEENV_DIR (\"${PALUDIS_LOADSAVEENV_DIR}\") not a directory"
[[ -f "${PALUDIS_LOADSAVEENV_DIR}/loadsaveenv" ]] || \
die "${PALUDIS_LOADSAVEENV_DIR}/loadsaveenv not a file"
ebuild_safe_source "${PALUDIS_LOADSAVEENV_DIR}/loadsaveenv"
}
exheres_internal_loadenv()
{
local old_sandbox_write="${SANDBOX_WRITE}"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${PALUDIS_LOADSAVEENV_DIR%/}/"
esandbox check >/dev/null 2>&1 && esandbox allow "${PALUDIS_LOADSAVEENV_DIR}"
fi
if hasq "loadenv" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping builtin_loadenv (SKIP_FUNCTIONS)"
else
ebuild_section "Starting builtin_loadenv"
builtin_loadenv
ebuild_section "Done builtin_loadenv"
fi
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${old_sandbox_write}"
esandbox check >/dev/null 2>&1 && esandbox disallow "${PALUDIS_LOADSAVEENV_DIR}"
fi
true
}
ebuild_f_loadenv()
{
exheres_internal_loadenv ""
}

@ -0,0 +1,46 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008, 2010 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
exheres_internal_metadata()
{
local key
for a in ${PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES} ; do
[[ ${!a+set} != set ]] || die "\$${a} must not be set"
done
for key in ${EBUILD_METADATA_VARIABLES} ; do
set -o noglob
local k=${!key}
k=${k//\\/\\\\}
k=${k//\"/\\\"}
k=${k//\$/\\\$}
echo "${key}=\""${k}"\"" 1>&${PALUDIS_METADATA_FD:-1}
set +o noglob
done
}
ebuild_f_metadata()
{
exheres_internal_metadata ""
}

@ -0,0 +1,54 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# 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
# Public License, version 2, as published by the Free Software Foundation.
#
# 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_saveenv()
{
[[ -d "${PALUDIS_LOADSAVEENV_DIR}" ]] || die "\$PALUDIS_LOADSAVEENV_DIR (\"${PALUDIS_LOADSAVEENV_DIR}\") not a directory"
[[ -f "${PALUDIS_LOADSAVEENV_DIR}/loadsaveenv" ]] && rm -f "${PALUDIS_LOADSAVEENV_DIR}/loadsaveenv"
( set ; print_exports ) > ${PALUDIS_LOADSAVEENV_DIR}/loadsaveenv
}
exheres_internal_saveenv()
{
local old_sandbox_write="${SANDBOX_WRITE}"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${PALUDIS_LOADSAVEENV_DIR%/}/"
esandbox check >/dev/null 2>&1 && esandbox allow "${PALUDIS_LOADSAVEENV_DIR}"
fi
if hasq "saveenv" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping builtin_saveenv (SKIP_FUNCTIONS)"
else
ebuild_section "Starting builtin_saveenv"
builtin_saveenv
ebuild_section "Done builtin_saveenv"
fi
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${old_sandbox_write}"
esandbox check >/dev/null 2>&1 && esandbox disallow "${PALUDIS_LOADSAVEENV_DIR}"
fi
true
}
ebuild_f_saveenv()
{
exheres_internal_saveenv ""
}

@ -0,0 +1,54 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 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
# Public License, version 2, as published by the Free Software Foundation.
#
# 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 [[ -z ${PALUDIS_PACKAGE_BUILDDIR} ]]; then
local a
for a in PALUDIS_TMPDIR CATEGORY PNVR ; do
[[ -z "${!a}" ]] && die "\$${a} unset or empty"
done
PALUDIS_PACKAGE_BUILDDIR=${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR}
fi
if [[ -e "${PALUDIS_PACKAGE_BUILDDIR}" ]] ; then
if type -p chflags &>/dev/null; then
echo chflags -R 0 "${PALUDIS_PACKAGE_BUILDDIR}" 1>&2
chflags -R 0 "${PALUDIS_PACKAGE_BUILDDIR}" || die "Couldn't remove flags from workdir"
fi
[[ -z ${PALUDIS_EBUILD_QUIET} ]] && echo rm -fr "${PALUDIS_PACKAGE_BUILDDIR}" 1>&2
rm -fr "${PALUDIS_PACKAGE_BUILDDIR}" || die "Couldn't remove work"
fi
}
exheres_internal_tidyup()
{
if 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
}
ebuild_f_tidyup()
{
exheres_internal_tidyup ""
}

@ -0,0 +1,46 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 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
# Public License, version 2, as published by the Free Software Foundation.
#
# 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_tidyuprm()
{
if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR:-${PF}}-uninstall" ]] ; then
if type -p chflags &>/dev/null; then
echo chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR:-${PF}}-uninstall" 1>&2
chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR:-${PF}}-uninstall" || die "Couldn't remove flags from workdir"
fi
echo rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR:-${PF}}-uninstall" 1>&2
rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}-${PNVR:-${PF}}-uninstall" || die "Couldn't remove work"
fi
}
exheres_internal_tidyuprm()
{
if hasq "tidyuprm" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping builtin_tidyuprm (SKIP_FUNCTIONS)"
else
ebuild_section "Starting builtin_tidyuprm"
builtin_tidyuprm
ebuild_section "Done builtin_tidyuprm"
fi
}
ebuild_f_tidyuprm()
{
exheres_internal_tidyuprm ""
}

@ -0,0 +1,28 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006 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, version 2, as published by the Free Software Foundation.
#
# 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
exheres_internal_variable()
{
echo "${!PALUDIS_VARIABLE}"
}
ebuild_f_variable()
{
exheres_internal_variable ""
}

@ -0,0 +1,42 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
use_with()
{
die "Function 'use_with' banned in this EAPI"
}
use_enable()
{
die "Function 'use_enable' banned in this EAPI"
}
option_with()
{
option "${1}" "--with-${2:-$(optionfmt ${1} )}${3+=${3}}" "--without-${2:-$(optionfmt ${1} )}"
}
option_enable()
{
option "${1}" "--enable-${2:-$(optionfmt ${1} )}${3+=${3}}" "--disable-${2:-$(optionfmt ${1} )}"
}

@ -0,0 +1,53 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 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
# Public License version 2, as published by the Free Software Foundation.
#
# 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
# the real optionq is a pipe command
optionq()
{
hasq "$1" $OPTIONS
}
option_with_TEST()
{
export OPTIONS="foo blah:moo" MYOPTIONS="foo bar baz blah:moo"
test_equality "$(option_with foo )" "--with-foo"
test_equality "$(option_with foo bar )" "--with-bar"
test_equality "$(option_with foo bar baz )" "--with-bar=baz"
test_equality "$(option_with blah:moo )" "--with-moo"
export OPTIONS="oink"
test_equality "$(option_with foo )" "--without-foo"
test_equality "$(option_with foo bar )" "--without-bar"
test_equality "$(option_with foo bar baz )" "--without-bar"
}
option_enable_TEST()
{
export OPTIONS="foo blah:moo" MYOPTIONS="foo bar baz blah:moo"
test_equality "$(option_enable foo )" "--enable-foo"
test_equality "$(option_enable foo bar )" "--enable-bar"
test_equality "$(option_enable foo bar baz )" "--enable-bar=baz"
test_equality "$(option_enable blah:moo )" "--enable-moo"
export OPTIONS="oink"
test_equality "$(option_enable foo )" "--disable-foo"
test_equality "$(option_enable foo bar )" "--disable-bar"
test_equality "$(option_enable foo bar baz )" "--disable-bar"
}

@ -0,0 +1,92 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2008, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
ever()
{
local r="1;"
case "${1}" in
split)
[[ "${#@}" != 1 ]] && [[ "${#@}" != 2 ]] && die "$FUNCNAME $1 takes at most one extra argument"
r=$(paludis_pipe_command EVER "$EAPI" SPLIT "${2:-${PV}}" )
;;
split_all)
[[ "${#@}" != 1 ]] && [[ "${#@}" != 2 ]] && die "$FUNCNAME $1 takes at most one extra argument"
r=$(paludis_pipe_command EVER "$EAPI" SPLIT_ALL "${2:-${PV}}" )
;;
major)
[[ "${#@}" != 1 ]] && [[ "${#@}" != 2 ]] && die "$FUNCNAME $1 takes at most one extra argument"
r=$(paludis_pipe_command EVER "$EAPI" RANGE 1 "${2:-${PV}}" )
;;
range)
[[ "${#@}" != 2 ]] && [[ "${#@}" != 3 ]] && die "$FUNCNAME $1 takes one or two extra arguments"
r=$(paludis_pipe_command EVER "$EAPI" RANGE ${2} "${3:-${PV}}" )
;;
remainder)
[[ "${#@}" != 1 ]] && [[ "${#@}" != 2 ]] && die "$FUNCNAME $1 takes at most one extra argument"
r=$(paludis_pipe_command EVER "$EAPI" RANGE 2- "${2:-${PV}}" )
;;
replace)
[[ "${#@}" != 3 ]] && [[ "${#@}" != 4 ]] && die "$FUNCNAME $1 takes two or three extra arguments"
[[ -z "${2}" ]] && die "$FUNCNAME $1 takes a non-empty position as first argument"
r=$(paludis_pipe_command EVER "$EAPI" REPLACE "${2}" "${3}" "${4:-${PV}}" )
;;
replace_all)
[[ "${#@}" != 2 ]] && [[ "${#@}" != 3 ]] && die "$FUNCNAME $1 takes one or two extra arguments"
r=$(paludis_pipe_command EVER "$EAPI" REPLACE_ALL "${2}" "${3:-${PV}}" )
;;
delete)
[[ "${#@}" != 2 ]] && [[ "${#@}" != 3 ]] && die "$FUNCNAME $1 takes one or two extra arguments"
[[ -z "${2}" ]] && die "$FUNCNAME $1 takes a non-empty position as first argument"
r=$(paludis_pipe_command EVER "$EAPI" REPLACE "${2}" "" "${3:-${PV}}" )
;;
delete_all)
[[ "${#@}" != 1 ]] && [[ "${#@}" != 2 ]] && die "$FUNCNAME $1 takes at most one extra argument"
r=$(paludis_pipe_command EVER "$EAPI" REPLACE_ALL "" "${2:-${PV}}" )
;;
at_least)
[[ "${#@}" != 2 ]] && [[ "${#@}" != 3 ]] && die "$FUNCNAME $1 takes one or two extra arguments"
r=$(paludis_pipe_command EVER "$EAPI" AT_LEAST "${2}" "${3:-${PVR}}" )
;;
is_scm)
[[ "${#@}" != 1 ]] && [[ "${#@}" != 2 ]] && die "$FUNCNAME $1 takes at most one extra argument"
r=$(paludis_pipe_command EVER "$EAPI" IS_SCM "${2:-${PV}}" )
;;
*)
die "ever subcommand ${1} unrecognised"
;;
esac
[[ -z "${r#*;}" ]] || echo "${r#*;}"
return ${r%%;*}
}

@ -0,0 +1,307 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
# Copyright (c) 2009 Bo Ørsted Andresen
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
export_exlib_phases()
{
[[ -z "${CURRENT_EXLIB}" ]] && die "export_exlib_phases called but CURRENT_EXLIB undefined"
local e
for e in "$@" ; do
if [[ "${e}" == builtin_* ]] || ! has "${e}" ${PALUDIS_EBUILD_FUNCTIONS}; then
die "$e should not be in export_exlib_phases for ${CURRENT_EXLIB}"
fi
eval "${e}() { type -t ${CURRENT_EXLIB}_${e} >/dev/null || \
die \"exported phase function ${CURRENT_EXLIB}_${e} does not exist\" ; ${CURRENT_EXLIB}_${e} \"\$@\" ; }"
PALUDIS_CHECK_EXPORTED_PHASES+=" ${CURRENT_EXLIB}_${e}"
done
}
exparam()
{
die "exparam is banned outside exlibs"
}
exparam_var_name()
{
local var=EXPARAMVAR_${1//-/__dash__}
var=${var//./__dot__}
var=${var//+/__plus__}
echo ${var}
}
exparam_print()
{
case "${1}" in
-a) eval "${2}=( \"\${${3}}\" )" ;;
-v) eval "${2}=\"\${${3}}\"" ;;
*) eval "echo \"\${${1}}\"" ;;
esac
}
exparam_internal()
{
local i e=${1} a to_var v a_v=$(exparam_var_name ${1})__ALLDECLS__ b_v=$(exparam_var_name ${1})__BOOLEANS__
shift
if [[ ${1} == -b ]]; then
[[ ${#} -eq 2 ]] || die "exparam ${1} requires exactly two arguments"
shift
has "${1}" ${!b_v} || die "${e}.exlib has no ${1} boolean"
v=$(exparam_var_name ${e})_${1}
if ${!v}; then
return 0
else
return 1
fi
fi
if [[ ${1} == -v ]]; then
[[ ${#} -eq 3 ]] || die "exparam ${1} requires exactly three arguments"
a=${1}
to_var=${2}
shift 2
else
[[ ${#} -eq 1 ]] || die "exparam requires exactly one argument"
fi
v=$(exparam_var_name ${e})_${1%\[*}
if [[ ${1} == *\[*\] ]]; then
has "${1%\[*}[]" ${!a_v} || die "${e}.exlib has no ${1%\[*} array"
i=${1#*\[}
i=${i%\]}
case "${i}" in
"#") exparam_print ${to_var:+-v "${to_var}"} "#${v}[*]" ;;
"*"|"@") exparam_print ${to_var:+-a "${to_var}"} "${v}[${i}]" ;;
+([[:digit:]])) exparam_print ${to_var:+-v "${to_var}"} "${v}[${i}]" ;;
*) die "Invalid index in exparam ${1}" ;;
esac
else
has "${1}" ${!a_v%\[\]} || die "${e}.exlib has no ${1} parameter"
exparam_print ${to_var:+-v "${to_var}"} "${v}"
fi
}
myexparam()
{
[[ -z "${CURRENT_EXLIB}" ]] && die "myexparam called but CURRENT_EXLIB undefined"
local bool=false
if [[ ${1} == -b ]]; then
bool=true
shift
fi
local v=${1%%=*} a_v="$(exparam_var_name ${CURRENT_EXLIB})__ALLDECLS__"
[[ ${1} == *=\[ && ${#} -gt 1 ]] && v+="[]"
printf -v "${a_v}" "%s %s" "${!a_v}" "${v}"
if ${bool}; then
local b_v="$(exparam_var_name ${CURRENT_EXLIB})__BOOLEANS__"
printf -v "${b_v}" "%s %s" "${!b_v}" "${v}"
fi
v=$(exparam_var_name ${CURRENT_EXLIB})_${v%\[\]}
if ! declare -p ${v} &>/dev/null && [[ ${1} == *=* ]]; then
if [[ ${1} == *=\[ && ${#} -gt 1 ]]; then
shift
local i a=()
while [[ ${#} -gt 1 ]]; do
a+=( "${1}" )
shift
done
[[ ${1} == \] ]] || die "Array encountered with no closing ]"
eval "${v}=( \"\${a[@]}\" )"
else
printf -v "${v}" "%s" "${1#*=}"
fi
fi
if ${bool} && ! has "${!v}" true false; then
die "exparam ${1%%=*} for ${CURRENT_EXLIB}.exlib must be 'true' or 'false'"
fi
}
require()
{
ebuild_notice "debug" "Command 'require ${@}', using EXLIBSDIRS '${EXLIBSDIRS}'"
local exlibs e ee p a=() location v a_v v_qa
# parse exlib parameters
while [[ -n $@ ]]; do
if [[ ${1} == +('[') ]]; then
[[ -z ${e} ]] && die "\"${1}\" encountered with no preceding exlib"
p=${1}
shift
while [[ -n ${1} && ${1} != ${p//\[/\]} ]]; do
v="${1%%=*}"
if [[ ${1#*=} == ${p} ]]; then
v+="[]"
a=()
shift
while [[ -n ${1} && ${1} != ${p//\[/\]} ]]; do
a+=( "${1}" )
shift
done
[[ ${1} == ${p//\[/\]} ]] || die "\"${p}\" encountered with no closing \"${p//[/]}\" for array ${v}"
eval "$(exparam_var_name ${e})_${v%\[\]}=( \"\${a[@]}\" )"
else
printf -v "$(exparam_var_name ${e})_${1%%=*}" "%s" "${1#*=}"
fi
a_v="$(exparam_var_name ${e})__ALL__"
printf -v "${a_v}" "%s %s" "${!a_v}" "${v}"
shift
done
[[ ${1} == ${p//\[/\]} ]] || die "\"${p}\" encountered with no closing \"${p//[/]}\""
else
e=${1}
exlibs+=" ${e}"
fi
shift
done
# source exlibs
for e in ${exlibs}; do
location=
for ee in ${EXLIBSDIRS} ; do
[[ -f "${ee}/${e}.exlib" ]] && location="${ee}/${e}.exlib"
done
local old_CURRENT_EXLIB="${CURRENT_EXLIB}"
export CURRENT_EXLIB="${e}"
local old_PALUDIS_CHECK_EXPORTED_PHASES="${PALUDIS_CHECK_EXPORTED_PHASES}"
export PALUDIS_CHECK_EXPORTED_PHASES=
alias exparam="exparam_internal ${CURRENT_EXLIB}"
for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
local c_v="current_${v}" u_v="unset_${v}"
local ${c_v}="${!v}"
local ${u_v}="${!v-unset}"
unset ${v}
done
for v_qa in ${PALUDIS_ECLASS_MUST_NOT_SET_VARIABLES} ; do
local v=${v_qa#qa:}
local c_v="current_${v}" u_v="unset_${v}"
export -n ${c_v}="${!v}"
export -n ${u_v}="${!v-unset}"
done
[[ -z "${location}" ]] && die "Error finding exlib ${e} in ${EXLIBSDIRS}"
source "${location}" || die "Error sourcing exlib ${e}"
hasq "${CURRENT_EXLIB}" ${INHERITED} || export INHERITED="${INHERITED} ${CURRENT_EXLIB}"
local f e_f
for f in ${PALUDIS_EBUILD_FUNCTIONS} ; do
[[ ${f} == builtin_* ]] && continue
[[ $(type -t ${CURRENT_EXLIB}_${f}) == function ]] || continue
e_f=$(declare -f ${CURRENT_EXLIB}_${f})
eval "${e_f/{/{ verify_not_called_cross_phase ${f}}"
done
for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
local e_v="E_${v}"
export -n ${e_v}="${!e_v} ${!v}"
done
for v in ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
local e_v="E_${v}"
if [[ -z "${!v}" ]] ; then
export -n ${e_v}="${!e_v}"
elif has "${v}" ${PALUDIS_BRACKET_MERGED_VARIABLES_ANNOTATABLE} ; then
export -n ${e_v}="${!e_v} ( ${!v} ) [[ ${PALUDIS_BRACKET_MERGED_VARIABLES_ANNOTATION} =
[ ${CURRENT_EXLIB}.exlib ] ]]"
else
export -n ${e_v}="${!e_v} ( ${!v} )"
fi
done
for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
local c_v="current_${v}" u_v="unset_${v}"
[[ "unset" == ${!u_v} ]] && unset ${v} || export ${v}="${!c_v}"
done
for v_qa in ${PALUDIS_ECLASS_MUST_NOT_SET_VARIABLES} ; do
local v=${v_qa#qa:}
local c_v="current_${v}" u_v="unset_${v}"
if [[ ${!c_v} != ${!v} || ${!u_v} != ${!v-unset} ]]; then
if [[ ${v} == ${v_qa} ]] ; then
die "Variable '${v}' illegally set by ${location}"
else
ebuild_notice "qa" "Variable '${v}' should not be set by ${location}"
export -n ${c_v}="${!v}"
export -n ${u_v}="${!v-unset}"
fi
fi
done
# die on required exlib parameters that haven't been supplied
local c_v v
a_v=$(exparam_var_name ${CURRENT_EXLIB})__ALLDECLS__
for v in ${!a_v}; do
c_v=$(exparam_var_name ${CURRENT_EXLIB})_${v%\[\]}
if [[ $(eval "declare -p ${c_v}") == declare\ -a\ ${c_v}=* ]]; then
[[ ${v} == *\[\] ]] || die "${CURRENT_EXLIB}.exlib requires a scalar ${v} parameter but got an array"
elif [[ -n ${!c_v+set} ]]; then
[[ ${v} != *\[\] ]] || die "${CURRENT_EXLIB}.exlib requires an array ${v} but got a scalar"
else
die "${CURRENT_EXLIB}.exlib requires a ${v} parameter"
fi
done
# die on supplied exlib parameters which haven't been declared
v=$(exparam_var_name ${CURRENT_EXLIB})__ALL__
for v in ${!v}; do
has ${v} ${!a_v} || die "${CURRENT_EXLIB}.exlib takes no ${v} parameter"
done
for v in ${PALUDIS_EBUILD_FUNCTIONS} ; do
c_v=${CURRENT_EXLIB}_${v}
if has ${c_v} ${PALUDIS_CHECK_EXPORTED_PHASES}; then
type -t ${c_v} >/dev/null || die "exported phase function ${v} does not exist"
else
type -t ${c_v} >/dev/null && die "phase function ${c_v} exists but was not exported"
fi
done
export PALUDIS_CHECK_EXPORTED_PHASES="${old_PALUDIS_CHECK_EXPORTED_PHASES}"
export CURRENT_EXLIB="${old_CURRENT_EXLIB}"
if [[ -n ${CURRENT_EXLIB} ]]; then
alias exparam="exparam_internal ${CURRENT_EXLIB}"
else
unalias exparam
fi
done
}
default()
{
[[ $(type -t "default_$(paludis_phase_to_function_name "${!PALUDIS_EBUILD_PHASE_VAR}")" ) == "function" ]] || \
die "default_$(paludis_phase_to_function_name "${!PALUDIS_EBUILD_PHASE_VAR}") is not a function"
default_$(paludis_phase_to_function_name "${!PALUDIS_EBUILD_PHASE_VAR}") "$@"
}
illegal_in_global_scope()
{
[[ "${!PALUDIS_EBUILD_PHASE_VAR}" == "metadata" ]] \
&& die "Exheres bug: ${FUNCNAME[1]} must not be called in global scope"
}
verify_not_called_cross_phase() {
if [[ ${1:-${FUNCNAME[1]}} != $(paludis_phase_to_function_name "${!PALUDIS_EBUILD_PHASE_VAR}") ]] ; then
local correct_phase=${1:-${FUNCNAME[1]}#src_}; correct_phase=${correct_phase#pkg_}; correct_phase=${correct_phase#builtin_}
die "Exheres bug: ${FUNCNAME[1]} must only be called in the ${corect_phase} phase, was called in ${!PALUDIS_EBUILD_PHASE_VAR}"
fi
}

@ -0,0 +1,114 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008, 2011 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
use()
{
die "Function 'use' banned in this EAPI"
}
usev()
{
die "Function 'usev' banned in this EAPI"
}
useq()
{
die "Function 'useq' banned in this EAPI"
}
optionfmt()
{
local opt="${1#!}"
echo ${opt#*([^:]):}
}
option()
{
[[ "${#@}" -gt 3 ]] && die "$0 takes at most three arguments"
optionq "${1}"
local r=$?
if [[ ${r} -eq 0 ]] ; then
[[ -n "${2}" ]] && echo "${2}"
else
[[ -n "${3}" ]] && echo "${3}"
fi
return ${r}
}
optionv()
{
option "${1}" "$(optionfmt "${1}")"
}
optionq()
{
[[ "${#@}" -ne 1 ]] && die "$0 should take exactly one arg"
if [[ "${1:0:1}" == "!" ]] ; then
local r=$(paludis_pipe_command OPTIONQ "$EAPI" "${1#!}" )
return $((! ${r%%;*}))
else
local r=$(paludis_pipe_command OPTIONQ "$EAPI" "$1" )
return ${r%%;*}
fi
}
has()
{
hasq "${@}"
}
hasv()
{
if hasq "${@}" ; then
echo "${1}"
return 0
else
return 1
fi
}
hasq()
{
local x= want="$1"
shift
for x in $@ ; do
[[ "${x}" == "${want}" ]] && return 0
done
return 1
}
expecting_tests()
{
local a r
case "${1}" in
--any|--recommended|--expensive) a="${1}"; shift ;;
esac
r=$(paludis_pipe_command EXPECTING_TESTS "$EAPI" "${a:---any}" )
[[ "${#@}" -gt 2 ]] && die "$0 takes at most three arguments"
if [[ ${r%%;*} -eq 0 ]] ; then
[[ -n "${1}" ]] && echo "${1}"
else
[[ -n "${2}" ]] && echo "${2}"
fi
return ${r%%;*}
}

@ -0,0 +1,79 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
has_version()
{
illegal_in_global_scope
local slash
if [[ "${#}" -eq 1 ]]; then
slash=--root
elif [[ "${#}" -eq 2 ]]; then
slash=${1}
shift
else
die "$0 should take one or two arguments"
fi
local r=$(paludis_pipe_command HAS_VERSION "$EAPI" "$slash" "$1" )
return ${r%%;*}
}
portageq()
{
die "Function 'portageq' banned in this EAPI"
}
best_version()
{
illegal_in_global_scope
local slash
if [[ "${#}" -eq 1 ]]; then
slash=--root
elif [[ "${#}" -eq 2 ]]; then
slash=${1}
shift
else
die "$0 should take one or two arguments"
fi
local r=$(paludis_pipe_command BEST_VERSION "$EAPI" "$slash" "$1" )
echo ${r#*;}
return ${r%%;*}
}
vdb_path()
{
die "Function 'vdb_path' banned in this EAPI"
}
debug-print()
{
die "Function 'debug-print' banned in this EAPI"
}
debug-print-function()
{
die "Function 'debug-print-function' banned in this EAPI"
}
debug-print-section()
{
die "Function 'debug-print-section' banned in this EAPI"
}

@ -0,0 +1,40 @@
#!/bin/sh
# shellcheck shell=sh # Written to comply with POXIS IEEE 1003.1-2017
die() { funcname="die"
: "Output function used to terminate the script
SYNOPSIS: ${FUNCNAME:-"$funcname"} [exitcode] (message)
To ensure cross-platform compatibility we are using a string for exitcode that is translated in apropriate integer per expected platform
- true ~ translates to ERRCODE 0 for nonfatal assertion
- false ~ translates to ERRCODE 1 for generic fatal assertion
The format strings can be customized using apropriate variable exports
Written to comply with POXIS IEEE 1003.1-2017
Linted using shellcheck 0.7.1 (21.10.2020-EU)
Created by Jacob Hrbek identified using a GPG identifier assigned to the electronic mail <kreyren@rixotstudio.cz> according to the keyserver <https://openpgp.org> in 21/10/2020-EU 16:11:03 CEST under the Zernit License <https://git.dotya.ml/RXT0112/Zernit/LICENSE.md>"
exitcode="$1"
message="$2"
case "$exitcode" in
true)
# FIXME-TRANSLATE
case "$LANG" in
en-*|*) ${PRINTF:-printf} "${DIE_FORMAT_STRING_TRUE:-SUCCESS: %s\\n}" "${message:-Script exitted succesfully}"
${EXIT:-exit} "${DIE_TRUE_EXIT_CODE:-0}"
esac ;;
false)
# FIXME-TRANSLATE
case "$LANG" in
en-*|*) ${PRINTF:-printf} "${DIE_FORMAT_STRING_FALSE:-FATAL: %s\\n}" "${message:-Script returned a fatal error}"
${EXIT:-exit} "${DIE_FALSE_EXIT_CODE:-1}"
esac ;;
*)
# FIXME-TRANSLATE
case "$LANG" in
en-*|*) ${PRINTF:-printf} "${DIE_FORMAT_STRING_BUG:-BUG: %s\\n}" "${message:-"Unsupported argument '$exitcode' has been parsed in function '${FUNCNAME:-"$funcname"}}'"}"
esac
esac
}

@ -0,0 +1,24 @@
#!/bin/sh
# shellcheck shell=sh # Written to comply with POXIS IEEE 1003.1-2017
edebug() { funcname="edebug"
: "Output function used to output debug messaged depending on value stored in 'PALUDIS_DEBUG' variable
SYNOPSIS: ${FUNCNAME:-"$funcname"} [level] [message]
Written to comply with POXIS IEEE 1003.1-2017
Linted using shellcheck 0.7.1 (21.10.2020-EU)
Created by Jacob Hrbek identified using a GPG identifier assigned to the electronic mail <kreyren@rixotstudio.cz> according to the keyserver <https://openpgp.org> in 21/10/2020-EU 16:11:03 CEST under the Zernit License <https://git.dotya.ml/RXT0112/Zernit/LICENSE.md>"
level="$1"
message="$2"
if [ -z "$PALUDIS_DEBUG" ]; then
return 0
elif [ -n "$PALUDIS_DEBUG" ]; then
# DNM-STUB(Krey): Needs to be brainstormed for implementation
${PRINTF:-printf} 'DEBUG: %s\n' "$message"
else
die integrity
fi
}

@ -0,0 +1,37 @@
#!/bin/sh
# shellcheck shell=sh # Written to comply with POXIS IEEE 1003.1-2017
eerror() { funcname="eerror"
: "Output function used to output error message designed to inform the end-user about non-fatal errors
SYNOPSIS: ${FUNCNAME:-"$funcname"} [message]
The format string can be customized using apropriate variable export
returns fatal error if [message] is not provided
Written to comply with POXIS IEEE 1003.1-2017
Linted using shellcheck 0.7.1 (21.10.2020-EU)
Created by Jacob Hrbek identified using a GPG identifier assigned to the electronic mail <kreyren@rixotstudio.cz> according to the keyserver <https://openpgp.org> in 21/10/2020-EU 16:11:03 CEST under the Zernit License <https://git.dotya.ml/RXT0112/Zernit/LICENSE.md>"
message="$1"
# Process the $message
if [ -n "$message" ]; then
# FIXME-TRANSLATE
case "$LANG" in
en-*|*) ${PRINTF:-printf} "${EERROR_FORMAT_STRING:-"ERROR: %s\\n"}" "$message"
esac
elif [ -z "$message" ]; then
# FIXME-TRANSLATE
case "$LANG" in
en-*|*) ${PRINTF:-printf} "${EERROR_FORMAT_STRING_SYNERR:-"SYNTAX-ERROR(${FUNCNAME:-$funcname}): %s\\n"}" "Expected message was not provided in function '${FUNCNAME:-"$funcname"}'"
esac
# Terminate the script
${EXIT:-exit} "${EERROR_EXIT_CODE_SYNERR:-111}"
else
die integrity
exit 255
fi
}

@ -0,0 +1,40 @@
#!/bin/sh
# shellcheck shell=sh # Written to comply with POXIS IEEE 1003.1-2017
efixme() { funcname="efixme"
: "Output function used to output annoying messages about unimplemented features
SYNOPSIS: ${FUNCNAME:-"$funcname"} [message]
The format string can be customized using apropriate variable export
returns fatal error if [message] is not provided
Written to comply with POXIS IEEE 1003.1-2017
Linted using shellcheck 0.7.1 (21.10.2020-EU)
Created by Jacob Hrbek identified using a GPG identifier assigned to the electronic mail <kreyren@rixotstudio.cz> according to the keyserver <https://openpgp.org> in 21/10/2020-EU 16:11:03 CEST under the Zernit License <https://git.dotya.ml/RXT0112/Zernit/LICENSE.md>"
# Allow silencing of the messages
[ -z "$EFIXME_DO_NOT_OUTPUT_MESSAGES" ] || return 0
message="$1"
# Process the $message
if [ -n "$message" ]; then
# FIXME-TRANSLATE
case "$LANG" in
en-*|*) ${PRINTF:-printf} "${EFIXME_FORMAT_STRING:-"FIXME: %s\\n"}" "$message"
esac
elif [ -z "$message" ]; then
# FIXME-TRANSLATE
case "$LANG" in
en-*|*) ${PRINTF:-printf} "${EFIXME_FORMAT_STRING_SYNERR:-"SYNTAX-FIXME(${FUNCNAME:-$funcname}): %s\\n"}" "Expected message was not provided in function '${FUNCNAME:-"$funcname"}'"
esac
# Terminate the script
${EXIT:-exit} "${EFIXME_EXIT_CODE_SYNERR:-111}"
else
die integrity
exit 255
fi
}

@ -0,0 +1,37 @@
#!/bin/sh
# shellcheck shell=sh # Written to comply with POXIS IEEE 1003.1-2017
einfo() { funcname="einfo"
: "Output function used to output info message for the end-user designed to inform about runtime
SYNOPSIS: ${FUNCNAME:-"$funcname"} [message]
The format string can be customized using apropriate variable export
returns fatal error if [message] is not provided
Written to comply with POXIS IEEE 1003.1-2017
Linted using shellcheck 0.7.1 (21.10.2020-EU)
Created by Jacob Hrbek identified using a GPG identifier assigned to the electronic mail <kreyren@rixotstudio.cz> according to the keyserver <https://openpgp.org> in 21/10/2020-EU 16:11:03 CEST under the Zernit License <https://git.dotya.ml/RXT0112/Zernit/LICENSE.md>"
message="$1"
# Process the $message
if [ -n "$message" ]; then
# FIXME-TRANSLATE
case "$LANG" in
en-*|*) ${PRINTF:-printf} "${EINFO_FORMAT_STRING:-"INFO: %s\\n"}" "$message"
esac
elif [ -z "$message" ]; then
# FIXME-TRANSLATE
case "$LANG" in
en-*|*) ${PRINTF:-printf} "${EINFO_FORMAT_STRING_SYNERR:-"SYNTAX-ERROR(${FUNCNAME:-$funcname}): %s\\n"}" "Expected message was not provided in function '${FUNCNAME:-"$funcname"}'"
esac
# Terminate the script
${EXIT:-exit} "${EINFO_EXIT_CODE_SYNERR:-111}"
else
die integrity
exit 255
fi
}

@ -0,0 +1,37 @@
#!/bin/sh
# shellcheck shell=sh # Written to comply with POXIS IEEE 1003.1-2017
ewarn() { funcname="ewarn"
: "Output function used to output error message designed to inform the end-user about non-fatal errors
SYNOPSIS: ${FUNCNAME:-"$funcname"} [message]
The format string can be customized using apropriate variable export
returns fatal error if [message] is not provided
Written to comply with POXIS IEEE 1003.1-2017
Linted using shellcheck 0.7.1 (21.10.2020-EU)
Created by Jacob Hrbek identified using a GPG identifier assigned to the electronic mail <kreyren@rixotstudio.cz> according to the keyserver <https://openpgp.org> in 21/10/2020-EU 16:11:03 CEST under the Zernit License <https://git.dotya.ml/RXT0112/Zernit/LICENSE.md>"
message="$1"
# Process the $message
if [ -n "$message" ]; then
# FIXME-TRANSLATE
case "$LANG" in
en-*|*) ${PRINTF:-printf} "${EWARN_FORMAT_STRING:-"WARN: %s\\n"}" "$message"
esac
elif [ -z "$message" ]; then
# FIXME-TRANSLATE
case "$LANG" in
en-*|*) ${PRINTF:-printf} "${EWARN_FORMAT_STRING_SYNERR:-"SYNTAX-ERROR(${FUNCNAME:-$funcname}): %s\\n"}" "Expected message was not provided in function '${FUNCNAME:-"$funcname"}'"
esac
# Terminate the script
${EXIT:-exit} "${EWARN_EXIT_CODE_SYNERR:-111}"
else
die integrity
exit 255
fi
}

@ -0,0 +1 @@
Directory used for output functions

@ -0,0 +1 @@
Directory used to define paludis phases that are used to process specific part of package downstream i.e. src_compile is used to compile the package

@ -0,0 +1,46 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# 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
# Public License, version 2, as published by the Free Software Foundation.
#
# 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
default_pkg_bad_options()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
eerror "The following option requirements are unmet for ${CATEGORY}/${PNVR}:"
local f
echo "${EX_UNMET_REQUIREMENTS}" | while IFS=$'\n' read f ; do
eerror " ${f}"
done
}
pkg_bad_options()
{
default "$@"
}
exheres_internal_bad_options()
{
if hasq "bad_options" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping pkg_bad_options (SKIP_FUNCTIONS)"
else
echo
pkg_bad_options
echo
fi
true
}

@ -0,0 +1,55 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_pkg_config()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
eerror "No configuration function is defined"
}
pkg_config()
{
default "$@"
}
exheres_internal_config()
{
local old_sandbox_write="${SANDBOX_WRITE}"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
esandbox check >/dev/null 2>&1 && esandbox allow "${ROOT}"
fi
if hasq "config" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping pkg_config (SKIP_FUNCTIONS)"
else
ebuild_section "Starting pkg_config"
pkg_config
ebuild_section "Done pkg_config"
fi
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${old_sandbox_write}"
esandbox check >/dev/null 2>&1 && esandbox allow "${ROOT}"
fi
true
}

@ -0,0 +1,41 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# 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
# Public License, version 2, as published by the Free Software Foundation.
#
# 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
default_pkg_info()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
:
}
pkg_info()
{
default "$@"
}
exheres_internal_info()
{
if hasq "info" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping pkg_info (SKIP_FUNCTIONS)"
else
ebuild_section "Starting pkg_info"
pkg_info
ebuild_section "Done pkg_info"
fi
true
}

@ -0,0 +1,65 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_pkg_nofetch()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
[[ -z "${ARCHIVES}" ]] && return
local f g=
for f in ${ARCHIVES} ; do
[[ -f "${FETCHEDDIR}/${ARCHIVES}" ]] && continue
if [[ -z "${g}" ]] ; then
echo "The following files could not be fetched automatically for ${PN}:"
g=no
fi
echo "* ${f}"
done
}
pkg_nofetch()
{
default "$@"
}
exheres_internal_nofetch()
{
local old_sandbox_write="${SANDBOX_WRITE}"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${FETCHEDDIR}"
esandbox check >/dev/null 2>&1 && esandbox allow "${FETCHEDDIR}"
fi
if hasq "nofetch" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping pkg_nofetch (SKIP_FUNCTIONS)"
else
ebuild_section "Starting pkg_nofetch"
pkg_nofetch
ebuild_section "Done pkg_nofetch"
fi
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${old_sandbox_write}"
esandbox check >/dev/null 2>&1 && esandbox disallow "${FETCHEDDIR}"
fi
true
}

@ -0,0 +1,55 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_pkg_postinst()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
:
}
pkg_postinst()
{
default "$@"
}
exheres_internal_postinst()
{
local old_sandbox_write="${SANDBOX_WRITE}"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
esandbox check >/dev/null 2>&1 && esandbox allow "${ROOT}"
fi
if 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
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${old_sandbox_write}"
esandbox check >/dev/null 2>&1 && esandbox allow "${ROOT}"
fi
true
}

@ -0,0 +1,55 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_pkg_postrm()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
:
}
pkg_postrm()
{
default "$@"
}
exheres_internal_postrm()
{
local old_sandbox_write="${SANDBOX_WRITE}"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
esandbox check >/dev/null 2>&1 && esandbox allow "${ROOT}"
fi
if hasq "postrm" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping pkg_postrm (SKIP_FUNCTIONS)"
else
ebuild_section "Starting pkg_postrm"
pkg_postrm
ebuild_section "Done pkg_postrm"
fi
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${old_sandbox_write}"
esandbox check >/dev/null 2>&1 && esandbox disallow "${ROOT}"
fi
true
}

@ -0,0 +1,55 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_pkg_preinst()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
:
}
pkg_preinst()
{
default "$@"
}
exheres_internal_preinst()
{
local old_sandbox_write="${SANDBOX_WRITE}"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
esandbox check >/dev/null 2>&1 && esandbox allow "${ROOT}"
fi
if 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
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${old_sandbox_write}"
esandbox check >/dev/null 2>&1 && esandbox disallow "${ROOT}"
fi
true
}

@ -0,0 +1,55 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_pkg_prerm()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
:
}
pkg_prerm()
{
default "$@"
}
exheres_internal_prerm()
{
local old_sandbox_write="${SANDBOX_WRITE}"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
esandbox check >/dev/null 2>&1 && esandbox allow "${ROOT}"
fi
if hasq "prerm" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping pkg_prerm (SKIP_FUNCTIONS)"
else
ebuild_section "Starting pkg_prerm"
pkg_prerm
ebuild_section "Done pkg_prerm"
fi
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${old_sandbox_write}"
esandbox check >/dev/null 2>&1 && esandbox disallow "${ROOT}"
fi
true
}

@ -0,0 +1,39 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2007, 2008, 2011 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, version 2, as published by the Free Software Foundation.
#
# 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
default_pkg_pretend()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
:
}
pkg_pretend()
{
default "$@"
}
exheres_internal_pretend()
{
if hasq "pretend" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping pkg_pretend (SKIP_FUNCTIONS)"
else
pkg_pretend
fi
true
}

@ -0,0 +1,55 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_pkg_setup()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
:
}
pkg_setup()
{
default "$@"
}
exheres_internal_setup()
{
local old_sandbox_write="${SANDBOX_WRITE}"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
esandbox check >/dev/null 2>&1 && esandbox allow "${ROOT}"
fi
if 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
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${old_sandbox_write}"
esandbox check >/dev/null 2>&1 && esandbox disallow "${ROOT}"
fi
true
}

@ -0,0 +1,50 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_src_compile()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
ebuild_verify_not_changed_from_global_scope DEFAULT_SRC_COMPILE_PARAMS
if [[ -f Makefile ]] || [[ -f makefile ]] || [[ -f GNUmakefile ]] ; then
emake "${DEFAULT_SRC_COMPILE_PARAMS[@]}"
fi
}
src_compile()
{
default "$@"
}
exheres_internal_compile()
{
cd "${WORK}" || die "cd to \${WORK} (\"${WORK}\") failed"
if 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
}

@ -0,0 +1,72 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_src_configure()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
ebuild_verify_not_changed_from_global_scope \
DEFAULT_SRC_CONFIGURE_PARAMS \
DEFAULT_SRC_CONFIGURE_OPTIONS \
DEFAULT_SRC_CONFIGURE_OPTION_ENABLES \
DEFAULT_SRC_CONFIGURE_OPTION_WITHS \
DEFAULT_SRC_CONFIGURE_TESTS
if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
econf \
"${DEFAULT_SRC_CONFIGURE_PARAMS[@]}" \
$(for s in "${DEFAULT_SRC_CONFIGURE_OPTIONS[@]}" ; do \
option ${s} ; \
done ) \
$(for s in "${DEFAULT_SRC_CONFIGURE_OPTION_ENABLES[@]}" ; do \
option_enable ${s} ; \
done ) \
$(for s in "${DEFAULT_SRC_CONFIGURE_OPTION_WITHS[@]}" ; do \
option_with ${s} ; \
done ) \
$(for s in "${DEFAULT_SRC_CONFIGURE_TESTS[@]}" ; do \
expecting_tests ${s} ; \
done )
fi
}
src_configure()
{
default "$@"
}
exheres_internal_configure()
{
if [[ -d "${WORK}" ]] ; then
cd "${WORK}" || die "cd to \${WORK} (\"${WORK}\") failed"
elif [[ -d "${WORKBASE}" ]] ; then
cd "${WORKBASE}" || die "cd to \${WORKBASE} (\"${WORKBASE}\") failed"
fi
if hasq "configure" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping src_configure (SKIP_FUNCTIONS)"
else
ebuild_section "Starting src_configure"
src_configure
ebuild_section "Done src_configure"
fi
}

@ -0,0 +1,59 @@
#!/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, version 2, as published by the Free Software Foundation.
#
# 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
default_src_fetch_extra()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
:
}
src_fetch_extra()
{
default "$@"
}
exheres_internal_fetch_extra()
{
local old_sandbox_write="${SANDBOX_WRITE}"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${FETCHEDDIR}"
if esandbox check >/dev/null 2>&1; then
esandbox allow "${FETCHEDDIR}"
esandbox disable_net
fi
fi
if hasq "fetch_extra" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping src_fetch_extra (SKIP_FUNCTIONS)"
else
ebuild_section "Starting src_fetch_extra"
src_fetch_extra
ebuild_section "Done src_fetch_extra"
fi
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${old_sandbox_write}"
if esandbox check >/dev/null 2>&1; then
esandbox disallow "${FETCHEDDIR}"
esandbox enable_net
fi
fi
true
}

@ -0,0 +1,57 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_src_install()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
ebuild_verify_not_changed_from_global_scope DEFAULT_SRC_INSTALL_PARAMS
if [[ -f Makefile ]] || [[ -f makefile ]] || [[ -f GNUmakefile ]] ; then
if make -j1 -n DESTDIR="${IMAGE}" "${DEFAULT_SRC_INSTALL_PARAMS[@]}" install ; then
echo "Found a makefile, using the install target"
emake -j1 DESTDIR="${IMAGE}" "${DEFAULT_SRC_INSTALL_PARAMS[@]}" install
else
die "default emake install located a makefile but no install target"
fi
else
echo "No makefile found, not using emake install"
fi
emagicdocs
}
src_install()
{
default "$@"
}
exheres_internal_install()
{
cd "${WORK}" || die "cd to \${WORK} (\"${WORK}\") failed"
if 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
}

@ -0,0 +1,49 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_src_prepare()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
ebuild_verify_not_changed_from_global_scope DEFAULT_SRC_PREPARE_PATCHES
if [[ -n "${DEFAULT_SRC_PREPARE_PATCHES[@]}" ]]; then
expatch "${DEFAULT_SRC_PREPARE_PATCHES[@]}"
fi
}
src_prepare()
{
default "$@"
}
exheres_internal_prepare()
{
cd "${WORK}" || die "cd to \${WORK} (\"${WORK}\") failed"
if hasq "prepare" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping src_prepare (SKIP_FUNCTIONS)"
else
ebuild_section "Starting src_prepare"
src_prepare
ebuild_section "Done src_prepare"
fi
}

@ -0,0 +1,69 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_src_test()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
ebuild_verify_not_changed_from_global_scope DEFAULT_SRC_TEST_PARAMS
if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]] ; then
echo "Makefile found, looking for potential test targets"
if make -j1 -n "${DEFAULT_SRC_TEST_PARAMS[@]}" check ; then
echo "Found check target"
emake "${DEFAULT_SRC_TEST_PARAMS[@]}" check
elif make -j1 -n "${DEFAULT_SRC_TEST_PARAMS[@]}" test ; then
echo "Found test target"
emake "${DEFAULT_SRC_TEST_PARAMS[@]}" test
else
echo "No check or test target, skipping tests"
fi
else
echo "No Makefile, skipping tests"
fi
}
src_test()
{
default "$@"
}
exheres_internal_test()
{
local save_PALUDIS_EXTRA_DIE_MESSAGE="${PALUDIS_EXTRA_DIE_MESSAGE}"
if [[ -d "${WORK}" ]] ; then
cd "${WORK}" || die "cd to \${WORK} (\"${WORK}\") failed"
elif [[ -d "${WORKBASE}" ]] ; then
cd "${WORKBASE}" || die "cd to \${WORKBASE} (\"${WORKBASE}\") failed"
fi
if hasq "test" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping src_test (SKIP_FUNCTIONS)"
else
ebuild_section "Starting src_test"
src_test
ebuild_section "Done src_test"
fi
export PALUDIS_EXTRA_DIE_MESSAGE="${save_PALUDIS_EXTRA_DIE_MESSAGE}"
true
}

@ -0,0 +1,54 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_src_test_expensive()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
:
}
src_test_expensive()
{
default "$@"
}
exheres_internal_test_expensive()
{
local save_PALUDIS_EXTRA_DIE_MESSAGE="${PALUDIS_EXTRA_DIE_MESSAGE}"
if [[ -d "${WORK}" ]] ; then
cd "${WORK}" || die "cd to \${WORK} (\"${WORK}\") failed"
elif [[ -d "${WORKBASE}" ]] ; then
cd "${WORKBASE}" || die "cd to \${WORKBASE} (\"${WORKBASE}\") failed"
fi
if hasq "test_expensive" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping src_test_expensive (SKIP_FUNCTIONS)"
else
ebuild_section "Starting src_test_expensive"
src_test_expensive
ebuild_section "Done src_test_expensive"
fi
export PALUDIS_EXTRA_DIE_MESSAGE="${save_PALUDIS_EXTRA_DIE_MESSAGE}"
true
}

@ -0,0 +1,45 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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, version 2, as published by the Free Software Foundation.
#
# 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
default_src_unpack()
{
verify_not_called_cross_phase ${FUNCNAME[0]#default_}
[[ -n "${ARCHIVES}" ]] && unpack --if-compressed ${ARCHIVES}
}
src_unpack()
{
default "$@"
}
exheres_internal_unpack()
{
cd "${WORKBASE}" || die "cd to \${WORKBASE} (\"${WORKBASE}\") failed"
if 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
}

@ -0,0 +1,58 @@
foreach(bannedscript
prepall
prepallstrip
prepstrip
prepallman
prepman
prepallinfo
prepinfo
prepdocs
prepalldocs
dohard
donewins
dosed
dohtml
ecompress
ecompressdir
fperms
fowners)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/banned_in_eapi_exheres-0"
"${CMAKE_CURRENT_BINARY_DIR}/${bannedscript}"
@ONLY)
endforeach()
install(PROGRAMS
"${CMAKE_CURRENT_BINARY_DIR}/dohard"
"${CMAKE_CURRENT_BINARY_DIR}/dohtml"
"${CMAKE_CURRENT_SOURCE_DIR}/dolib"
"${CMAKE_CURRENT_SOURCE_DIR}/dosbin"
"${CMAKE_CURRENT_BINARY_DIR}/dosed"
"${CMAKE_CURRENT_BINARY_DIR}/donewins"
"${CMAKE_CURRENT_SOURCE_DIR}/emake"
"${CMAKE_CURRENT_BINARY_DIR}/fperms"
"${CMAKE_CURRENT_BINARY_DIR}/fowners"
"${CMAKE_CURRENT_SOURCE_DIR}/herebin"
"${CMAKE_CURRENT_SOURCE_DIR}/hereconfd"
"${CMAKE_CURRENT_SOURCE_DIR}/hereenvd"
"${CMAKE_CURRENT_SOURCE_DIR}/hereinitd"
"${CMAKE_CURRENT_SOURCE_DIR}/hereins"
"${CMAKE_CURRENT_SOURCE_DIR}/heresbin"
"${CMAKE_CURRENT_SOURCE_DIR}/newsbin"
"${CMAKE_CURRENT_SOURCE_DIR}/nonfatal"
"${CMAKE_CURRENT_BINARY_DIR}/prepall"
"${CMAKE_CURRENT_BINARY_DIR}/prepallstrip"
"${CMAKE_CURRENT_BINARY_DIR}/prepstrip"
"${CMAKE_CURRENT_BINARY_DIR}/prepallman"
"${CMAKE_CURRENT_BINARY_DIR}/prepman"
"${CMAKE_CURRENT_BINARY_DIR}/prepallinfo"
"${CMAKE_CURRENT_BINARY_DIR}/prepinfo"
"${CMAKE_CURRENT_BINARY_DIR}/prepdocs"
"${CMAKE_CURRENT_BINARY_DIR}/prepalldocs"
"${CMAKE_CURRENT_BINARY_DIR}/ecompress"
"${CMAKE_CURRENT_BINARY_DIR}/ecompressdir"
"${CMAKE_CURRENT_SOURCE_DIR}/strip"
"${CMAKE_CURRENT_SOURCE_DIR}/banned_in_eapi_exheres-0"
DESTINATION
"${CMAKE_INSTALL_FULL_LIBEXECDIR}/paludis/utils/exheredrey-0")

@ -0,0 +1,33 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2007 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
die_because_banned_in_eapi_exheres-0() {
COLOUR_RED=$'\e[31;01m'
COLOUR_NORMAL=$'\e[0m'
echo "${COLOUR_RED}!!! Exheres bug: '$(basename ${0} )' banned in EAPI exheres-0${COLOUR_NORMAL}"
echo "$(basename ${0} ): making exheres PID ${EBUILD_KILL_PID} exit with error" 1>&2
kill -s SIGUSR1 "${EBUILD_KILL_PID}"
exit 123
}
# die if called directly, but not if sourced
return 2> /dev/null || die_because_banned_in_eapi_exheres-0

@ -0,0 +1,60 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006 Stephen Bennett
#
# Based in part upon dolib from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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
if [[ ! -d ${!PALUDIS_IMAGE_DIR_VAR} ]]; then
paludis_die_or_error "\${${PALUDIS_IMAGE_DIR_VAR}} not valid; aborting"
fi
if [[ ! -d ${PALUDIS_EBUILD_MODULES_DIR} ]]; then
paludis_die_or_error "\${PALUDIS_EBUILD_MODULES_DIR} not valid; aborting"
fi
libdir="${!PALUDIS_IMAGE_DIR_VAR}${DESTTREE}/${LIBDIR:-lib}"
if [[ ${#} -lt 1 ]]; then
paludis_die_or_error "at least one argument needed"
fi
if [[ ! -d ${libdir} ]]; then
install -d "${libdir}" || paludis_die_or_error "could not create ${libdir}"
fi
ret=0
for x in "$@"; do
if [[ -e ${x} ]]; then
if [[ ! -L ${x} ]]; then
install ${LIBOPTIONS} "${x}" "${libdir}" || ret=2
else
ln -s "$(readlink "${x}")" "${libdir}/$(basename "${x}")" || ret=2
fi
else
echo "${0}: ${x} does not exist"
ret=2
fi
done
[[ 0 != "${ret}" ]] && paludis_die_or_error "dolib returned error ${ret}"
exit ${ret}

@ -0,0 +1,53 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006 Stephen Bennett
#
# Based in part upon dosbin from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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
if [[ ${FILESYSTEM_LAYOUT} == cross ]]; then
source "${PALUDIS_EBUILD_DIR}"/utils/exheres-0/banned_in_eapi_exheres-0
die_because_banned_in_eapi_exheres-0
fi
if [[ ! -d ${!PALUDIS_IMAGE_DIR_VAR} ]]; then
paludis_die_or_error "\${${PALUDIS_IMAGE_DIR_VAR}} not valid; aborting"
fi
if [[ ${#} -lt 1 ]]; then
paludis_die_or_error "at least one argument needed"
fi
if [[ ! -d "${!PALUDIS_IMAGE_DIR_VAR}${DESTTREE}/sbin" ]]; then
install -d "${!PALUDIS_IMAGE_DIR_VAR}${DESTTREE}/sbin" || paludis_die_or_error "could not create ${!PALUDIS_IMAGE_DIR_VAR}${DESTTREE}/sbin"
fi
ret=0
for x in "$@"; do
if [[ -n ${PALUDIS_NO_CHOWN} ]]; then
install -m0755 "${x}" "${!PALUDIS_IMAGE_DIR_VAR}${DESTTREE}/sbin" || ret=2
else
install -m0755 -o root -g 0 "${x}" "${!PALUDIS_IMAGE_DIR_VAR}${DESTTREE}/sbin" || ret=2
fi
done
[[ 0 != "${ret}" ]] && paludis_die_or_error "dosbin returned error ${ret}"
exit ${ret}

@ -0,0 +1,31 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006, 2007, 2009, 2011 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
PALUDIS_JOBS_ARGS=
if [[ -n "${PALUDIS_JOBS_VAR}" ]] && [[ -n "${!PALUDIS_JOBS_VAR}" ]] ; then
PALUDIS_JOBS_ARGS="-j${!PALUDIS_JOBS_VAR}"
fi
echo ${EMAKE_WRAPPER} ${MAKE:-make} ${PALUDIS_JOBS_ARGS} ${MAKEOPTS} "$@" 1>&2
${EMAKE_WRAPPER} ${MAKE:-make} ${PALUDIS_JOBS_ARGS} ${MAKEOPTS} "$@"
ret=$?
[[ 0 != $ret ]] && paludis_die_or_error "emake returned error $ret"
exit $ret

@ -0,0 +1,36 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2008 Bo Ørsted Andresen
#
# 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
if [[ ! -d ${!PALUDIS_TEMP_DIR_VAR} ]]; then
paludis_die_or_error "\${${PALUDIS_TEMP_DIR_VAR}} not valid; aborting"
fi
if [[ ${#} -ne 1 ]]; then
paludis_die_or_error "exactly one argument needed."
fi
if [[ -t 0 ]]; then
paludis_die_or_error "requires stdin input"
fi
rm -rf "${!PALUDIS_TEMP_DIR_VAR}/${1}"
cat > "${!PALUDIS_TEMP_DIR_VAR}/${1}"
dobin "${!PALUDIS_TEMP_DIR_VAR}/${1}"

@ -0,0 +1,36 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2008 Bo Ørsted Andresen
#
# 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
if [[ ! -d ${!PALUDIS_TEMP_DIR_VAR} ]]; then
paludis_die_or_error "\${${PALUDIS_TEMP_DIR_VAR}} not valid; aborting"
fi
if [[ ${#} -ne 1 ]]; then
paludis_die_or_error "exactly one argument needed"
fi
if [[ -t 0 ]]; then
paludis_die_or_error "requires stdin input"
fi
rm -rf "${!PALUDIS_TEMP_DIR_VAR}/${1}"
cat > "${!PALUDIS_TEMP_DIR_VAR}/${1}"
doconfd "${!PALUDIS_TEMP_DIR_VAR}/${1}"

@ -0,0 +1,36 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2008 Bo Ørsted Andresen
#
# 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
if [[ ! -d ${!PALUDIS_TEMP_DIR_VAR} ]]; then
paludis_die_or_error "\${${PALUDIS_TEMP_DIR_VAR}} not valid; aborting"
fi
if [[ ${#} -ne 1 ]]; then
paludis_die_or_error "exactly one argument needed"
fi
if [[ -t 0 ]]; then
paludis_die_or_error "requires stdin input"
fi
rm -rf "${!PALUDIS_TEMP_DIR_VAR}/${1}"
cat > "${!PALUDIS_TEMP_DIR_VAR}/${1}"
doenvd "${!PALUDIS_TEMP_DIR_VAR}/${1}"

@ -0,0 +1,36 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2008 Bo Ørsted Andresen
#
# 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
if [[ ! -d ${!PALUDIS_TEMP_DIR_VAR} ]]; then
paludis_die_or_error "\${${PALUDIS_TEMP_DIR_VAR}} not valid; aborting"
fi
if [[ ${#} -ne 1 ]]; then
paludis_die_or_error "exactly one argument needed"
fi
if [[ -t 0 ]]; then
paludis_die_or_error "requires stdin input"
fi
rm -rf "${!PALUDIS_TEMP_DIR_VAR}/${1}"
cat > "${!PALUDIS_TEMP_DIR_VAR}/${1}"
doinitd "${!PALUDIS_TEMP_DIR_VAR}/${1}"

@ -0,0 +1,36 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2008 Bo Ørsted Andresen
#
# 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
if [[ ! -d ${!PALUDIS_TEMP_DIR_VAR} ]]; then
paludis_die_or_error "\${${PALUDIS_TEMP_DIR_VAR}} not valid; aborting"
fi
if [[ ${#} -ne 1 ]]; then
paludis_die_or_error "exactly one argument needed"
fi
if [[ -t 0 ]]; then
paludis_die_or_error "requires stdin input"
fi
rm -rf "${!PALUDIS_TEMP_DIR_VAR}/${1}"
cat > "${!PALUDIS_TEMP_DIR_VAR}/${1}"
doins "${!PALUDIS_TEMP_DIR_VAR}/${1}"

@ -0,0 +1,41 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2008 Bo Ørsted Andresen
#
# 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
if [[ ${FILESYSTEM_LAYOUT} == cross ]]; then
source "${PALUDIS_EBUILD_DIR}"/utils/exheres-0/banned_in_eapi_exheres-0
die_because_banned_in_eapi_exheres-0
fi
if [[ ! -d ${!PALUDIS_TEMP_DIR_VAR} ]]; then
paludis_die_or_error "\${${PALUDIS_TEMP_DIR_VAR}} not valid; aborting"
fi
if [[ ${#} -ne 1 ]]; then
paludis_die_or_error "exactly one argument needed."
fi
if [[ -t 0 ]]; then
paludis_die_or_error "requires stdin input"
fi
rm -rf "${!PALUDIS_TEMP_DIR_VAR}/${1}"
cat > "${!PALUDIS_TEMP_DIR_VAR}/${1}"
dosbin "${!PALUDIS_TEMP_DIR_VAR}/${1}"

@ -0,0 +1,48 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006 Stephen Bennett
#
# Based in part upon newsbin from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
# Public License v2.
#
# 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
if [[ ${FILESYSTEM_LAYOUT} == cross ]]; then
source "${PALUDIS_EBUILD_DIR}"/utils/exheres-0/banned_in_eapi_exheres-0
die_because_banned_in_eapi_exheres-0
fi
if [[ ! -d ${!PALUDIS_TEMP_DIR_VAR} ]]; then
paludis_die_or_error "\${${PALUDIS_TEMP_DIR_VAR}} not valid; aborting"
fi
if [[ ${#} -ne 2 ]]; then
paludis_die_or_error "exactly two arguments needed"
fi
rm -rf "${!PALUDIS_TEMP_DIR_VAR}/${2}"
if [[ ${1} == - && -n ${PALUDIS_NEW_STDIN} ]]; then
[[ -t 0 ]] && paludis_die_or_error "requires stdin input"
cat > "${!PALUDIS_TEMP_DIR_VAR}/${2}"
else
cp "${1}" "${!PALUDIS_TEMP_DIR_VAR}/${2}"
fi
dosbin "${!PALUDIS_TEMP_DIR_VAR}/${2}"

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
# Copyright (c) 2008 Bo Ørsted Andresen
#
# 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
export PALUDIS_FAILURE_IS_FATAL= PALUDIS_FAILURE_IS_NONFATAL=yes
exec "${@}"

@ -0,0 +1,36 @@
#!/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
if [[ "${!PALUDIS_EBUILD_PHASE_VAR}" == "install" ]] ; then
# autoconf likes to call 'strip' even if it won't use it
paludis_die_or_error "caught a naughty build system doing 'strip $@'"
fi
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 strip "$@"