summaryrefslogtreecommitdiff
path: root/checkpkg.in
diff options
context:
space:
mode:
authorLevente Polyak <anthraxx@archlinux.org>2019-09-12 23:34:22 +0200
committerLevente Polyak <anthraxx@archlinux.org>2019-09-28 00:15:51 +0200
commit5dd90ef848e99e86601807fd829f6586dc2ab6fc (patch)
treefbb28253133d5f4b7e088c925005f0bde2504f08 /checkpkg.in
parent5246cb9aa5bdc390c793dc261b28f3439aaad4c0 (diff)
downloaddevtools-5dd90ef848e99e86601807fd829f6586dc2ab6fc.tar.xz
checkpkg: add option to print a warning in case of differences
Sometimes its desired to be explicitly made aware of differences reporter by checkpkg via printing a warning instead of a regular message. Automatically use --warn for makechrootpkg builds so packagers are made visibly aware of a soname bump by simply looking out for colors indicating non success messages. Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
Diffstat (limited to 'checkpkg.in')
-rw-r--r--checkpkg.in12
1 files changed, 9 insertions, 3 deletions
diff --git a/checkpkg.in b/checkpkg.in
index e3d2c16..374c004 100644
--- a/checkpkg.in
+++ b/checkpkg.in
@@ -35,14 +35,16 @@ usage() {
OPTIONS
-r, --rmdir Remove the temporary directory
+ -w, --warn Print a warning in case of differences
-h, --help Show this help text
_EOF_
}
RMDIR=0
+WARN=0
-OPT_SHORT='rh'
-OPT_LONG=('rmdir' 'help')
+OPT_SHORT='rwh'
+OPT_LONG=('rmdir' 'warn' 'help')
if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
exit 1
fi
@@ -53,6 +55,9 @@ while :; do
-r|--rmdir)
RMDIR=1
;;
+ -w|--warn)
+ WARN=1
+ ;;
-h|--help)
usage
exit 0
@@ -128,7 +133,8 @@ for _pkgname in "${pkgname[@]}"; do
find-libprovides "$TEMPDIR/$oldpkg" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname-old"
find-libprovides "$pkgfile" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname"
if ! diff_output="$(sdiff -s "$TEMPDIR/libraries-$_pkgname-old" "$TEMPDIR/libraries-$_pkgname")"; then
- msg "Sonames differ in $_pkgname!"
+ message="Sonames differ in $_pkgname!"
+ (( WARN )) && warning "$message" || msg "$message"
echo "$diff_output"
else
msg "No soname differences for %s." "$_pkgname"