pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/46570: infelicities in pkglint



The following reply was made to PR pkg/46570; it has been noted by GNATS.

From: David Holland <dholland-pbugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/46570: infelicities in pkglint
Date: Sun, 22 Jul 2012 01:59:54 +0000

 On Tue, Jul 10, 2012 at 10:30:12AM +0000, Thomas Klausner wrote:
  >>  Not offhand, because I have been changing them when I find them.
  >>  However, you don't need an existing example; just take your favorite
  >>  test package and add this:
  >>  
  >>  post-install:
  >>    for x in foo bar baz; do \
  >>            ${INSTALL_PROGRAM} "$$x" ${DESTDIR}${PREFIX}/share; \
  >>    done
  >>  
  >>  then run pkglint -Wall. You will get:
  >>  
  >>  WARN: Makefile:37--39: Please switch to "set -e" mode before using a 
semicolon to separate commands.
  >>  
  >>  On reflection the warning may be coming from the ; before "done"
  >>  rather than the one before "do", but the shell won't accept && there
  >>  so it's still wrong.
  >  
  >  Actually, I like the warning.
  >  
  >  I prefer this behavior:
  >  
  >  set -e; for i in 1 2 3; do  echo $i;  false;  done
  >  1
  >  *** Error code 1
  >  
  >  to:
  >  
  >  for i in 1 2 3; do  echo $i;  false;  done
  >  1
  >  2
  >  3
  >  *** Error code 1
 
 Sure. But you may just get
 
 set -e; for i in 1 2 3; do  echo $i;  false;  done
 1
 2
 3
 
 depending on what's actually written in place of the "false". This is
 the same sh standards issue that causes some packages' build systems
 to not stop on error.
 
 The safest way to do this, AFAICT, is
 
 for i in 1 2 3; do  echo $i; false || exit 1; done
 
 pkglint doesn't recognize this idiom.
 
  >  I think I've addressed all your points. Anything else?
 
 I'm currently getting a lot of these Perl messages:
 
 Use of uninitialized value in concatenation (.) or string at 
/usr/pkg/bin/pkglint line 4776.
 
 also, I'm getting the following internal errors from pkglint:
 
 ERROR: emulators/cygwin_lib/Makefile:30--33: Internal pkglint error: 
SCST_CONT: rest= $${f%.exe}); done
 ERROR: fonts/jisx0212fonts/Makefile:29--31: Internal pkglint error: SCST_CONT: 
rest=$${f%.*}; done
 ERROR: games/kanatest/Makefile:21: Internal pkglint error: SCST_CONT: rest= 
$${a%.po}.mo $$a; done
 ERROR: inputmethod/uim/options.mk:162: Internal pkglint error: SWST_PLAIN: 
rest=\.png
 ERROR: lang/gcc3-ada/buildlink3.mk:24: Internal pkglint error: SWST_PLAIN: 
rest=\buildlink:buildlink/gcc3:
 ERROR: lang/gcc34-ada/buildlink3.mk:25: Internal pkglint error: SWST_PLAIN: 
rest=\buildlink:buildlink/gcc34-ada:
 ERROR: lang/swi-prolog-packages/Makefile:61--62: Internal pkglint error: 
SCST_ECHO: rest= $$! >${WRKDIR}/.Xvfb.pid
 ERROR: mail/cyrus-imapd/Makefile:166--173: Internal pkglint error: SWST_PLAIN: 
rest=\.conf
 ERROR: mail/cyrus-imapd/Makefile:166--173: Internal pkglint error: SWST_PLAIN: 
rest=\.conf
 ERROR: mail/cyrus-imapd23/Makefile:116--123: Internal pkglint error: 
SWST_PLAIN: rest=\.conf
 ERROR: mail/cyrus-imapd23/Makefile:116--123: Internal pkglint error: 
SWST_PLAIN: rest=\.conf
 ERROR: mail/cyrus-imapd24/Makefile:115--122: Internal pkglint error: 
SWST_PLAIN: rest=\.conf
 ERROR: mail/cyrus-imapd24/Makefile:115--122: Internal pkglint error: 
SWST_PLAIN: rest=\.conf
 ERROR: mail/dk-milter/Makefile:51--53: Internal pkglint error: SWST_PLAIN: 
rest=\/
 ERROR: mail/sendmail/Makefile:90--91: Internal pkglint error: SWST_PLAIN: 
rest=\/
 ERROR: mail/sendmail/Makefile:93--95: Internal pkglint error: SWST_PLAIN: 
rest=\/
 ERROR: mail/thunderbird/Makefile:78--83: Internal pkglint error: SCST_CONT: 
rest= '/^    <em:id>/ {sub(".*
 ERROR: mail/thunderbird10/Makefile:74--79: Internal pkglint error: SCST_CONT: 
rest= '/^    <em:id>/ {sub(".*
 ERROR: pkgtools/pkg_install/Makefile:197--202: Internal pkglint error: 
SCST_CONT: rest=$${f%%.[157]}.cat; done
 ERROR: sysutils/syslog-ng/Makefile:86--88: Internal pkglint error: SWST_PLAIN: 
rest=\
 ERROR: www/horde/Makefile:121--123: Internal pkglint error: SCST_CONT: 
rest=$${f%.dist}; done
 ERROR: www/seamonkey/Makefile:64--69: Internal pkglint error: SCST_CONT: rest= 
'/^    <em:id>/ {sub(".*
 
 
 some other stuff from the pkglint -r run:
 
 ERROR: x11/gtk+extra/buildlink3.mk:5: Package name mismatch between GTK_EXTRA 
...
 ERROR: x11/gtk+extra/buildlink3.mk:3: ... and gtk+extra.
 (this should be easy)
 
 ERROR: x11/py-wxWidgets/buildlink3.mk:5: Package name mismatch between 
PY_WXWIDGETS ...
 ERROR: x11/py-wxWidgets/buildlink3.mk:3: ... and ${PYPKGPREFIX}-wxWidgets.
 (I guess it'll need to know about PYPKGPREFIX and other multiversion prefixes)
 
 ERROR: print/teTeX3-bin/patches/patch-ab:69: This code must not be included in 
patches.
 (I have no idea what this warning is intended to mean or what's provoking it.)
 
 ERROR: lang/ruby/buildlink3.mk:14: There is no package in lang/${RUBY_BASE}.
 (is it too much to expect it to expand RUBY_BASE?)
 
 WARN: emulators/palmosemulator/Makefile:19: "${LP64PLATFORMS}" is not a valid 
platform triple.
 (it needs to know about this)
 
 WARN: security/ipsec-tools/Makefile:39: The user-defined variable VARBASE is 
used but not added to BUILD_DEFS.
 (surely VARBASE is in BUILD_DEFS by default?)
 
 WARN: graphics/gimp-fix-ca/Makefile:7: "&" is not a valid URL.
 WARN: graphics/gimp-fix-ca/Makefile:7: "id=9884" is not a valid URL.
 WARN: graphics/gimp-fix-ca/Makefile:7: "&" is not a valid URL.
 WARN: graphics/gimp-fix-ca/Makefile:7: "file=" is not a valid URL.
 (not clear why it's dicing up the url into substrings, but it's doing
 it wrong)
 
 WARN: lang/perl5/packlist.mk:76--81: "BEGIN { destdir = "${DESTDIR}"; 
gsub(/\/\//, "/", destdir); len_destdir = length(destdir); } { if (index($$1, 
destdir) == 1) $$1 = substr($$1, len_destdir + 1) }" is not a valid pathname.
 (why on earth does it expect this to be a pathname?)
 
 WARN: mail/mail-notification/Makefile:17: "./jb configure" is not a valid 
pathname.
 (it is, however, a valid thing to execute)
 
 WARN: net/uucp/Makefile:52: "/bin /usr/bin ${PREFIX}/bin" is not a valid 
pathname.
 (I guess it's latching onto these because the variable name contains "PATH"?)
 
 WARN: www/opera/Makefile:47: "x86_64" is not valid for EMUL_ARCH. Use one of { 
i386 none } instead.
 (guess it's out of date)
 
 WARN: archivers/unrar/Makefile:49: As .MAKEFLAGS is modified using "+=", its 
name should indicate plural.
 WARN: math/clisp-pari/Makefile:23: As ac_cv_libpari_libs is modified using 
"+=", its name should indicate plural.
 (but it does!)
 (this use of .MAKEFLAGS may be abusive, but that doesn't matter)
 
 WARN: shells/zsh/Makefile.common:92: CHECK_BUILTIN.curses is defined but not 
used. Spelling mistake?
 (pkglint should know about the CHECK_BUILTIN idiom)
 
 WARN: x11/gtk3/Makefile:66: Unknown compiler flag "-std=gnu99".
 WARN: audio/alsa-lib/Makefile:26: Unknown compiler flag "-std=c99".
 (surely it should know about these?)
 
 WARN: chat/pidgin-icb/Makefile:18: Compiler flag "`pkg-config pidgin 
--cflags`" does not start with a dash.
 WARN: chat/pidgin-icb/Makefile:19--20: Linker flag "`pkg-config pidgin 
--libs`" does not start with a dash.
 (and surely at this point it should be taught to recognize pkg-config)
 
 WARN: chat/p5-Net-Goofey/Makefile:19: "test" is not valid for 
INTERACTIVE_STAGE. Use one of { build configure extract fetch install } instead.
 (shouldn't this be legitimate?)
 
 WARN: mail/bulk_mailer/Makefile:17: Compiler flag "%s\"" does not start with a 
dash.
 (it's become confused by quoting)
 
 WARN: databases/py-cassa/Makefile:5: EGG_NAME is defined but not used. 
Spelling mistake?
 (why does it warn only here and not on every other Python module?)
 
 WARN: graphics/clutter/buildlink3.mk:17: Only buildlink variables for clutter, 
not MesaLib may be set in this file.
 (what it's doing is perfectly valid)
 
 WARN: graphics/libkipi-kde3/buildlink3.mk:8: Unknown dependency format: 
libkipi>=0.1.5<4.0
 (it appears to not understand all depends of this form)
 
 
 That's a bit more than I intended. Lots more where they came from though :-/
 
 and, btw, now at least I can do this without pkglint crashing, thanks.
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index