aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-11-28 14:01:23 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-11-28 14:01:23 +0000
commitd5ee88245eb7744372ae36204a97e73d754c0bc6 (patch)
tree273005e0de83dd19212c2366fbc9239766c49d49
parent7e2b6bec85508b542720039714619e0129e394da (diff)
downloadpaludis-d5ee88245eb7744372ae36204a97e73d754c0bc6.tar.gz
paludis-d5ee88245eb7744372ae36204a97e73d754c0bc6.tar.xz
Allow user defined fetchers. Convert protocol names to lowercase.
-rw-r--r--ebuild/builtin_fetch.bash7
-rw-r--r--ebuild/fetchers/Makefile.am8
-rw-r--r--paludis/ebuild.cc1
-rw-r--r--paludis/environment.cc9
-rw-r--r--paludis/environment.hh7
5 files changed, 30 insertions, 2 deletions
diff --git a/ebuild/builtin_fetch.bash b/ebuild/builtin_fetch.bash
index 6cd84f8..69c13db 100644
--- a/ebuild/builtin_fetch.bash
+++ b/ebuild/builtin_fetch.bash
@@ -42,7 +42,12 @@ builtin_fetch()
ebuild_section "Need to fetch ${aa}"
old_aa="${aa}"
fi
- prg="${PALUDIS_EBUILD_DIR}/fetchers/do$(echo ${a%%://*} )"
+ local d
+ for d in ${PALUDIS_FETCHERS_DIRS:-${PALUDIS_EBUILD_DIR}/fetchers/} ; do
+ prg=${d}/do$(echo ${a%%://*} | tr '[:upper:]' '[:lower:]' )
+ ebuild_notice "debug" "fetcher program candidate for '${a}' is '${prg}'"
+ [[ -x "${prg}" ]] && break
+ done
if [[ -x "${prg}" ]] ; then
${prg} "${a}" "${DISTDIR}/${aa}"
else
diff --git a/ebuild/fetchers/Makefile.am b/ebuild/fetchers/Makefile.am
index 5f92bd0..74da068 100644
--- a/ebuild/fetchers/Makefile.am
+++ b/ebuild/fetchers/Makefile.am
@@ -1,7 +1,10 @@
MAINTAINERCLEANFILES = Makefile.in
-CLEANFILES = *~ dohttp dohttps doftp
+CLEANFILES = *~ dohttp dohttps doftp .keep
SUBDIRS = .
+.keep :
+ touch $@
+
libexecprogdir = $(libexecdir)/paludis/fetchers/
libexecprog_SCRIPTS = \
@@ -15,6 +18,9 @@ TESTS_ENVIRONMENT = env \
TEST_SCRIPT_DIR="$(srcdir)/" \
bash $(top_srcdir)/test/run_test.sh
+installuserfetchersdir = $(datadir)/paludis/fetchers
+installuserfetchers_DATA = .keep
+
TESTS =
EXTRA_DIST = $(libexecprog_SCRIPTS) dowget.in
diff --git a/paludis/ebuild.cc b/paludis/ebuild.cc
index 8ddfdc1..87e0a60 100644
--- a/paludis/ebuild.cc
+++ b/paludis/ebuild.cc
@@ -105,6 +105,7 @@ EbuildCommand::operator() ()
("PALUDIS_CONFIG_DIR", SYSCONFDIR "/paludis/")
("PALUDIS_BASHRC_FILES", params.environment->bashrc_files())
("PALUDIS_HOOK_DIRS", params.environment->hook_dirs())
+ ("PALUDIS_FETCHERS_DIRS", params.environment->fetchers_dirs())
("PALUDIS_COMMAND", params.environment->paludis_command())
("KV", kernel_version())
("PALUDIS_EBUILD_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
diff --git a/paludis/environment.cc b/paludis/environment.cc
index 2e18e26..8c83e71 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -444,6 +444,15 @@ Environment::hook_dirs() const
return "";
}
+std::string
+Environment::fetchers_dirs() const
+{
+ return
+ DATADIR "/paludis/fetchers" " "
+ LIBEXECDIR "/paludis/fetchers" " "
+ ;
+}
+
namespace
{
static const std::multimap<std::string, std::string> environment_mirrors;
diff --git a/paludis/environment.hh b/paludis/environment.hh
index eeacee1..16d88ed 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -200,6 +200,13 @@ namespace paludis
virtual std::string hook_dirs() const;
/**
+ * Our fetchers directories.
+ *
+ * Default behaviour: user then paludis fetcher dirs.
+ */
+ virtual std::string fetchers_dirs() const;
+
+ /**
* How to run paludis.
*/
virtual std::string paludis_command() const = 0;