diff options
author | Aaron Walker <ka0ttic@gentoo.org> | 2005-10-05 11:54:35 +0000 |
---|---|---|
committer | Aaron Walker <ka0ttic@gentoo.org> | 2005-10-05 11:54:35 +0000 |
commit | b13f98631b6f99a590fd30e73a3696ad980068f0 (patch) | |
tree | 83b21042ffc58406b3d28a6c60c48821f6a93727 /modules/profile.eselect | |
parent | Fixed a bug in migrate using spec instead of specs. Fixed a bug in get_bins ... (diff) | |
download | eselect-b13f98631b6f99a590fd30e73a3696ad980068f0.tar.gz eselect-b13f98631b6f99a590fd30e73a3696ad980068f0.tar.bz2 eselect-b13f98631b6f99a590fd30e73a3696ad980068f0.zip |
Added --force option to the profile module's 'set' sub-command.
svn path=/trunk/; revision=205
Diffstat (limited to 'modules/profile.eselect')
-rw-r--r-- | modules/profile.eselect | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/profile.eselect b/modules/profile.eselect index 50b69d1..b63a838 100644 --- a/modules/profile.eselect +++ b/modules/profile.eselect @@ -42,7 +42,7 @@ set_symlink() { parch=$(sed -n -e "s|^\([[:alnum:]]\+\)[[:space:]].*${target}.*$|\1|p" \ ${ROOT}/${portdir}/profiles/profiles.desc) - if [[ ${arch} != ${parch} ]] ; then + if [[ ${arch} != ${parch} && ${2} != "--force" ]] ; then die -q "${target} is not a valid profile for ${arch}" fi fi @@ -112,13 +112,20 @@ describe_set() { } do_set() { + local force + + if [[ ${1} == "--force" ]] ; then + force=${1} + shift + fi + if [[ -z ${1} ]] ; then die -q "You didn't tell me what to set the symlink to" elif [[ -e "${ROOT}/etc/make.profile" ]] && [[ ! -L "${ROOT}/etc/make.profile" ]] ; then die -q "${ROOT}/etc/make.profile isn't a symlink" else - set_symlink "${1}" || die -q "Couldn't set a new symlink" + set_symlink "${1}" ${force} || die -q "Couldn't set a new symlink" fi } |