From 5dd90ef848e99e86601807fd829f6586dc2ab6fc Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Thu, 12 Sep 2019 23:34:22 +0200 Subject: 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 --- checkpkg.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'checkpkg.in') 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" -- cgit v1.2.3-54-g00ecf