Skip to content

Commit 0f466cd

Browse files
committed
fix(pkgs/mole): patch bash arithmetic bug and update to v1.27.0
Fix upstream bug where ((var++)) with var=0 returns exit code 1, causing early script termination with set -e. Transform to : $((var++)) which always succeeds.
1 parent bf50f55 commit 0f466cd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkgs/darwin/mole-bin/package.nix

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,21 @@
66
}:
77
stdenvNoCC.mkDerivation (finalAttrs: {
88
pname = "mole";
9-
version = "1.25.0";
9+
version = "1.27.0";
1010

1111
src = fetchFromGitHub {
1212
owner = "tw93";
1313
repo = "Mole";
1414
rev = "V${finalAttrs.version}";
15-
hash = "sha256-THZHQUE3l1G4U6eoY4/CPt7auyqs0eGP8+uHFpZrfNs=";
15+
hash = "sha256-7a5oQfJJIESjit+gl7FrbkT5wptxBhhWuTLCpULlQ6w=";
1616
};
1717

18+
# Fix bash arithmetic bug: ((var++)) returns exit code 1 when var=0
19+
# which causes early exit with set -e. Using : $((var++)) always succeeds.
20+
postPatch = ''
21+
find . -name '*.sh' -exec sed -i 's/((\([a-z_]*\)++))/: $((\1++))/g' {} +
22+
'';
23+
1824
dontBuild = true; # No need to build, all scripts are in the source
1925

2026
installPhase = ''

0 commit comments

Comments
 (0)