aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Walker <ka0ttic@gentoo.org>2005-05-07 15:53:43 +0000
committerAaron Walker <ka0ttic@gentoo.org>2005-05-07 15:53:43 +0000
commit2f9b8b75af8c800b44332c8d663a972b5ba430e9 (patch)
treec45f259efbc977ebc791edf60a5192c542372f8e
parentFixed overlong lines in {blas,lapack}.eclectic's DESCRIPTION. (diff)
downloadeselect-2f9b8b75af8c800b44332c8d663a972b5ba430e9.tar.gz
eselect-2f9b8b75af8c800b44332c8d663a972b5ba430e9.tar.bz2
eselect-2f9b8b75af8c800b44332c8d663a972b5ba430e9.zip
Updated profile module to work with current profiles.desc format
svn path=/trunk/; revision=30
-rw-r--r--ChangeLog6
-rw-r--r--modules/profile-symlink.eclectic20
2 files changed, 24 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1e0eafc..0b3505d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
ChangeLog for eclectic
+2005-05-07 Aaron Walker <ka0ttic@gentoo.org>
+
+ * modules/profile-symlink.eclectic: Fix sed to use current
+ profiles.desc format. Also, ensure that explicitly specified profiles
+ are actually valid for the host arch.
+
2005-05-07 Danny van Dyk <kugelfang@gentoo.org>
* libs/output.bash.in: Added funciton 'space'.
diff --git a/modules/profile-symlink.eclectic b/modules/profile-symlink.eclectic
index d5eff4c..3a7e081 100644
--- a/modules/profile-symlink.eclectic
+++ b/modules/profile-symlink.eclectic
@@ -12,13 +12,13 @@ find_targets() {
# $arch will be null if there's no current make.profile symlink
# we cannot get a list of valid profiles without it.
- if [[ -z ${arch} ]] ; then
+ if [[ -z "${arch}" ]] ; then
die -q "Failed to determine \${ARCH}. Is your make.profile symlink valid?"
fi
portdir=$(portageq portdir 2>/dev/null)
- for p in $(sed -n -e "s|^${arch}[[:space:]]\+\([^[:space:]].*\)$|\1|p" \
+ for p in $(sed -n -e "s|^${arch}[[:space:]]\+\([^[:space:]]\+\).*$|\1|p" \
${ROOT}/${portdir}/profiles/profiles.desc)
do
echo ${p}
@@ -37,7 +37,23 @@ set_symlink() {
if [[ -z "${target//[[:digit:]]}" ]] ; then
targets=( $(find_targets) )
target=${targets[$(( ${target} - 1 ))]}
+ elif [[ -n "${target}" && -d "${ROOT}/${portdir}/profiles/${target}" ]]
+ then
+ # user specifed explicit profile, not a list number, so
+ # double check and make sure it's valid
+ arch=$(portageq envvar ARCH 2>/dev/null)
+ if [[ -z "${arch}" ]] ; then
+ die -q "Failed to determine \${ARCH}. Is your make.profile symlink valid?"
+ fi
+
+ parch=$(sed -n -e "s|^\([[:alnum:]]\+\)[[:space:]]\+${target}.*$|\1|p" \
+ ${ROOT}/${portdir}/profiles/profiles.desc)
+
+ if [[ ${arch} != "${parch}" ]] ; then
+ die -q "${target} is not a valid profile for ${arch}."
+ fi
fi
+
if [[ -z ${target} ]] ; then
die -q "Target \"${1}\" doesn't appear to be valid!"
elif [[ -d "${ROOT}/${portdir}/profiles/${target}" ]] ; then