[PATCH] go: use a different goconfig package
Justus Winter <4winter at informatik.uni-hamburg.de> writes: > The notmuch-addrlookup utility uses a third party library to read the > notmuch configuration file. The previously used implementation at > "github.com/kless/goconfig" vanished, so this patch switches to the > implementation at "github.com/msbranco/goconfig". As the > implementations differ at the API level, the code is updated > accordingly. Pushed, d
Re: [PATCH] go: use a different goconfig package
Justus Winter 4win...@informatik.uni-hamburg.de writes: The notmuch-addrlookup utility uses a third party library to read the notmuch configuration file. The previously used implementation at github.com/kless/goconfig vanished, so this patch switches to the implementation at github.com/msbranco/goconfig. As the implementations differ at the API level, the code is updated accordingly. Pushed, d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH] go: use a different goconfig package
On Wed, Apr 24 2013, David Bremner wrote: > Justus Winter <4winter at informatik.uni-hamburg.de> writes: > >> The notmuch-addrlookup utility uses a third party library to read the >> notmuch configuration file. The previously used implementation at >> "github.com/kless/goconfig" vanished, so this patch switches to the >> implementation at "github.com/msbranco/goconfig". As the >> implementations differ at the API level, the code is updated >> accordingly. > > It's great that you fixed this, but the whole idea of something failing > to build depending on the status of a website makes me pretty > uncomfortable. Me too, but this is the status quo (atm(*)). The patch looks good and state of things tolerable to me. (*) and probably things won't change in (near) future ;/ > d Tomi
Re: [PATCH] go: use a different goconfig package
On Wed, Apr 24 2013, David Bremner da...@tethera.net wrote: Justus Winter 4win...@informatik.uni-hamburg.de writes: The notmuch-addrlookup utility uses a third party library to read the notmuch configuration file. The previously used implementation at github.com/kless/goconfig vanished, so this patch switches to the implementation at github.com/msbranco/goconfig. As the implementations differ at the API level, the code is updated accordingly. It's great that you fixed this, but the whole idea of something failing to build depending on the status of a website makes me pretty uncomfortable. Me too, but this is the status quo (atm(*)). The patch looks good and state of things tolerable to me. (*) and probably things won't change in (near) future ;/ d Tomi ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] go: use a different goconfig package
Quoting David Bremner (2013-04-24 00:51:11) Justus Winter 4win...@informatik.uni-hamburg.de writes: The notmuch-addrlookup utility uses a third party library to read the notmuch configuration file. The previously used implementation at github.com/kless/goconfig vanished, so this patch switches to the implementation at github.com/msbranco/goconfig. As the implementations differ at the API level, the code is updated accordingly. It's great that you fixed this, but the whole idea of something failing to build depending on the status of a website makes me pretty uncomfortable. d Ah, I pondered whether I should write more about the lib change. Maybe I should have. So there are two libs, kless and msbranco for short. kless is a fork of msbranco, and it seems like the author abandoned his fork. So we are now using the original lib, msbranco. msbranco seems to be in maintenance mode, but has recently received updates to fix some minor issues wrt. go 1.1. There are a lot of forks of msbranco on github, so even if msbranco vanishes as well, we can pick the next most promising fork. So yeah, I feel the same way, it's unfortunately that I had to patch this, but we're better of now (it builds again and we moved to a more vanilla goconfig API (assuming the other forks do not change the api as much as kless did)). And I think you are being a bit harsh with the status of the website comment. In case you are not familiar with go, github.com/kless/goconfig is a package path, not a website. It just happens to also be the host+resource part of a URL that points to the github project page. So what happened here is that the VCS repository specified by the package path vanished, not some web site (well, that vanished too, but that didn't cause the build failure). If you happen to have golang installed, type go help remote for more information. Cheers, Justus ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH] go: use a different goconfig package
Justus Winter <4winter at informatik.uni-hamburg.de> writes: > The notmuch-addrlookup utility uses a third party library to read the > notmuch configuration file. The previously used implementation at > "github.com/kless/goconfig" vanished, so this patch switches to the > implementation at "github.com/msbranco/goconfig". As the > implementations differ at the API level, the code is updated > accordingly. It's great that you fixed this, but the whole idea of something failing to build depending on the status of a website makes me pretty uncomfortable. d
[PATCH] go: use a different goconfig package
The notmuch-addrlookup utility uses a third party library to read the notmuch configuration file. The previously used implementation at "github.com/kless/goconfig" vanished, so this patch switches to the implementation at "github.com/msbranco/goconfig". As the implementations differ at the API level, the code is updated accordingly. Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> --- bindings/go/Makefile |4 ++-- bindings/go/src/notmuch-addrlookup/addrlookup.go | 14 ++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/bindings/go/Makefile b/bindings/go/Makefile index c38f234..1b9e750 100644 --- a/bindings/go/Makefile +++ b/bindings/go/Makefile @@ -15,8 +15,8 @@ notmuch: .PHONY: goconfig goconfig: - if [ ! -d src/github.com/kless/goconfig/config ]; then \ - $(GO) get github.com/kless/goconfig/config; \ + if [ ! -d github.com/msbranco/goconfig ]; then \ + $(GO) get github.com/msbranco/goconfig; \ fi .PHONY: notmuch-addrlookup diff --git a/bindings/go/src/notmuch-addrlookup/addrlookup.go b/bindings/go/src/notmuch-addrlookup/addrlookup.go index 59283f8..916e5bb 100644 --- a/bindings/go/src/notmuch-addrlookup/addrlookup.go +++ b/bindings/go/src/notmuch-addrlookup/addrlookup.go @@ -11,7 +11,7 @@ import "sort" // 3rd-party imports import "notmuch" -import "github.com/kless/goconfig/config" +import "github.com/msbranco/goconfig" type mail_addr_freq struct { addr string @@ -178,22 +178,20 @@ type address_matcher struct { } func new_address_matcher() *address_matcher { - var cfg *config.Config - var err error - // honor NOTMUCH_CONFIG home := os.Getenv("NOTMUCH_CONFIG") if home == "" { home = os.Getenv("HOME") } - if cfg, err = config.ReadDefault(path.Join(home, ".notmuch-config")); err != nil { + cfg, err := goconfig.ReadConfigFile(path.Join(home, ".notmuch-config")) + if err != nil { log.Fatalf("error loading config file:", err) } - db_path, _ := cfg.String("database", "path") - primary_email, _ := cfg.String("user", "primary_email") - addrbook_tag, err := cfg.String("user", "addrbook_tag") + db_path, _ := cfg.GetString("database", "path") + primary_email, _ := cfg.GetString("user", "primary_email") + addrbook_tag, err := cfg.GetString("user", "addrbook_tag") if err != nil { addrbook_tag = "addressbook" } -- 1.7.10.4
[PATCH] go: use a different goconfig package
The notmuch-addrlookup utility uses a third party library to read the notmuch configuration file. The previously used implementation at github.com/kless/goconfig vanished, so this patch switches to the implementation at github.com/msbranco/goconfig. As the implementations differ at the API level, the code is updated accordingly. Signed-off-by: Justus Winter 4win...@informatik.uni-hamburg.de --- bindings/go/Makefile |4 ++-- bindings/go/src/notmuch-addrlookup/addrlookup.go | 14 ++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/bindings/go/Makefile b/bindings/go/Makefile index c38f234..1b9e750 100644 --- a/bindings/go/Makefile +++ b/bindings/go/Makefile @@ -15,8 +15,8 @@ notmuch: .PHONY: goconfig goconfig: - if [ ! -d src/github.com/kless/goconfig/config ]; then \ - $(GO) get github.com/kless/goconfig/config; \ + if [ ! -d github.com/msbranco/goconfig ]; then \ + $(GO) get github.com/msbranco/goconfig; \ fi .PHONY: notmuch-addrlookup diff --git a/bindings/go/src/notmuch-addrlookup/addrlookup.go b/bindings/go/src/notmuch-addrlookup/addrlookup.go index 59283f8..916e5bb 100644 --- a/bindings/go/src/notmuch-addrlookup/addrlookup.go +++ b/bindings/go/src/notmuch-addrlookup/addrlookup.go @@ -11,7 +11,7 @@ import sort // 3rd-party imports import notmuch -import github.com/kless/goconfig/config +import github.com/msbranco/goconfig type mail_addr_freq struct { addr string @@ -178,22 +178,20 @@ type address_matcher struct { } func new_address_matcher() *address_matcher { - var cfg *config.Config - var err error - // honor NOTMUCH_CONFIG home := os.Getenv(NOTMUCH_CONFIG) if home == { home = os.Getenv(HOME) } - if cfg, err = config.ReadDefault(path.Join(home, .notmuch-config)); err != nil { + cfg, err := goconfig.ReadConfigFile(path.Join(home, .notmuch-config)) + if err != nil { log.Fatalf(error loading config file:, err) } - db_path, _ := cfg.String(database, path) - primary_email, _ := cfg.String(user, primary_email) - addrbook_tag, err := cfg.String(user, addrbook_tag) + db_path, _ := cfg.GetString(database, path) + primary_email, _ := cfg.GetString(user, primary_email) + addrbook_tag, err := cfg.GetString(user, addrbook_tag) if err != nil { addrbook_tag = addressbook } -- 1.7.10.4 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH] go: use a different goconfig package
Justus Winter 4win...@informatik.uni-hamburg.de writes: The notmuch-addrlookup utility uses a third party library to read the notmuch configuration file. The previously used implementation at github.com/kless/goconfig vanished, so this patch switches to the implementation at github.com/msbranco/goconfig. As the implementations differ at the API level, the code is updated accordingly. It's great that you fixed this, but the whole idea of something failing to build depending on the status of a website makes me pretty uncomfortable. d ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch