Update main.sh

This commit is contained in:
ferreo 2024-08-04 17:33:06 +02:00
parent 0c36ba6ce9
commit 2e62406bf5

15
main.sh
View File

@ -17,8 +17,19 @@ awk '
BEGIN { RS=""; ORS="\n\n"; FS="\n"; OFS="\n" } BEGIN { RS=""; ORS="\n\n"; FS="\n"; OFS="\n" }
{ {
if ($1 ~ /^Build-Depends:/) { if ($1 ~ /^Build-Depends:/) {
gsub(/(^|,)[[:space:]]*(cargo|rustc|rust-all)([[:space:]]*,|[[:space:]]*$)/, "", $1) split($1, parts, ":")
gsub(/,[[:space:]]*$/, "", $1) deps = parts[2]
gsub(/^[[:space:]]+|[[:space:]]+$/, "", deps)
split(deps, items, ",")
new_deps = ""
for (i in items) {
gsub(/^[[:space:]]+|[[:space:]]+$/, "", items[i])
if (items[i] != "cargo" && items[i] != "rustc" && items[i] != "rust-all") {
if (new_deps != "") new_deps = new_deps ", "
new_deps = new_deps items[i]
}
}
$1 = "Build-Depends:\n " new_deps
} }
print print
}' ./debian/control > ./debian/control.tmp && mv ./debian/control.tmp ./debian/control }' ./debian/control > ./debian/control.tmp && mv ./debian/control.tmp ./debian/control