Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#21408 - [namcap] Comments are reported as errors in PKGBUILD

Attached to Project: Arch Linux
Opened by Kurt Marasco (celilo) - Friday, 22 October 2010, 03:02 GMT
Last edited by Dan McGee (toofishes) - Tuesday, 07 December 2010, 23:12 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: running "namcap PKGBUILD" reports error, "E: File referenced in $startdir" for lines in the package build that are commented by a preceeding "#"

Steps to reproduce: Run namecap on file with comment line containing an improper reference such as:

# install -D -m755 ${startdir}/freeswitchd $pkgdir/etc/rc.d/freeswitchd
# install -D -m755 $startdir/freeswitch $pkgdir/etc/rc.d/freeswitch
# mv $pkgdir/usr/freeswitch/conf $pkgdir/usr/freeswitch/conf.sample
install -D -m755 $startdir/freeswitch $pkgdir/etc/rc.d/freeswitch

The error is reported for all three commented lines. namcap does not report erros after removing the commented lines from the PKGBUILD.

While this matters little for a final PKGBUILD, which would be free of such comments, it can result in lost productivity searching for errors that do not actually exist in a PKGBUILD.

This task depends upon

Closed by  Dan McGee (toofishes)
Tuesday, 07 December 2010, 23:12 GMT
Reason for closing:  Won't implement
Comment by Dan McGee (toofishes) - Monday, 25 October 2010, 18:36 GMT
I'm not sure how "searching for errors" can take you more than three seconds in this case, and it still makes no sense to refer to startdir in comments.
Comment by Kurt Marasco (celilo) - Tuesday, 26 October 2010, 02:24 GMT
I think that this may be an issue of misinterpreting the error message, rather than a problem of finding errors in comments. The current error, "E: File referenced in $startdir" can be interpreted as the build system not allowing files to be in the $start directory, when, in fact, it is simply indicating $startdir is not a valid variable. As such namcap correctly flags any line containing $startdir.

This is a change to the PKGBUILD structure, which is why I misinterpreted the error. PKGBUILD removed $startdir as a valid variable, yet it still interprets it without reporting an error, I'm sure this was done as to not break existing PKGBUILDS.

Perhaps a simple solution would be to simply change the error to indicate that "$startdir is no longer a valid PKGBUILD variable", which would point package builders in the correct direction of using something like "../", to reference to their root build directory.

Comment by Dan McGee (toofishes) - Tuesday, 26 October 2010, 02:28 GMT
OK, so it was unclear what the error message was trying to say- I can try and fix that up.

And your last comment is completely wrong- that is less correct than using $startdir. You should almost never ever have to reference the root build directory...do you have some valid reason for doing so?
Comment by Kurt Marasco (celilo) - Tuesday, 26 October 2010, 02:43 GMT
If I want to add a script to start a daemon in /etc/rc.d. I have been including the file in the root of my build and then using the install command to move it into /etc/rc.d in the $pkg directory. How should I be doing this?

Thanks.
Comment by Kurt Marasco (celilo) - Tuesday, 26 October 2010, 02:53 GMT
Never mind. I see that the build sytem creates symlinks in the $srcdir back to these files. The moral of the story is to make sure that the first time that you build a package, use a build from core as a sample template. Just because something else works, doesn't mean that it's right!

Thanks,
Kurt

Loading...