aboutsummaryrefslogtreecommitdiff
path: root/Mk/Scripts
Commit message (Collapse)AuthorAgeFilesLines
* - Fix check-plist so that its 'files in plist but missing from STAGEDIR' checkBryan Drewery2014-07-241-5/+12
| | | | | | | | | | | | does not incorrectly ignore plist items in %%DOCSDIR%% and %%EXAMPLESDIR%%. It was incorrectly ignoring these items when %%PORTDOCS%% or %%PORTEXAMPLES%% was missing. This manifested as a failure in 'make package' later when pkg(8) detected the missing files. With hat: portmgr Notes: svn path=/head/; revision=362849
* Do not report parent directories of LOCALBASE as orphansAntoine Brodin2014-06-301-0/+8
| | | | | | | | Reported and tested by: gerald With hat: portmgr Notes: svn path=/head/; revision=359935
* Do not report files @commented by multiple options as orphansAntoine Brodin2014-06-201-1/+1
| | | | | | | With hat: portmgr Notes: svn path=/head/; revision=358638
* Mk/Scripts/qa.sh: add /bin/tcsh as a valid shebang.Rene Ladan2014-06-171-0/+1
| | | | | | | | Phabric: D231 Approved by: portmgr (antoine) Notes: svn path=/head/; revision=358122
* fix a typoDaichi GOTO2014-06-131-1/+1
| | | | Notes: svn path=/head/; revision=357663
* Add an @shell keyword to handle adding and remove a shell path in /etc/shellBaptiste Daroussin2014-06-111-1/+1
| | | | | | | | | | | Bump port revision of all ports that were doing it wrong prior to the keyword CR: D208 Reviewed by: antoine With hat: portmgr Notes: svn path=/head/; revision=357511
* Add more files to orphans white list:Antoine Brodin2014-05-191-0/+7
| | | | | | | | | | | | | | | | - .DS_Store files - some VCS related files Note: it's still recommended to not extract/install those files if they are not needed PR: ports/189859 Submitted by: adamw (first version) Reviewed by: bapt With hat: portmgr Notes: svn path=/head/; revision=354552
* - %D is based on @cwd, not PREFIX; Fix false-postives when using pkg_installBryan Drewery2014-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and @cwd has changed away from PREFIX: plist: @cwd / @dirrmtry var/spool/dma ====> Checking for pkg-plist issues (check-plist) ===> Parsing plist DIR '/usr/local/etc/dma' CWD: /usr/local DIR '/usr/local/var/spool/dma' CWD: DIR 'share/licenses/dma-v0.9,1' CWD: /usr/local DIR '/usr/local/share/licenses' CWD: /usr/local ===> Checking for items in STAGEDIR missing from pkg-plist Error: Orphaned: @unexec rmdir "/var/spool/dma" >/dev/null 2>&1 || : ===> Checking for directories owned by MTREEs ===> Checking for directories handled by dependencies ===> Checking for items in pkg-plist which are not in STAGEDIR Error: Missing: @dirrmtry var/spool/dma ===> Error: Plist issues found. With hat: portmgr Reported by: erwin Notes: svn path=/head/; revision=354382
* - Fix check-plist showing @sample dest files as orphans and also showing inBryan Drewery2014-05-161-1/+8
| | | | | | | | | | makeplist. Reported by: droso With hat: portmgr Notes: svn path=/head/; revision=354246
* - Move security-check.awk to Mk/Scripts where it is more proper these days.Bryan Drewery2014-05-091-0/+100
| | | | | | | With hat: portmgr Notes: svn path=/head/; revision=353534
* - Fix regression handling files with spaces from r350006.Bryan Drewery2014-05-091-21/+40
| | | | | | | | | | | | | | | Separate file(1) and stat(1) output by a newline and read each line individually to avoid losing spaces. - Use <<-EOF with heredocs to avoid bad indent - Add some more comments - Quote filenames in output so it is less unclear Spotted by: mandree Reviewed by: antoine With hat: portmgr Notes: svn path=/head/; revision=353532
* Let stage-qa detect .la libraries and warn that a port needs USES=libtool.Tijl Coosemans2014-05-061-1/+12
| | | | | | | | PR: ports/189255 Approved by: portmgr (antoine) Notes: svn path=/head/; revision=353084
* - Ignore MTREE owned PREFIX and PREFIX/info removal for now.Bryan Drewery2014-05-041-1/+11
| | | | | | | | | | | The removal of PREFIX/info may be a bug in bsd.port.mk and needs more testing. With hat: portmgr Reported by: gerald Notes: svn path=/head/; revision=352937
* - Always ignore /root/.ccache. Missed with r352918Bryan Drewery2014-05-041-1/+1
| | | | | | | With hat: portmgr Notes: svn path=/head/; revision=352936
* - Fix check-stagedir causing staging violating. Quote all directory namesBryan Drewery2014-04-241-2/+5
| | | | | | | | | | | | when doing plist checks. This could leak out if an unsupported format was used such as 'rmdir -p' or 'rmdir dir1 dir2 dir3' With hat: portmgr Reported by: antoine Pointyhat to: bdrewery Notes: svn path=/head/; revision=352075
* - Fix false-positive orphanned dir when '@unexec rmdir -p' is used.Bryan Drewery2014-04-241-3/+3
| | | | | | | | Reported by: antoine With hat: portmgr Notes: svn path=/head/; revision=352074
* - Refactor a bit into functionsBryan Drewery2014-04-241-234/+290
| | | | | | | With hat: portmgr Notes: svn path=/head/; revision=352073
* check-plist: Don't error if GNOME_MTREE_FILE is missing, which can happenBryan Drewery2014-04-241-1/+1
| | | | | | | | | | in nox11 ports that USE_GNOME. With hat: portmgr Reported by: swills Notes: svn path=/head/; revision=351996
* - Handle plist containing @unexec /bin/rmdirAntoine Brodin2014-04-231-5/+5
| | | | | | | | | - Handle directories ending with digits With hat: portmgr Notes: svn path=/head/; revision=351974
* - Fix handling of "@comment @cwd" so it does not reset real @cwd; onlyBryan Drewery2014-04-221-7/+37
| | | | | | | | | | | change the cwd for commented lines (such as %%OPTION%%file). Reset it back to the normal on the first non-commented line. - Sort files after stripping out @comment With hat: portmgr Notes: svn path=/head/; revision=351888
* Fix directory keywords handlingAntoine Brodin2014-04-221-1/+1
| | | | | | | | Reviewed by: bdrewery With hat: portmgr Notes: svn path=/head/; revision=351838
* - For pkg run-depends dir listing, consider deps recursively.Bryan Drewery2014-04-221-7/+21
| | | | | | | | | | | | pkg_install already did this. - Speedup the pkg_install run-depends listing by processing unique packages. With hat: portmgr Reported by: antoine Notes: svn path=/head/; revision=351830
* Fill orphans white list with files regenerated by installation scripts:Antoine Brodin2014-04-211-1/+16
| | | | | | | | | | | | - info directories - fonts.dir and fonts.scale - desktop database - mime database With hat: portmgr Notes: svn path=/head/; revision=351726
* - Do not advise to strip non FreeBSD binaries [1]Antoine Brodin2014-04-211-4/+4
| | | | | | | | | | - Shorten messages Requested and tested by: xmj [1] With hat: portmgr Notes: svn path=/head/; revision=351707
* - Split MTREE check into its own checkBryan Drewery2014-04-211-5/+17
| | | | | | | | | | | | | | | | | | | | | | - Split dependency-owned check its own and make into a non-fatal warning. This is not black-and-white. Python/Rubygem ports cleanup the lib dir for every installed package, and for python/ruby-gems too. This is fine, the extensions should not clean them up then; the error is valid here. However, there's other frameworks which don't cleanup in the master package and yield unexpected results. An example is that php does not cleanup etc/php itself. Only extensions do. So if an extension depends on another extension it will complain that the dependent extension owns etc/php, so we remove from bsd.php.mk, now it's a leftover. The proper place is in the php port itself, but it's unknown how many other cases there are like this. So for now make this non-fatal and into a warning. This is all mostly moot once pkg auto handles directories anyhow. With hat: portmgr Discussed with: antoine Notes: svn path=/head/; revision=351701
* - Sort directories by Lexicographical Depth-First order (find -ds)Bryan Drewery2014-04-211-7/+27
| | | | | | | With hat: portmgr Notes: svn path=/head/; revision=351693
* Fix plist_sub_sed_sort.sh when value contains spacesAntoine Brodin2014-04-201-1/+1
| | | | Notes: svn path=/head/; revision=351658
* - Rename check-orphans to check-plist. Keep the old for backwards-compat.Bryan Drewery2014-04-193-47/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Bug fixes: makeplist/check-plist: - Fix showing directories owned by RUN_DEPENDS/LIB_DEPENDS [1] - Use proper "rmdir PATH" syntax, not "rmdir >/dev/null... PATH" which pkg will not recognize. - Never consider base /etc/mtree/BSD.usr.dist or LOCLABASE Templates/BSD.local.dist as needing @dirrm handling. check-plist: - Fix showing PORTDOCS/PORTEXAMPLES files when the OPTIONS are not set. makeplist will still suggest them. - Fix showing files installed through unselected OPTIONS as orphans, by considering "@comment file" to be ignored. [2] - Fix @sample, @fc, @fcfontsdir, @fontsdir support - Fix return status when orphans are found to be non-zero - Add note when PREFIX=!LOCALBASE - Be more clear when orphans/no orphans are found. - Add a whitelist mechanism for globally approved ignores. - Add *.bak/*.orig to orphan whitelist for now. - Fix false-positive with dirs installed to /, such as with archivers/dpkg creating /var/db/dpkg - Fix false-positive with @dirrm ending in /, such as with ports-mgmt/poudriere with a @dirrmtry share/zsh/ - There are likely still some false-positives. I fixed as many as I could find. Please let me know of others. * One in particular that is not easily fixable is installing a file into a directory owned by another port where that other port is not a run-time dependency. So the leaf port may create all of the parent dirs and never clean them up. Cleaning them up is not proper unless no other package is depending on them. This will be addressed by pkg(8) once pkg_install is EOL, or sooner. - Consider @dirrm of directories owned by run-time dependencies, or /etc/mtree/* or Templates/BSD.local.dist (at LOCALBASE) as fatal errors. These should not be removed in the plist. @comment lines are not considered for this; they will not ignore an error. ===> Checking for directories owned by dependencies or MTREEs Error: Owned by dependency: @dirrmtry share/locale/af/LC_MESSAGES Error: Owned by dependency: @dirrmtry share/locale/af Error: Owned by dependency: @dirrmtry %%PERL5_MAN3%% - Detect files in plist that do not exist in the stagedir. Pkgng already did this, but now we have it unified with this check. @comment lines are not considered for this; they will not ignore an error. ===> Checking for items in pkg-plist which are not in STAGEDIR Error: Missing: foo Error: Missing: @dirrmtry bar - Change orphaned output due to several new errors introduced: ===> Checking for items in STAGEDIR missing from pkg-plist Error: Orphaned: foo - Send errors to stderr check_leftovers.sh: - Prefer longer values for PLIST_SUB. bsd.options.mk: - Fix NOPORTDOCS/WITHOUT_NLS/NOPORTEXAMPLES not unsetting their respective OPTIONS. - Mark NOPORTDOCS/NOPORTEXAMPLES deprecated and hook them into the OPTIONS_WARNING to tell users the new format. - check-stagedir.sh refactoring: - Switch to using new PLIST_SUB_SED - Use ! instead of , in sed(1) regex to allow files/dirs with ',' - Rework PORTEXAMPLES/PORTDOCS handling so it acts on PLIST_SUB_SED'd value and not absolutes. Also simplify the regex for these a bit to allow reuse. - No longer need DOCSDIRS/EXAMPLESDIR in env - Wrap long lines - Unset some vars in env when they are done being used to free space for larger sed vars - Cleanup redundant sed regexes - Add a Scripts/plist_sub_sed_sort.sh to prefer longer values when substituting over shorter values. - To make check-plist ignore a file *as an orphan* do one of the following: 1. Install it 2. post-install: ${RM} ${STAGEDIR}file 3. Put the file behind an OPTION with a PLIST_SUB: %%OPTION%%file 4. Add to plist as a @comment [2]: @comment file @comment @dirrmtry dir Reviewed by: mat (much earlier version) Discussed with: mat, antoine, bapt, swills (various bits) With hat: portmgr PR: ports/185561 [1] Reported By: Alexander Yerenkow <yerenkow@gmail.com> [1] Tested with: pkg and pkg_install Reported by: many (false-positives) [2] This is a partial solution, we may still need a plist.ignore too. It doesn't make much sense to add files in main pkg-plist we don't care about, but maybe it does since you'll see and reconsider them being ignored someday. @comment is used as all the OPTION PLIST_SUB deactivations use @comment instead of something like @ignore. Notes: svn path=/head/; revision=351587
* - Fix HOMEDIR handling to not exclude all directories for ports without USERSBryan Drewery2014-04-171-1/+1
| | | | | | | | Reported by: antoine With hat: portmgr Notes: svn path=/head/; revision=351480
* - Document PLIST_SUB_SED= will disable PLIST_SUB hintsBryan Drewery2014-04-171-6/+21
| | | | | | | | | | | - Avoid a redundant 'test -d' - Properly show %%PORTEXAMPLES%% %%PORTDOCS%% where needed - Avoid some forking for always-ignored files With hat: portmgr Notes: svn path=/head/; revision=351479
* - Add script for handling leftover processing by poudriere/tinderbox.Bryan Drewery2014-04-171-0/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will contain all approved/whitelisted leftovers in a single reference. It will also allow us to update the whitelist without needing a new release of poudriere/tinderbox and forcing users to update those tools. Usage: env PORTSDIR=... check_leftovers.sh category/port stdin: - missing-file + new-file M modified-file reason... stdout: same -/+/M format, but with files substituted, without approved whitelisted files, and hides any directories already in plist. - Add /var/qmail/queue to the list of whitelisted directories just as /var/mail is. This queue directory contains mails in flight and may receive or have mail removed during an upgrade. Obtained from: Mostly poudriere Reviewed by: antoine With hat: portmgr Notes: svn path=/head/; revision=351446
* Do not advise to strip ELF relocatables, usually it is harmfulAntoine Brodin2014-04-121-1/+3
| | | | | | | With hat: portmgr Notes: svn path=/head/; revision=351133
* Reduce the number of false positives reported by the shebang qa checkAntoine Brodin2014-04-121-19/+45
| | | | | | | | | | by looking only at files and symlinks in bin, sbin and libexec Reviewed by: bdrewery With hat: portmgr Notes: svn path=/head/; revision=351132
* - Make shebang a warning for now, too many false-positives in files weBryan Drewery2014-04-111-2/+2
| | | | | | | | | | | do not care about. antoine@ is working on a better solution for this. With hat: portmgr Notes: svn path=/head/; revision=350959
* Allow to properly run make check-orphans and make makeplist for gnome portsBaptiste Daroussin2014-04-101-1/+5
| | | | Notes: svn path=/head/; revision=350822
* Rewrite the sharedmimeinfo qa check so that it doesn't produce a falseAntoine Brodin2014-04-081-4/+11
| | | | | | | | | | positive on misc/shared-mime-info With help from: bdrewery With hat: portmgr Notes: svn path=/head/; revision=350634
* - stage-qa: Fix absolute symlink check to look at target not fully resolvedBryan Drewery2014-04-031-1/+1
| | | | | | | | | | | path. Now tested on both good and bad symlinks. Reported by: antoine Pointyhat to: bdrewery With hat: portmgr Notes: svn path=/head/; revision=350013
* - Fix fatal checks not exiting with non-zero [1]Bryan Drewery2014-04-031-16/+46
| | | | | | | | | | | | | | | This means that files referrencing stagedir or linked to stagedir will now be fatal errors as intended. - Stop polluting global namespace with IFS changes - Speedup find(1) -exec usage by execing far less - Ignore known false-positive/harmless stagedir files in paths() [2] Reported by: eadler [1] Discussed with: antoine [2] With hat: portmgr Notes: svn path=/head/; revision=350006
* Remove quotes around values we get in PLIST_SUB. [1]Mathieu Arnold2014-02-241-2/+2
| | | | | | | | | | While there, don't replace 1 char entries in PLIST_SUB. Noticed by: amdmi3 [1] Sponsored by: Absolight Notes: svn path=/head/; revision=345877
* Try and force people to check the plist makeplist generates.Mathieu Arnold2014-02-101-0/+1
| | | | | | | | | With hat: portmgr Reviewed by: bapt Sponsored by: Absolight Notes: svn path=/head/; revision=343607
* - Do not check for ${WRKDIR} in staged files, there are lots of falseAntoine Brodin2014-01-281-7/+5
| | | | | | | | | | | positives as some .o files may embed the source path [1] - Only check shebang of files with executable bit set Requested by: bapt [1] With hat: portmgr Notes: svn path=/head/; revision=341664
* Greatly enhance makeplist to replace all it can find in PLIST_SUB.Mathieu Arnold2014-01-281-4/+17
| | | | | | | | With hat: portmgr Sponsored by: Absolight Notes: svn path=/head/; revision=341573
* Do not show orphans anymore with pkgng for .info filesBaptiste Daroussin2014-01-271-0/+5
| | | | Notes: svn path=/head/; revision=341366
* Fix paths check from qa.shAntoine Brodin2014-01-091-2/+1
| | | | | | | | | IFS is set to newline so dirs was not correctly splitted Approved by: portmgr (bapt) Notes: svn path=/head/; revision=339268
* pkgng expect all non ascii code and '%' to be urlencoded in the commentBaptiste Daroussin2014-01-061-0/+23
| | | | | | | | Reported by: antoine Tested by: antoine Notes: svn path=/head/; revision=338956
* /usr/bin/nawk and /bin/csh are valid shebangsBaptiste Daroussin2013-12-061-0/+2
| | | | Notes: svn path=/head/; revision=335787
* Fixup makeplist for directories.Mathieu Arnold2013-11-291-1/+1
| | | | | | | | | | | | | | Without, it'll generate : @dirrmtry %%PORTDOCS%%%%DOCSDIR%% With : %%PORTDOCS%%@dirrmtry %%DOCSDIR%% PR: ports/184287 Submitted by: mat Approved by: bapt Notes: svn path=/head/; revision=335192
* - in qa.sh, properly work with filenames containing blank or tab,Matthias Andree2013-11-232-10/+15
| | | | | | | | | | | | | | | | by setting IFS to just LF - in check-stagedir.sh, properly detect unset environmental variables, and list them all - in check-stagedir.sh, also list the full prefix as known, not just its parents PR: 184039 Approved by: portmgr (bapt) Notes: svn path=/head/; revision=334663
* bsd.stage.mk: Fewer false positives, much faster, easier maintenance.Matthias Andree2013-10-312-2/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bugfixes: * @cmd in pkg-plist is now properly handled. - It was previously treated the same as though there was a directory following it, missing the prefix. (ordering matters in case...esac) - Due to the cwd=${PREFIX} inside the while read line loop, state tracking was broken and every new line assumed that cwd were the prefix. * stage-qa no longer complains about unstripped binaries if debugging is active (WITH_DEBUG set && WITHOUT_DEBUG unset). * The compress-man target uses ECHO_MSG, not ECHO_CMD, to print its build step. Additions: * The plist parser now understands @unexec rmdir ... || ... lines, including those with redirections, so that there are no false positives for directories stripped with @unexec rmdir (usually happens on stuff installed outside $PREFIX, as in /var). * The system's root and var mtrees are now also expanded to avoid false @dirrm positives if a port installs directories under /var and has to create parents in the stagedir that are present in a fully installed system (i. e. in the real $PREFIX). * Given that pkg_create is deemed beyond repair with respect to deleting files outside prefix, generate @unexec rmdir statements for such directories, rather than @dirrmtry, to sidestep the problem. Speedups: * the orphan check now generates sorted lists of staged files, and plisted/mtree files, and compares them with comm(1). This saves us the overhead of running one grep process per file and up to two per directory, and defers the actual list processing to a shell utility. Complexity has not changed, but overhead per item has. * the orphan check now uses one file for directories and one file for files mentioned in pkg-plist, so we need not decorate them with "dir " and parse them out any longer. * qa.sh's shebang scanner only looks at the first line of a file, sed is told to exit from the 2nd line. Other Changes: * Split the makeplist/check-orphans logic out of bsd.stage.mk, it is too unwieldy to maintain in make-escaped shell syntax, and permits shell tracing with "SH=sh -x" (including quotes!) * Unify the functions "makeplist" and "check-orphans" in one script. The only difference is that makeplist assumes an empty pkg-plist, whereas check-orphans parses it. * overhaul the mtree extractor, avoiding awk. Reviewed by: bapt Approved by: portmgr (bapt) Notes: svn path=/head/; revision=332275
* - Add check for suid files and directoriesAlex Kozlov2013-10-201-1/+12
| | | | | | | Approved by: portmgr (bapt) Notes: svn path=/head/; revision=331046