diff options
author | 2006-12-18 21:52:22 +0000 | |
---|---|---|
committer | 2006-12-18 21:52:22 +0000 | |
commit | 5290dcb77109edf8be4022bdb52317f4178703a9 (patch) | |
tree | 3e9bc2105a2bc28adf9eba05a94bfcacc3903719 /eselect | |
parent | 9a238e2f025a14b88e38a81345ffeb188f54095a (diff) | |
download | paludis-5290dcb77109edf8be4022bdb52317f4178703a9.tar.gz paludis-5290dcb77109edf8be4022bdb52317f4178703a9.tar.xz |
Allow installing repositories from an arbitrary template path
Diffstat (limited to 'eselect')
-rw-r--r-- | eselect/repo.eselect | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/eselect/repo.eselect b/eselect/repo.eselect index 75f02ea17..00c1f879c 100644 --- a/eselect/repo.eselect +++ b/eselect/repo.eselect @@ -84,6 +84,13 @@ do_install() { shift fi + local name=$1 + if [[ ${name} == */* ]]; then + # We have what looks like a full path. + name=$(basename $name) + name=${name%.templ} + fi + if [[ -e $(get_var config_root)/repositories/$1.conf ]] && [[ $force == 0 ]]; then write_error_msg "$1 appears to be already installed. " write_error_msg "To overwrite it, use --force or -f." @@ -122,10 +129,10 @@ do_install() { distdir=$(get_var distdir) [[ -n ${distdir} ]] && echo "distdir=${distdir}" fi - ) >"$(get_var config_root)/repositories/$1.conf.tmp" + ) >"$(get_var config_root)/repositories/${name}.conf.tmp" - if [[ ! -f "$(get_var config_root)/repositories/$1.conf)" ]]; then - mv $(get_var config_root)/repositories/$1.conf{.tmp,} + if [[ -f "$(get_var config_root)/repositories/${name}.conf.tmp" ]]; then + mv $(get_var config_root)/repositories/${name}.conf{.tmp,} else die -q "Error creating ${1}.conf" fi |