Page MenuHomeFreeBSD

Check for shebang problems in all directories
AbandonedPublic

Authored by pizzamig on Dec 27 2016, 1:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 17 2024, 10:47 PM
Unknown Object (File)
Jan 14 2024, 5:56 PM
Unknown Object (File)
Dec 20 2023, 4:56 AM
Unknown Object (File)
Nov 9 2023, 1:31 PM
Unknown Object (File)
Nov 6 2023, 6:54 AM
Unknown Object (File)
Nov 6 2023, 5:22 AM
Unknown Object (File)
Oct 10 2023, 10:53 PM
Unknown Object (File)
Oct 10 2023, 10:53 PM

Details

Summary

In the past, I've fixed countless shebang problems, and most of
these were not detected by qa.sh because it's limited with a small
set of subdirectories. The practice shows that broken scripts may
be located anywhere, and still need shebang fixes.

Several examples are:

  • scripts called my an application internally, installed into ${DATADIR} or lib/${APP}
  • scripts for users to call, such as fcgi applications
  • example scripts installed into ${DOCSDIR} or ${EXAMPLESDIR} or sometimes into ${DATADIR}
  • more stranger cases I can't remember, including ports which install into ${PREFIX}/subdir

Some real pending problems:

http://poudriere.amdmi3.ru/data/11-amd64-default/all_2016_11_18/logs/errors/github-backup-utils-2.7.1.log
http://poudriere.amdmi3.ru/data/11-amd64-default/all_2016_11_18/logs/errors/ptkei-2.00.0.log
http://poudriere.amdmi3.ru/data/11-amd64-default/all_2016_11_18/logs/errors/resource-agents-3.9.7.log
http://poudriere.amdmi3.ru/data/11-amd64-default/all_2016_11_18/logs/errors/web2ldap-1.2.71.log
http://poudriere.amdmi3.ru/data/11-amd64-default/all_2016_11_18/logs/errors/p5-Term-ANSIColor-4.05.log
http://poudriere.amdmi3.ru/data/11-amd64-default/all_2016_11_18/logs/errors/hashcat-3.10.log
http://poudriere.amdmi3.ru/data/11-amd64-default/all_2016_11_18/logs/errors/glusterfs-3.7.6.log

So I suggest to remove limitation from qa.sh and check for shebang problems in whole ${PREFIX}.

There are some false positives, but these are mainly development
scripts which should not be installed in the first place - it'd be
nice to detect these by qa.sh as well.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

AMDmi3 retitled this revision from to Check for shebang problems in all directories.
AMDmi3 updated this object.
AMDmi3 edited the test plan for this revision. (Show Details)

Latest example: databases/cego which missed shebang fix for a tool script located in ${DATADIR}

I don't have any opinion on this, I'd like other portmgr members to pitch in.

Seems reasonable. I guess we need and exp-run and to fix up any issues it cases first.

Seems reasonable. I guess we need and exp-run and to fix up any issues it cases first.

Why? This produces non-fatal errors which will be eventually fixed by maintainers.

Sorry, you're right, exp-run isn't needed. So, looks fine to me.

This revision is now accepted and ready to land.Apr 10 2017, 1:05 PM
sunpoet added a subscriber: sunpoet.

IMHO, D8923 is aggressive as it blocks lots of ports with DEVELOPER=yes immediately.

Please consider reducing the impact.
Is it possible to treat invalid shebangs in:

  • {bin,sbin,libexec,www} as ERROR (the ports tree before D8923 landing)
  • Other directories as WARNING

In this way, maintainer and other committers get informed that some shebangs are needed to be fixed.
We also have more time to fix them before punishing people with DEVERLOPER=yes.

Please dont change it now, I have unlock most of the major ports already all lang/python* and lang/gcc* as example right now i am working on fixing clang* and llvm, after that is just small things left which needs another 2 to 3 days of work.

Thanks.

pizzamig added a reviewer: AMDmi3.
pizzamig added a subscriber: pizzamig.

Taking over, to clean it up.
Those changes landed already, so it's safe to close it

The proposed changes already landed.
It's safe to close it