brunelli / aurupbot

A script to automatically maintain your VCS-based AUR packages for you.
GNU General Public License v2.0
7 stars 1 forks source link

Different numbers of error and warnings on stdout and *_namcap.log files #7

Closed stefanhusmann closed 9 years ago

stefanhusmann commented 9 years ago

I have the following problem: For many of my packages aurupbot shows up wrong numpers of errors and warnings. For instance, processing my maxima-git PKGBUILD should result in 20 warnings (namcap tells me so, and the maxima-git_namcap.log file shows exactly the same), but stdout gives

==> Checking package with namcap Namcap returned 5 error(s) and 39 warning(s). See "/home/haawda/paketierung/meine_Pakete/maxima-git_namcap.log" for details.

and this is also the message brought up by my notification daemon dunst (but the same is for lxqt's notifier). My impression is that aurupbot sums up the numbers of errors when run with -u option, because often my emacs-lucid-git package comes first in the list of not-up-to-date packages, and it always throws 5 errors and some warnings, which I tolerate, because the emacs package in [extra] has the same issues. All other packages that follow also have 5 errors. The number of warnings vary, though, nevertheless being wrong.

stefanhusmann commented 9 years ago

aurupbot run for a single package works the way it should in this respect: [haawda@frege meine_Pakete]$ aurupbot texinfo-svn ==> Updating the AUR repository for texinfo-svn ==> Checking for pkgver() function ==> Getting sources texinfo-svn is out-of-date (6535 -> 6557). ==> Building package Successfully built. ==> Checking package with namcap Namcap returned 2 warning(s). See "/home/haawda/paketierung/meine_Pakete/texinfo-svn_namcap.log" for details. ==> Creating changelog from Subversion revisions Couldn't find the svn directory. ==> Pushing new version to AUR [master f995166] Updated version (6535 -> 6557). Author: AUR Update Bot stefan-husmann@t-online.de 2 files changed, 2 insertions(+), 2 deletions(-) To ssh://aur@aur.archlinux.org/texinfo-svn.git 4f9cf9a..f995166 master -> master

stefanhusmann commented 9 years ago

Currently I am testing this patch:

--- aurupbot.orig   2015-08-19 23:57:04.676801649 +0200
+++ aurupbot    2015-08-19 23:32:24.136953604 +0200
@@ -55,7 +55,7 @@
              cut -f 1 -d "=" --complement | tr -d \'\"\(\) )

   for P in $PKG ${PKGNAME[@]/$PKG}; do
-    namcap "$P-$NEW_PKGVER-*.pkg.tar.xz" >> "$2/${1}_namcap.log" 2>&1
+    namcap "$P-$NEW_PKGVER-*.pkg.tar.xz" > "$2/${1}_namcap.log" 2>&1
     NAMCAP_E=$(( $NAMCAP_E + $( grep -c "$P E:" "$2/${1}_namcap.log" ) ))
     NAMCAP_W=$(( $NAMCAP_W + $( grep -c "$P W:" "$2/${1}_namcap.log" ) ))
   done
@@ -69,6 +69,8 @@
     error_report "$1" "Namcap returned $NAMCAP_W warning(s)." \
                  "$2/${1}_namcap.log" "normal"
   fi
+  let NAMCAP_E=0
+  let NAMCAP_W=0
 }

But maybe it would also work to declare NAMCAP_E and NAMCAP_E local.

stefanhusmann commented 9 years ago

Sorry, the patch won't do it.

brunelli commented 9 years ago

Sorry, I updated it to support multiple packages recently and forgot that now I had to unset the variables. Last commit shoud fix it. Please reopen if it doesn't.

stefanhusmann commented 9 years ago

Sorry, the bug is not fixed yet.

brunelli commented 9 years ago

Are you sure? I don't have this problem here anymore and I can't see why this would be happenning now...

stefanhusmann commented 9 years ago

I think this is fixed, I guess I must have done something wrong with copy-and-pasting the aurupbot script from githubs web interface. To investigate the other issue I now wrote a PKGBUILD for aurupbot-git, and that works.

brunelli commented 9 years ago

Okay... Thanks for the feedback!

I'll release v1.3 as soon as I fix #9 and add colors.