gitlab-shell: Split patch into ruby and go parts
Split the remove-hardcoded-locations patch into two separate patches, one for the ruby package and one for the go package. This is clearer and results in fewer rebuilds.
This commit is contained in:
@@ -1,69 +0,0 @@
|
||||
diff --git a/go/internal/config/config.go b/go/internal/config/config.go
|
||||
index f951fe6..b422fe3 100644
|
||||
--- a/go/internal/config/config.go
|
||||
+++ b/go/internal/config/config.go
|
||||
@@ -3,7 +3,6 @@ package config
|
||||
import (
|
||||
"io/ioutil"
|
||||
"net/url"
|
||||
- "os"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
@@ -30,16 +29,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("/run/gitlab/shell-config.yml")
|
||||
}
|
||||
|
||||
func (c *Config) FeatureEnabled(featureName string) bool {
|
||||
diff --git a/lib/gitlab_keys.rb b/lib/gitlab_keys.rb
|
||||
index 0600a18..c46f2d7 100644
|
||||
--- a/lib/gitlab_keys.rb
|
||||
+++ b/lib/gitlab_keys.rb
|
||||
@@ -10,7 +10,7 @@ class GitlabKeys # rubocop:disable Metrics/ClassLength
|
||||
attr_accessor :auth_file, :key
|
||||
|
||||
def self.command(whatever)
|
||||
- "#{ROOT_PATH}/bin/gitlab-shell #{whatever}"
|
||||
+ "/run/current-system/sw/bin/gitlab-shell #{whatever}"
|
||||
end
|
||||
|
||||
def self.command_key(key_id)
|
||||
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
|
||||
index 2cb76a8..f59ad5e 100644
|
||||
--- a/lib/gitlab_shell.rb
|
||||
+++ b/lib/gitlab_shell.rb
|
||||
@@ -190,7 +190,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!
|
||||
+ Kernel.exec(env, *args, unsetenv_others: true)
|
||||
end
|
||||
|
||||
def api
|
||||
diff --git a/go/internal/command/fallback/fallback.go b/go/internal/command/fallback/fallback.go
|
||||
index 2cb76a8..f59ad5e 100644
|
||||
--- a/go/internal/command/fallback/fallback.go
|
||||
+++ b/go/internal/command/fallback/fallback.go
|
||||
@@ -53,5 +53,5 @@
|
||||
func (c *Command) fallbackProgram() string {
|
||||
fileName := fmt.Sprintf("%s-ruby", c.Executable.Name)
|
||||
|
||||
- return filepath.Join(c.RootDir, "bin", fileName)
|
||||
+ return filepath.Join("/run/current-system/sw/bin", fileName)
|
||||
}
|
||||
Reference in New Issue
Block a user