summaryrefslogtreecommitdiff
path: root/rhimport/fetcher.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-03-04 18:46:54 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-03-04 18:46:54 (GMT)
commitee7810ebe5d06fdf1198435186bcbdfb5b1af82a (patch)
tree762e3e24934ad4084a03e2205bc55b22ca91dd23 /rhimport/fetcher.go
parent589241729ddae89198eb7533725849471f9a4c57 (diff)
inital archiv fetcher
Diffstat (limited to 'rhimport/fetcher.go')
-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) {