From 293a631081baf9a5973e2583f4602512bfcb6c5f Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 23 Nov 2018 15:29:38 +0100 Subject: [PATCH] gitlab-shell: 8.3.3 -> 8.4.1 --- .../gitlab/gitlab-shell/default.nix | 4 +- .../remove-hardcoded-locations.patch | 42 +++++++++++++------ 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix b/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix index 69c4b9a255e3..c9f21047e5b6 100644 --- a/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix +++ b/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix @@ -1,14 +1,14 @@ { stdenv, ruby, bundler, fetchFromGitLab, go }: stdenv.mkDerivation rec { - version = "8.3.3"; + version = "8.4.1"; name = "gitlab-shell-${version}"; src = fetchFromGitLab { owner = "gitlab-org"; repo = "gitlab-shell"; rev = "v${version}"; - sha256 = "1qapw0yvlw1nxjik7jpbbbl3yx299sfvdx67zsd5ai7bhk1gd8xl"; + sha256 = "00jzrpdfqgrba2qi5ngc0g07p7gmip7my563hw542gg8l88d27xq"; }; buildInputs = [ ruby bundler go ]; diff --git a/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch b/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch index 38181399eec8..6d29f5f9e6c5 100644 --- a/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch +++ b/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch @@ -1,23 +1,41 @@ diff --git a/go/internal/config/config.go b/go/internal/config/config.go -index c57b4de..88cfc95 100644 +index 435cb29..078c1df 100644 --- a/go/internal/config/config.go +++ b/go/internal/config/config.go -@@ -27,7 +27,7 @@ func New() (*Config, error) { - } - cfg.RootDir = dir +@@ -2,7 +2,6 @@ package config -- configBytes, err := ioutil.ReadFile(path.Join(cfg.RootDir, configFile)) -+ configBytes, err := ioutil.ReadFile("/run/gitlab/shell-config.yml") - if err != nil { - return nil, err - } + import ( + "io/ioutil" +- "os" + "path" + + yaml "gopkg.in/yaml.v2" +@@ -26,16 +25,13 @@ type Config struct { + } + + func New() (*Config, error) { +- dir, err := os.Getwd() +- if err != nil { +- return nil, err +- } ++ dir := "/run/gitlab" + + return NewFromDir(dir) + } + + func NewFromDir(dir string) (*Config, error) { +- return newFromFile(path.Join(dir, configFile)) ++ return newFromFile(path.Join(dir, "shell-config.yml")) + } + + func newFromFile(filename string) (*Config, error) { diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb -index 1452f95..2b40327 100644 +index 57c70f5..700569b 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb -@@ -180,7 +180,8 @@ class GitlabShell - end +@@ -187,7 +187,8 @@ class GitlabShell # rubocop:disable Metrics/ClassLength + args = [executable, gitaly_address, json_args] # We use 'chdir: ROOT_PATH' to let the next executable know where config.yml is. - Kernel.exec(env, *args, unsetenv_others: true, chdir: ROOT_PATH) + # Except we don't, because we're already in the right directory on nixos!