summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rhimport/fetcher.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/rhimport/fetcher.go b/rhimport/fetcher.go
index cbcbc41..446cebf 100644
--- a/rhimport/fetcher.go
+++ b/rhimport/fetcher.go
@@ -222,10 +222,18 @@ func fetchFileFake(ctx *Context, res *Result, uri *url.URL) error {
return nil
}
+func fetchFileArchiv(ctx *Context, res *Result, uri *url.URL) error {
+ rhdl.Printf("archiv fetcher for '%s'", ctx.SourceUri)
+
+ res.ResponseCode = http.StatusNotImplemented
+ res.ErrorString = "archiv fetcher is not finished yet"
+ // TODO: implement this
+ return nil
+}
+
type FetchFunc func(*Context, *Result, *url.URL) (err error)
// TODO: implement fetchers for:
-// archiv://
// public://
// home:// ?????
var (
@@ -240,10 +248,15 @@ var (
)
func fetcherInit() {
+ archiveEnabled := false
info := curl.VersionInfo(curl.VERSION_FIRST)
protos := info.Protocols
for _, proto := range protos {
- if _, ok := curlProtos[proto]; ok {
+ if proto == "smb" {
+ rhdl.Printf("curl: enabling protocol %s", proto)
+ fetchers["archiv"] = fetchFileArchiv
+ archiveEnabled = true
+ } else if _, ok := curlProtos[proto]; ok {
rhdl.Printf("curl: enabling protocol %s", proto)
fetchers[proto] = fetchFileCurl
curlProtos[proto] = true
@@ -256,6 +269,9 @@ func fetcherInit() {
rhl.Printf("curl: protocol %s is disabled because the installed library version doesn't support it!", proto)
}
}
+ if !archiveEnabled {
+ rhl.Printf("archiv: fetcher is disabled because the installed curl library version doesn't support scp!")
+ }
}
func checkPassword(ctx *Context, result *Result) (err error) {