aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen P. Bennett <spb@exherbo.org> 2006-12-18 21:52:22 +0000
committerAvatar Stephen P. Bennett <spb@exherbo.org> 2006-12-18 21:52:22 +0000
commit5290dcb77109edf8be4022bdb52317f4178703a9 (patch)
tree3e9bc2105a2bc28adf9eba05a94bfcacc3903719
parent9a238e2f025a14b88e38a81345ffeb188f54095a (diff)
downloadpaludis-5290dcb77109edf8be4022bdb52317f4178703a9.tar.gz
paludis-5290dcb77109edf8be4022bdb52317f4178703a9.tar.xz
Allow installing repositories from an arbitrary template path
-rw-r--r--eselect/repo.eselect13
1 files changed, 10 insertions, 3 deletions
diff --git a/eselect/repo.eselect b/eselect/repo.eselect
index 75f02ea..00c1f87 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