Skip to content

Commit

Permalink
Remove unneeded set -eux in debian strategies (google#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbxyz authored Feb 12, 2025
1 parent 22de5d4 commit 6c57e47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
3 changes: 0 additions & 3 deletions pkg/rebuild/debian/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ var toolkit = []*flow.Tool{
Name: "debian/fetch/sources",
Steps: []flow.Step{{
Runs: textwrap.Dedent(`
set -eux
wget {{.With.dscUrl}}
{{- if ne .With.nativeUrl "" }}
wget {{.With.nativeUrl}}
Expand All @@ -93,7 +92,6 @@ var toolkit = []*flow.Tool{
Name: "debian/deps/install",
Steps: []flow.Step{{
Runs: textwrap.Dedent(`
set -eux
apt update
apt install -y{{range $req := .With.requirements | fromJSON}} {{$req}}{{end}}`)[1:],
Needs: []string{},
Expand All @@ -103,7 +101,6 @@ var toolkit = []*flow.Tool{
Name: "debian/build/package",
Steps: []flow.Step{{
Runs: textwrap.Dedent(`
set -eux
cd */
debuild -b -uc -us
{{- $expected := regexReplace .With.targetPath "\\+b[0-9]+(_[^_]+\\.deb)$" "$1"}}
Expand Down
27 changes: 9 additions & 18 deletions pkg/rebuild/debian/strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,14 @@ func TestDebianPackage(t *testing.T) {
},
env: rebuild.BuildEnv{},
want: rebuild.Instructions{
Source: `set -eux
wget https://example.com/pkg_1.0-1.dsc
Source: `wget https://example.com/pkg_1.0-1.dsc
wget https://example.com/pkg_1.0.orig.tar.gz
wget https://example.com/pkg_1.0-1.debian.tar.xz
dpkg-source -x --no-check $(basename "https://example.com/pkg_1.0-1.dsc")`,
Deps: `set -eux
apt update
Deps: `apt update
apt install -y build-dep1 build-dep2`,
Build: `set -eux
cd */
Build: `cd */
debuild -b -uc -us`,
SystemDeps: []string{"wget", "git", "build-essential", "fakeroot", "devscripts"},
OutputPath: "pkg_1.0-1_amd64.deb",
Expand All @@ -80,16 +77,13 @@ debuild -b -uc -us`,
},
env: rebuild.BuildEnv{},
want: rebuild.Instructions{
Source: `set -eux
wget https://example.com/pkg_1.0.dsc
Source: `wget https://example.com/pkg_1.0.dsc
wget https://example.com/pkg_1.0.tar.gz
dpkg-source -x --no-check $(basename "https://example.com/pkg_1.0.dsc")`,
Deps: `set -eux
apt update
Deps: `apt update
apt install -y build-dep1`,
Build: `set -eux
cd */
Build: `cd */
debuild -b -uc -us`,
SystemDeps: []string{"wget", "git", "build-essential", "fakeroot", "devscripts"},
OutputPath: "pkg_1.0_amd64.deb",
Expand Down Expand Up @@ -119,17 +113,14 @@ debuild -b -uc -us`,
},
env: rebuild.BuildEnv{},
want: rebuild.Instructions{
Source: `set -eux
wget https://example.com/pkg_1.0-1.dsc
Source: `wget https://example.com/pkg_1.0-1.dsc
wget https://example.com/pkg_1.0.orig.tar.gz
wget https://example.com/pkg_1.0-1.debian.tar.xz
dpkg-source -x --no-check $(basename "https://example.com/pkg_1.0-1.dsc")`,
Deps: `set -eux
apt update
Deps: `apt update
apt install -y`,
Build: `set -eux
cd */
Build: `cd */
debuild -b -uc -us
mv /src/pkg_1.0-1_amd64.deb /src/pkg_1.0-1+b1_amd64.deb`,
SystemDeps: []string{"wget", "git", "build-essential", "fakeroot", "devscripts"},
Expand Down

0 comments on commit 6c57e47

Please sign in to comment.