99-pkglint-subpkgs: replace grep with case..esac
On experience with 100 subpkgs, this change reduces execution time from 284ms to 4ms Closes: #27137 [via git-merge-pr]
This commit is contained in:
parent
a2186e18f5
commit
bd62ff8580
1 changed files with 9 additions and 5 deletions
|
@ -38,13 +38,17 @@ hook() {
|
||||||
/subpackages/s/.*"//p
|
/subpackages/s/.*"//p
|
||||||
s/".*//p
|
s/".*//p
|
||||||
}' $XBPS_SRCPKGDIR/$pkgname/template |
|
}' $XBPS_SRCPKGDIR/$pkgname/template |
|
||||||
tr ' ' '\n' | sort)"
|
tr '\v\t\r\n' ' ')"
|
||||||
|
|
||||||
for s in $subpkgs; do
|
for s in $subpkgs; do
|
||||||
grep -q "^$s$" <<< "$matches" ||
|
case " $matches " in
|
||||||
msg_warn "${s}_package() defined but will never be built.\n"
|
*" $s "*) ;;
|
||||||
|
*) msg_warn "${s}_package() defined but will never be built.\n" ;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
grep -q "^$pkgname$" <<< "$matches" &&
|
case " $matches " in
|
||||||
msg_warn "$pkgname is sourcepkg but is in subpackages=.\n" || :
|
*" $pkgname "*)
|
||||||
|
msg_warn "$pkgname is sourcepkg but is in subpackages=.\n" ;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue