Skip to content

Commit 23e2eec

Browse files
committed
fix(deb): use more precise method to extract version from Cargo.toml
Replace grep/sed with awk to specifically target [workspace.package] section for version extraction
1 parent 529e1b7 commit 23e2eec

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

debian/rules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ VENDOR_DIR = $(CURDIR)/vendor
99
USE_OFFLINE = $(shell test -d $(VENDOR_DIR) && echo "--offline")
1010

1111
# Extract version from Cargo.toml
12-
VERSION = $(shell grep -m 1 '^version =' Cargo.toml | sed 's/version = "//' | sed 's/"//')
12+
# Use awk to find version under [workspace.package] section
13+
VERSION = $(shell awk '/\[workspace\.package\]/{f=1} f && /^version = \"/{gsub(/[^0-9.]/, "", $$3); print $$3; exit}' Cargo.toml)
1314

1415
%:
1516
dh $@

0 commit comments

Comments
 (0)