Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
build zsh without wrapper scripts
Using a wrapper makes zsh login shells incorrectly detect that they are not a
login shell, which in turn breaks debugging with gdb (behaving as if “stty
tostop” was enabled).
  • Loading branch information
stapelberg committed Mar 17, 2020
1 parent e2c6f3f commit 3c3a9d6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions internal/build/build.go
Expand Up @@ -1372,10 +1372,15 @@ func (b *Ctx) Build(ctx context.Context, buildLog io.Writer) (*pb.Meta, error) {
} else {
oldname := filepath.Join(dir, fi.Name())

if b.Pkg == "bash" && (fi.Name() == "sh" || fi.Name() == "bash") {
if b.Pkg == "bash" && (fi.Name() == "sh" || fi.Name() == "bash") ||
b.Pkg == "zsh" && (fi.Name() == "zsh" || strings.HasPrefix(fi.Name(), "zsh-")) {
// prevent creation of a wrapper script for /bin/sh
// (wrappers execute /bin/sh) and /bin/bash (dracut uses
// /bin/bash) by using a symlink instead:
// /bin/bash) by using a symlink instead.
//
// zsh must not be wrapped, otherwise setting /bin/zsh as
// login shell results in shell instances which do not
// consider themselves to be a login shell.
oldname, err = filepath.Rel(filepath.Join(b.DestDir, b.Prefix, "bin"), oldname)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkgs/base-cloud/build.textproto
@@ -1,5 +1,5 @@
source: "empty://"
version: "1-14"
version: "1-15"

# This is the shortest and fastest way to build an empty package:
dep: "bash"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/base-full/build.textproto
@@ -1,5 +1,5 @@
source: "empty://"
version: "3-19"
version: "3-20"

# This is the shortest and fastest way to build an empty package:
dep: "bash"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/base-x11/build.textproto
@@ -1,5 +1,5 @@
source: "empty://"
version: "2-22"
version: "2-23"

# This is the shortest and fastest way to build an empty package:
dep: "bash"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/zsh/build.textproto
@@ -1,6 +1,6 @@
source: "https://repo.distr1.org/distri/jackherer/orig/zsh/zsh-5.6.2.tar.xz"
hash: "a50bd66c0557e8eca3b8fa24e85d0de533e775d7a22df042da90488623752e9e"
version: "5.6.2-7"
version: "5.6.2-8"

cbuilder: {
copy_to_builddir: true # TODO: patch Doc/Makefile.in to use $(sdir)/help.txt
Expand Down

0 comments on commit 3c3a9d6

Please sign in to comment.