Set PORTDIR separately in set_portdir.bash
This commit is contained in:
parent
954b98f4e0
commit
8474f69819
12
etc/paludis/hooks/set_portdir.bash
Normal file
12
etc/paludis/hooks/set_portdir.bash
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# set PORTDIR
|
||||||
|
|
||||||
|
PORTDIR="$(cave print-repository-metadata --raw-name location gentoo)"
|
||||||
|
PORTDIR="${PORTDIR#location=}"
|
||||||
|
|
||||||
|
if [[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] ; then
|
||||||
|
die "PORTDIR empty or pointing to root!"
|
||||||
|
elif [[ ! -e ${PORTDIR} ]] ; then
|
||||||
|
die "PORTDIR does not exist!"
|
||||||
|
fi
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
||||||
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
||||||
|
source "/etc/paludis/hooks/set_portdir.bash"
|
||||||
PORTDIR="/usr/portage"
|
|
||||||
|
|
||||||
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
|
|
||||||
|
|
||||||
|
|
||||||
einfo "syncing metadata cache"
|
einfo "syncing metadata cache"
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
||||||
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
||||||
|
source "/etc/paludis/hooks/set_portdir.bash"
|
||||||
PORTDIR="/usr/portage"
|
|
||||||
|
|
||||||
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
|
|
||||||
|
|
||||||
|
|
||||||
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
||||||
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
||||||
|
source "/etc/paludis/hooks/set_portdir.bash"
|
||||||
PORTDIR="/usr/portage"
|
|
||||||
|
|
||||||
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
|
|
||||||
|
|
||||||
|
|
||||||
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
||||||
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
||||||
|
source "/etc/paludis/hooks/set_portdir.bash"
|
||||||
PORTDIR="/usr/portage"
|
|
||||||
|
|
||||||
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
|
|
||||||
|
|
||||||
|
|
||||||
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/echo_functions.bash"
|
||||||
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
source "${PALUDIS_EBUILD_DIR}/die_functions.bash"
|
||||||
|
source "/etc/paludis/hooks/set_portdir.bash"
|
||||||
PORTDIR="/usr/portage"
|
|
||||||
|
|
||||||
[[ -z ${PORTDIR} || "$(dirname ${PORTDIR})" == "/" ]] && die "PORTDIR empty or pointing to root!"
|
|
||||||
|
|
||||||
|
|
||||||
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
cd "${PORTDIR}"/metadata || die "could not cd into '${PORTDIR}/metadata'!"
|
||||||
|
Loading…
Reference in New Issue
Block a user