Hello community,

here is the log from the commit of package direnv for openSUSE:Factory checked 
in at 2018-10-17 08:40:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/direnv (Old)
 and      /work/SRC/openSUSE:Factory/.direnv.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "direnv"

Wed Oct 17 08:40:54 2018 rev:4 rq:642078 version:2.17.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/direnv/direnv.changes    2018-02-27 
16:59:43.740202375 +0100
+++ /work/SRC/openSUSE:Factory/.direnv.new/direnv.changes       2018-10-17 
08:41:48.485835173 +0200
@@ -1,0 +2,9 @@
+Mon Oct 15 14:34:57 UTC 2018 - s...@suspend.net
+
+- Update to 2.17.0
+  + CHANGE: hook expands the direnv path.
+  + CHANGE: stdlib: direnv_load: disallow watching in child (#368)
+  + README: add OpenSUSE to the list of distros
+  + Revert "Use_nix: unset IN_NIX_SHELL"
+
+-------------------------------------------------------------------

Old:
----
  direnv-2.15.2.tar.gz

New:
----
  direnv-2.17.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ direnv.spec ++++++
--- /var/tmp/diff_new_pack.vDqrRb/_old  2018-10-17 08:41:49.169834590 +0200
+++ /var/tmp/diff_new_pack.vDqrRb/_new  2018-10-17 08:41:49.169834590 +0200
@@ -12,13 +12,13 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 %define gopackagepath github.com/direnv/direnv
 Name:           direnv
-Version:        2.15.2
+Version:        2.17.0
 Release:        0
 Summary:        Unclutter a .profile
 License:        MIT

++++++ direnv-2.15.2.tar.gz -> direnv-2.17.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/CHANGELOG.md 
new/direnv-2.17.0/CHANGELOG.md
--- old/direnv-2.15.2/CHANGELOG.md      2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/CHANGELOG.md      2018-06-17 17:20:25.000000000 +0200
@@ -1,4 +1,21 @@
 
+2.17.0 / 2018-06-17
+==================
+
+  * CHANGE: hook expands the direnv path. Ensures that direnv can be executed 
even if the PATH is changed #369.
+  * CHANGE: stdlib: direnv_load: disallow watching in child
+    Allows the `use nix --pure` scenario in #368
+  * README: add OpenSuSE to the list of distros
+  * Revert "use_nix: unset IN_NIX_SHELL"
+
+2.16.0 / 2018-05-09
+==================
+
+  * NEW: add support for elvish (#356)
+  * NEW: config: allow to disable stdin on eval (#351)
+  * DOC: Add the usage of source_up to the README (#347)
+  * FIX: default.nix: fix compilation
+
 2.15.2 / 2018-02-25
 ==================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/Makefile new/direnv-2.17.0/Makefile
--- old/direnv-2.15.2/Makefile  2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/Makefile  2018-06-17 17:20:25.000000000 +0200
@@ -50,6 +50,8 @@
 test: build
        go test
        ./test/direnv-test.sh
+       go get github.com/elves/elvish
+       elvish ./test/direnv-test.elv
 
 install: all
        install -d $(DESTDIR)/bin
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/README.md new/direnv-2.17.0/README.md
--- old/direnv-2.15.2/README.md 2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/README.md 2018-06-17 17:20:25.000000000 +0200
@@ -2,7 +2,7 @@
 =================================
 
 `direnv` is an environment switcher for the shell. It knows how to hook into
-bash, zsh, tcsh and fish shell to load or unload environment variables
+bash, zsh, tcsh, fish shell and elvish to load or unload environment variables
 depending on the current directory. This allows project-specific
 environment variables without cluttering the `~/.profile` file.
 
@@ -61,6 +61,7 @@
 * [NetBSD pkgsrc-wip](http://www.pkgsrc.org/wip/)
 * [NixOS](https://nixos.org/nixos/packages.html)
 * [OSX Homebrew](http://brew.sh/)
+* [OpenSuSe](https://build.opensuse.org/package/show/openSUSE%3AFactory/direnv)
 * [MacPorts](https://www.macports.org/)
 * 
[Ubuntu](https://packages.ubuntu.com/search?keywords=direnv&searchon=names&suite=all&section=all)
 * [GNU Guix](https://www.gnu.org/software/guix/)
@@ -115,6 +116,19 @@
 eval `direnv hook tcsh`
 ```
 
+### Elvish
+
+Run:
+
+```
+$> direnv hook elvish > ~/.elvish/lib/direnv.elv
+```
+
+and add the following line to your `~/.elvish/rc.elv` file:
+
+```
+use direnv
+```
 
 ## Usage
 
@@ -174,6 +188,11 @@
 ```sh
 source_env ..
 ```
+In the general case `source_up` will load any .envrc higher up in the folder 
structure. This allows you to truely enable arbitrary heirarchical stuctures of 
`.envrc` usage.
+
+```sh
+source_up
+```
 
 ## Common things people don't know
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/cmd_hook.go 
new/direnv-2.17.0/cmd_hook.go
--- old/direnv-2.15.2/cmd_hook.go       2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/cmd_hook.go       2018-06-17 17:20:25.000000000 +0200
@@ -2,8 +2,16 @@
 
 import (
        "fmt"
+       "os"
+       "text/template"
 )
 
+// HookContext are the variables available during hook template evaluation
+type HookContext struct {
+       // SelfPath is the unescaped absolute path to direnv
+       SelfPath string
+}
+
 // `direnv hook $0`
 var CmdHook = &Cmd{
        Name: "hook",
@@ -16,17 +24,32 @@
                        target = args[1]
                }
 
+               selfPath, err := os.Executable()
+               if err != nil {
+                       return err
+               }
+
+               ctx := HookContext{selfPath}
+
                shell := DetectShell(target)
                if shell == nil {
                        return fmt.Errorf("Unknown target shell '%s'", target)
                }
 
-               h, err := shell.Hook()
+               hookStr, err := shell.Hook()
                if err != nil {
                        return err
                }
 
-               fmt.Println(h)
+               hookTemplate, err := template.New("hook").Parse(hookStr)
+               if err != nil {
+                       return err
+               }
+
+               err = hookTemplate.Execute(os.Stdout, ctx)
+               if err != nil {
+                       return err
+               }
 
                return
        },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/config.go new/direnv-2.17.0/config.go
--- old/direnv-2.15.2/config.go 2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/config.go 2018-06-17 17:20:25.000000000 +0200
@@ -18,13 +18,15 @@
        BashPath        string
        RCDir           string
        TomlPath        string
+       DisableStdin    bool
        WhitelistPrefix []string
        WhitelistExact  map[string]bool
 }
 
 type tomlConfig struct {
-       Whitelist whitelist `toml:"whitelist"`
-       BashPath  string    `toml:"bash_path"`
+       Whitelist    whitelist `toml:"whitelist"`
+       BashPath     string    `toml:"bash_path"`
+       DisableStdin bool      `toml:"disable_stdin"`
 }
 
 type whitelist struct {
@@ -47,14 +49,11 @@
        }
 
        var exePath string
-       if exePath, err = exec.LookPath(os.Args[0]); err != nil {
-               err = fmt.Errorf("LoadConfig() Lookpath failed: %q", err)
-               return
-       }
-       if exePath, err = filepath.EvalSymlinks(exePath); err != nil {
-               err = fmt.Errorf("LoadConfig() symlink resolution: %q", err)
+       if exePath, err = os.Executable(); err != nil {
+               err = fmt.Errorf("LoadConfig() os.Executable() failed: %q", err)
                return
        }
+       // Fix for mingsys
        exePath = strings.Replace(exePath, "\\", "/", -1)
        config.SelfPath = exePath
 
@@ -92,6 +91,7 @@
                        config.WhitelistExact[path] = true
                }
 
+               config.DisableStdin = tomlConf.DisableStdin
                config.BashPath = tomlConf.BashPath
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/default.nix 
new/direnv-2.17.0/default.nix
--- old/direnv-2.15.2/default.nix       2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/default.nix       2018-06-17 17:20:25.000000000 +0200
@@ -1,32 +1,28 @@
-with import <nixpkgs> {};
-let
-  rstrip = s:
-    let
-      inherit (builtins) substring;
-      len = builtins.stringLength s;
-      suffix = substring (len - 1) 1 s;
-      ws = [ " " "\r" "\n" "\t" ];
-    in
-      if len > 0 && builtins.any (char: char == suffix) ws then
-        rstrip (substring 0 (len - 1) s)
-      else
-        s;
-  readVersion = f:
-    rstrip (builtins.readFile f);
-in
+{ pkgs ? import <nixpkgs> {} }:
+with pkgs;
 buildGoPackage rec {
-  version = readVersion ./version.txt;
+  version = lib.fileContents ./version.txt;
   name = "direnv-${version}";
   goPackagePath = "github.com/zimbatm/direnv";
 
-  src = ./.;
+  src = lib.cleanSource ./.;
+
+  postConfigure = "cd $NIX_BUILD_TOP/go/src/$goPackagePath";
+
+  buildPhase = "make BASH_PATH=${bash}/bin/bash";
+
+  installPhase = ''
+    mkdir -p $out
+    make install DESTDIR=$bin
+    mkdir -p $bin/share/fish/vendor_conf.d
+    echo "eval ($bin/bin/direnv hook fish)" > 
$bin/share/fish/vendor_conf.d/direnv.fish
+  '';
 
   meta = with stdenv.lib; {
     homepage = http://direnv.net;
-    description = "path-dependent environments";
+    description = "A shell extension that manages your environment";
     maintainers = with maintainers; [ zimbatm ];
     license = licenses.mit;
     platforms = go.meta.platforms;
   };
 }
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/man/direnv.1 
new/direnv-2.17.0/man/direnv.1
--- old/direnv-2.15.2/man/direnv.1      2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/man/direnv.1      2018-06-17 17:20:25.000000000 +0200
@@ -57,32 +57,50 @@
 
 .SS BASH
 .PP
-Add the following line at the end of your "\~/.bashrc" file:
+Add the following line at the end of the \fB\fC\~/.bashrc\fR file:
 
 .PP
-\fB\fCeval "$(direnv hook bash)"\fR
+.RS
+
+.nf
+eval "$(direnv hook bash)"
+
+.fi
+.RE
 
 .PP
 Make sure it appears even after rvm, git\-prompt and other shell extensions
-that manipulate your prompt.
+that manipulate the prompt.
 
 .SS ZSH
 .PP
-Add the following line at the end of your "\~/.zshrc" file:
+Add the following line at the end of the \fB\fC\~/.zshrc\fR file:
 
 .PP
-\fB\fCeval "$(direnv hook zsh)"\fR
+.RS
+
+.nf
+eval "$(direnv hook zsh)"
+
+.fi
+.RE
 
 .SS FISH
 .PP
-Add the following line at the end of your "\~/.config/fish/config.fish" file:
+Add the following line at the end of the \fB\fC\~/.config/fish/config.fish\fR 
file:
 
 .PP
-\fB\fCeval (direnv hook fish)\fR
+.RS
+
+.nf
+eval (direnv hook fish)
+
+.fi
+.RE
 
 .SS TCSH
 .PP
-Add the following line at the end of your "\~/.cshrc" file:
+Add the following line at the end of the \fB\fC\~/.cshrc\fR file:
 
 .PP
 .RS
@@ -93,6 +111,31 @@
 .fi
 .RE
 
+.SS Elvish
+.PP
+Run:
+
+.PP
+.RS
+
+.nf
+$> direnv hook elvish > \~/.elvish/lib/direnv.elv
+
+.fi
+.RE
+
+.PP
+and add the following line to your \fB\fC\~/.elvish/rc.elv\fR file:
+
+.PP
+.RS
+
+.nf
+use direnv
+
+.fi
+.RE
+
 .SH USAGE
 .PP
 In some target folder, create an ".envrc" file and add some export(1)
@@ -140,7 +183,7 @@
 \[la]https://github.com/direnv/direnv/wiki\[ra]
 
 .PP
-Or drop by on the 
+Or drop by on the #direnv channel on FreeNode
 \[la]irc://#direnv@FreeNode\[ra] to
 have a chat.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/man/direnv.1.md 
new/direnv-2.17.0/man/direnv.1.md
--- old/direnv-2.15.2/man/direnv.1.md   2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/man/direnv.1.md   2018-06-17 17:20:25.000000000 +0200
@@ -58,32 +58,52 @@
 
 ### BASH
 
-Add the following line at the end of your "~/.bashrc" file:
+Add the following line at the end of the `~/.bashrc` file:
 
-`eval "$(direnv hook bash)"`
+```sh
+eval "$(direnv hook bash)"
+```
 
 Make sure it appears even after rvm, git-prompt and other shell extensions
-that manipulate your prompt.
+that manipulate the prompt.
 
 ### ZSH
 
-Add the following line at the end of your "~/.zshrc" file:
+Add the following line at the end of the `~/.zshrc` file:
 
-`eval "$(direnv hook zsh)"`
+```sh
+eval "$(direnv hook zsh)"
+```
 
 ### FISH
 
-Add the following line at the end of your "~/.config/fish/config.fish" file:
+Add the following line at the end of the `~/.config/fish/config.fish` file:
 
-`eval (direnv hook fish)`
+```fish
+eval (direnv hook fish)
+```
 
 ### TCSH
 
-Add the following line at the end of your "~/.cshrc" file:
+Add the following line at the end of the `~/.cshrc` file:
 
-    eval `direnv hook tcsh`
+```sh
+eval `direnv hook tcsh`
+```
 
+### Elvish
 
+Run:
+
+```
+$> direnv hook elvish > ~/.elvish/lib/direnv.elv
+```
+
+and add the following line to your `~/.elvish/rc.elv` file:
+
+```
+use direnv
+```
 
 USAGE
 -----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/man/direnv.toml.1 
new/direnv-2.17.0/man/direnv.toml.1
--- old/direnv-2.15.2/man/direnv.toml.1 2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/man/direnv.toml.1 2018-06-17 17:20:25.000000000 +0200
@@ -109,6 +109,10 @@
 .PP
 This allows one to hard\-code the position of bash. It maybe be useful to set 
this to avoid having direnv to fail when PATH is being mutated.
 
+.SH \fB\fCdisable\_stdin\fR
+.PP
+If set to true, stdin is disabled (redirected to /dev/null) during the 
\fB\fC\&.envrc\fR evaluation.
+
 .SH COPYRIGHT
 .PP
 Copyright (C) 2018 zimbatm 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/man/direnv.toml.1.md 
new/direnv-2.17.0/man/direnv.toml.1.md
--- old/direnv-2.15.2/man/direnv.toml.1.md      2018-02-25 13:45:55.000000000 
+0100
+++ new/direnv-2.17.0/man/direnv.toml.1.md      2018-06-17 17:20:25.000000000 
+0200
@@ -82,6 +82,10 @@
 
 This allows one to hard-code the position of bash. It maybe be useful to set 
this to avoid having direnv to fail when PATH is being mutated.
 
+## `disable_stdin`
+
+If set to true, stdin is disabled (redirected to /dev/null) during the 
`.envrc` evaluation.
+
 COPYRIGHT
 ---------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/rc.go new/direnv-2.17.0/rc.go
--- old/direnv-2.15.2/rc.go     2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/rc.go     2018-06-17 17:20:25.000000000 +0200
@@ -132,7 +132,15 @@
        arg := fmt.Sprintf(argtmpl, direnv, self.RelTo(wd), direnv)
        cmd := exec.Command(config.BashPath, "--noprofile", "--norc", "-c", arg)
 
-       cmd.Stdin = os.Stdin
+       if config.DisableStdin {
+               cmd.Stdin, err = os.Open(os.DevNull)
+               if err != nil {
+                       return
+               }
+       } else {
+               cmd.Stdin = os.Stdin
+       }
+
        cmd.Stderr = os.Stderr
        cmd.Env = shellEnv.ToGoEnv()
        cmd.Dir = wd
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/shell.go new/direnv-2.17.0/shell.go
--- old/direnv-2.15.2/shell.go  2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/shell.go  2018-06-17 17:20:25.000000000 +0200
@@ -43,6 +43,8 @@
                return TCSH
        case "json":
                return JSON
+       case "elvish":
+               return ELVISH
        }
 
        return nil
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/shell.nix new/direnv-2.17.0/shell.nix
--- old/direnv-2.15.2/shell.nix 1970-01-01 01:00:00.000000000 +0100
+++ new/direnv-2.17.0/shell.nix 2018-06-17 17:20:25.000000000 +0200
@@ -0,0 +1,16 @@
+{ pkgs ? import <nixpkgs> {} }:
+with pkgs;
+mkShell {
+  buildInputs = [
+    bashInteractive
+    elvish
+    fish
+    go
+    tcsh
+    zsh
+  ];
+
+  shellHook = ''
+    unset GOPATH
+  '';
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/shell_bash.go 
new/direnv-2.17.0/shell_bash.go
--- old/direnv-2.15.2/shell_bash.go     2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/shell_bash.go     2018-06-17 17:20:25.000000000 +0200
@@ -9,7 +9,7 @@
 const BASH_HOOK = `
 _direnv_hook() {
   local previous_exit_status=$?;
-  eval "$(direnv export bash)";
+  eval "$("{{.SelfPath}}" export bash)";
   return $previous_exit_status;
 };
 if ! [[ "$PROMPT_COMMAND" =~ _direnv_hook ]]; then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/shell_elvish.go 
new/direnv-2.17.0/shell_elvish.go
--- old/direnv-2.15.2/shell_elvish.go   1970-01-01 01:00:00.000000000 +0100
+++ new/direnv-2.17.0/shell_elvish.go   2018-06-17 17:20:25.000000000 +0200
@@ -0,0 +1,42 @@
+package main
+
+import (
+       "bytes"
+       "encoding/json"
+)
+
+type elvish struct{}
+
+var ELVISH = elvish{}
+
+func (elvish) Hook() (string, error) {
+       return `## hook for direnv
+@edit:before-readline = $@edit:before-readline {
+       try {
+               m = ("{{.SelfPath}}" export elvish | from-json)
+               keys $m | each [k]{
+                       if (==s $k 'null') {
+                               unset-env $k
+                       } else {
+                               set-env $k $m[$k]
+                       }
+               }
+       } except e {
+               echo $e
+       }
+}
+`, nil
+}
+
+func (sh elvish) Export(e ShellExport) string {
+       buf := new(bytes.Buffer)
+       err := json.NewEncoder(buf).Encode(e)
+       if err != nil {
+               panic(err)
+       }
+       return buf.String()
+}
+
+var (
+       _ Shell = (*elvish)(nil)
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/shell_fish.go 
new/direnv-2.17.0/shell_fish.go
--- old/direnv-2.15.2/shell_fish.go     2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/shell_fish.go     2018-06-17 17:20:25.000000000 +0200
@@ -11,7 +11,7 @@
 
 const FISH_HOOK = `
 function __direnv_export_eval --on-event fish_prompt;
-       eval (direnv export fish);
+       eval ("{{.SelfPath}}" export fish);
 end
 `
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/shell_tcsh.go 
new/direnv-2.17.0/shell_tcsh.go
--- old/direnv-2.15.2/shell_tcsh.go     2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/shell_tcsh.go     2018-06-17 17:20:25.000000000 +0200
@@ -10,7 +10,7 @@
 var TCSH tcsh
 
 func (f tcsh) Hook() (string, error) {
-       return "alias precmd 'eval `direnv export tcsh`' ", nil
+       return "alias precmd 'eval `{{.SelfPath}} export tcsh`'", nil
 }
 
 func (f tcsh) Export(e ShellExport) (out string) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/shell_zsh.go 
new/direnv-2.17.0/shell_zsh.go
--- old/direnv-2.15.2/shell_zsh.go      2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/shell_zsh.go      2018-06-17 17:20:25.000000000 +0200
@@ -7,7 +7,7 @@
 
 const ZSH_HOOK = `
 _direnv_hook() {
-  eval "$(direnv export zsh)";
+  eval "$("{{.SelfPath}}" export zsh)";
 }
 typeset -ag precmd_functions;
 if [[ -z ${precmd_functions[(r)_direnv_hook]} ]]; then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/stdlib.go new/direnv-2.17.0/stdlib.go
--- old/direnv-2.15.2/stdlib.go 2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/stdlib.go 2018-06-17 17:20:25.000000000 +0200
@@ -79,6 +79,15 @@
        "  type \"$1\" &>/dev/null\n" +
        "}\n" +
        "\n" +
+       "# Usage: join_args [args...]\n" +
+       "#\n" +
+       "# Joins all the passed arguments into a single string that can be 
evaluated by bash\n" +
+       "#\n" +
+       "# This is useful when one has to serialize an array of arguments back 
into a string\n" +
+       "join_args() {\n" +
+       "  printf '%q ' \"$@\"\n" +
+       "}\n" +
+       "\n" +
        "# Usage: expand_path <rel_path> [<relative_to>]\n" +
        "#\n" +
        "# Outputs the absolute path of <rel_path> relative to <relative_to> or 
the\n" +
@@ -229,7 +238,7 @@
        "}\n" +
        "\n" +
        "# Usage: direnv_load <command-generating-dump-output>\n" +
-       "#   e.g: direnv_load opam-env exec -- direnv dump\n" +
+       "#   e.g: direnv_load opam-env exec -- \"$direnv\" dump\n" +
        "#\n" +
        "# Applies the environment generated by running <argv> as a\n" +
        "# command. This is useful for adopting the environment of a child\n" +
@@ -238,12 +247,17 @@
        "#\n" +
        "direnv_load() {\n" +
        "  local exports\n" +
+       "  # backup and restore watches in case of nix-shell --pure\n" +
+       "  local __watches=$DIRENV_WATCHES\n" +
+       "\n" +
        "  exports=$(\"$direnv\" apply_dump <(\"$@\"))\n" +
        "  local es=$?\n" +
        "  if [[ $es -ne 0 ]]; then\n" +
        "    return $es\n" +
        "  fi\n" +
        "  eval \"$exports\"\n" +
+       "\n" +
+       "  export DIRENV_WATCHES=$__watches\n" +
        "}\n" +
        "\n" +
        "# Usage: PATH_add <path> [<path> ...]\n" +
@@ -638,20 +652,11 @@
        "# (e.g `use nix -p ocaml`).\n" +
        "#\n" +
        "use_nix() {\n" +
-       "  local orig_IN_NIX_SHELL=\"$IN_NIX_SHELL\"\n" +
-       "\n" +
-       "  direnv_load nix-shell --show-trace \"$@\" --run 'direnv dump'\n" +
+       "  direnv_load nix-shell --show-trace \"$@\" --run \"$(join_args 
\"$direnv\" dump)\"\n" +
        "  if [[ $# = 0 ]]; then\n" +
        "    watch_file default.nix\n" +
        "    watch_file shell.nix\n" +
        "  fi\n" +
-       "\n" +
-       "  # Don't change the IN_NIX_SHELL env var\n" +
-       "  if [[ -z $orig_IN_NIX_SHELL ]]; then\n" +
-       "    unset IN_NIX_SHELL\n" +
-       "  else\n" +
-       "    export IN_NIX_SHELL=\"$orig_IN_NIX_SHELL\"\n" +
-       "  fi\n" +
        "}\n" +
        "\n" +
        "# Usage: use_guix [...]\n" +
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/stdlib.sh new/direnv-2.17.0/stdlib.sh
--- old/direnv-2.15.2/stdlib.sh 2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/stdlib.sh 2018-06-17 17:20:25.000000000 +0200
@@ -77,6 +77,15 @@
   type "$1" &>/dev/null
 }
 
+# Usage: join_args [args...]
+#
+# Joins all the passed arguments into a single string that can be evaluated by 
bash
+#
+# This is useful when one has to serialize an array of arguments back into a 
string
+join_args() {
+  printf '%q ' "$@"
+}
+
 # Usage: expand_path <rel_path> [<relative_to>]
 #
 # Outputs the absolute path of <rel_path> relative to <relative_to> or the
@@ -227,7 +236,7 @@
 }
 
 # Usage: direnv_load <command-generating-dump-output>
-#   e.g: direnv_load opam-env exec -- direnv dump
+#   e.g: direnv_load opam-env exec -- "$direnv" dump
 #
 # Applies the environment generated by running <argv> as a
 # command. This is useful for adopting the environment of a child
@@ -236,12 +245,17 @@
 #
 direnv_load() {
   local exports
+  # backup and restore watches in case of nix-shell --pure
+  local __watches=$DIRENV_WATCHES
+
   exports=$("$direnv" apply_dump <("$@"))
   local es=$?
   if [[ $es -ne 0 ]]; then
     return $es
   fi
   eval "$exports"
+
+  export DIRENV_WATCHES=$__watches
 }
 
 # Usage: PATH_add <path> [<path> ...]
@@ -636,20 +650,11 @@
 # (e.g `use nix -p ocaml`).
 #
 use_nix() {
-  local orig_IN_NIX_SHELL="$IN_NIX_SHELL"
-
-  direnv_load nix-shell --show-trace "$@" --run 'direnv dump'
+  direnv_load nix-shell --show-trace "$@" --run "$(join_args "$direnv" dump)"
   if [[ $# = 0 ]]; then
     watch_file default.nix
     watch_file shell.nix
   fi
-
-  # Don't change the IN_NIX_SHELL env var
-  if [[ -z $orig_IN_NIX_SHELL ]]; then
-    unset IN_NIX_SHELL
-  else
-    export IN_NIX_SHELL="$orig_IN_NIX_SHELL"
-  fi
 }
 
 # Usage: use_guix [...]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/test/direnv-test.elv 
new/direnv-2.17.0/test/direnv-test.elv
--- old/direnv-2.15.2/test/direnv-test.elv      1970-01-01 01:00:00.000000000 
+0100
+++ new/direnv-2.17.0/test/direnv-test.elv      2018-06-17 17:20:25.000000000 
+0200
@@ -0,0 +1,138 @@
+#!/usr/bin/env elvish
+
+E:TEST_DIR = (path-dir (src)[path])
+E:PATH = (path-dir $E:TEST_DIR):$E:PATH
+
+cd $E:TEST_DIR
+
+## reset the direnv loading if any
+set-env DIRENV_CONFIG $pwd
+unset-env DIRENV_BASH
+unset-env DIRENV_DIR
+unset-env DIRENV_MTIME
+unset-env DIRENV_WATCHES
+unset-env DIRENV_DIFF
+
+set-env XDG_CONFIG_HOME $E:TEST_DIR
+mkdir -p $E:XDG_CONFIG_HOME/direnv
+touch $E:XDG_CONFIG_HOME/direnv/direnvrc
+
+fn direnv-eval {
+       try {
+               m = (direnv export elvish | from-json)
+               keys $m | each [k]{
+                       if (==s $k 'null') {
+                               unset-env $k
+                       } else {
+                               set-env $k $m[$k]
+                       }
+               }
+       } except e {
+               nop
+       }
+}
+
+fn test-debug {
+       if (==s $E:DIRENV_DEBUG "1") {
+               echo
+       }
+}
+
+fn test-eq [a b]{
+       if (!=s $a $b) {
+               fail "FAILED: '"$a"' == '"$b"'"
+       }
+}
+
+fn test-neq [a b]{
+       if (==s $a $b) {
+               fail "FAILED: '"$a"' != '"$b"'"
+       }
+}
+
+fn test-scenario [name fct]{
+       cd $E:TEST_DIR/scenarios/$name
+       direnv allow
+       test-debug
+       echo "\n## Testing "$name" ##"
+       test-debug
+
+       $fct
+
+       cd $E:TEST_DIR
+       direnv-eval
+}
+
+
+### RUN ###
+
+try {
+       direnv allow
+} except e {
+       nop
+}
+
+direnv-eval
+
+test-scenario base {
+       echo "Setting up"
+       direnv-eval
+       test-eq $E:HELLO "world"
+
+       E:WATCHES=$E:DIRENV_WATCHES
+
+       echo "Reloading (should be no-op)"
+       direnv-eval
+       test-eq $E:WATCHES $E:DIRENV_WATCHES
+
+       sleep 1
+
+       echo "Updating envrc and reloading (should reload)"
+       touch .envrc
+       direnv-eval
+       test-neq $E:WATCHES $E:DIRENV_WATCHES
+
+       echo "Leaving dir (should clear env set by dir's envrc)"
+       cd ..
+       direnv-eval
+       test-eq $E:HELLO ""
+}
+
+test-scenario inherit {
+       cp ../base/.envrc ../inherited/.envrc
+       direnv-eval
+       echo "HELLO should be world:"$E:HELLO
+       test-eq $E:HELLO "world"
+
+       sleep 1
+       echo "export HELLO=goodbye" > ../inherited/.envrc
+       direnv-eval
+       test-eq $E:HELLO "goodbye"
+}
+
+test-scenario "ruby-layout" {
+       direnv-eval
+       test-neq $E:GEM_HOME ""
+}
+
+test-scenario "space dir" {
+       direnv-eval
+       test-eq $E:SPACE_DIR "true"
+}
+
+test-scenario "child-env" {
+       direnv-eval
+       test-eq $E:PARENT_PRE "1"
+       test-eq $E:CHILD "1"
+       test-eq $E:PARENT_POST "1"
+       test-eq $E:REMOVE_ME ""
+}
+
+## TODO: special-vars
+## TODO: dump
+## TODO: empty-var
+## TODO: empty-var-unset
+
+test-scenario "missing-file-source-env" {
+       direnv-eval
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/version.go new/direnv-2.17.0/version.go
--- old/direnv-2.15.2/version.go        2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/version.go        2018-06-17 17:20:25.000000000 +0200
@@ -1,3 +1,3 @@
 package main
 
-const VERSION = "2.15.2"
+const VERSION = "2.17.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/direnv-2.15.2/version.txt 
new/direnv-2.17.0/version.txt
--- old/direnv-2.15.2/version.txt       2018-02-25 13:45:55.000000000 +0100
+++ new/direnv-2.17.0/version.txt       2018-06-17 17:20:25.000000000 +0200
@@ -1 +1 @@
-2.15.2
+2.17.0


Reply via email to