Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/prune-kernel-headers-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ before=$(grep -rlE '/home/[a-z]+/' "$hdrs" 2>/dev/null | wc -l)
removed=0
while IFS= read -r f; do rm -f "$f"; removed=$((removed+1)); done < <(find "$hdrs/scripts/mod" -maxdepth 1 -name '*.s' 2>/dev/null)
[ "$removed" -gt 0 ] || { echo "nothing to prune (no scripts/mod/*.s) - refusing to rewrite the package" >&2; exit 5; }
# dpkg writes this file with paths relative to the package root and no "./" prefix; a leading "./" is not the format
# (caught in review of #1501, where it merged anyway), so strip it rather than emit a file dpkg's own tools parse oddly.
rm -f "$work/pkg/DEBIAN/md5sums"
( cd "$work/pkg" && find . -path ./DEBIAN -prune -o -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums )
( cd "$work/pkg" && find . -path ./DEBIAN -prune -o -type f -print0 | xargs -0 md5sum | sed 's|^\([0-9a-f]*\) \./|\1 |' > DEBIAN/md5sums )
after=$(grep -rlE '/home/[a-z]+/' "$hdrs" 2>/dev/null | wc -l)
dpkg-deb --root-owner-group -b "$work/pkg" "$OUT" >/dev/null || { echo "repack failed" >&2; exit 6; }
echo "pruned $removed file(s) from $(basename "$hdrs")"
Expand Down
Loading