Commit graph

75 commits

Author SHA1 Message Date
Antoine Brodin
fd76fd9625 - During makeplist, emit only empty directories inside prefix and
directories outside prefix
- Whitelisting orphan directories not starting with / is no longer necessary
- Adjust missing directories check to use a list of all directories instead
  of the dirs from make-plist

Differential Revision:	https://reviews.freebsd.org/D1101
Reviewed by:	bapt
With hat:	portmgr
2014-11-05 07:14:21 +00:00
Alex Kozlov
6107ede2ac - Accept absolute path for @fc, @fontsdir, @fcfontsdir, @shell keywords
Approved by:	portmgr (antoine, bapt)
Differential Revision:	https://reviews.freebsd.org/D721
2014-10-08 21:39:47 +00:00
Antoine Brodin
df3c805917 info keyword now handles full paths
With hat:	portmgr
2014-10-08 06:19:54 +00:00
Antoine Brodin
82646f1abd Replace @dirrm/@dirrmtry with @dir in makeplist and leftovers check
Differential Revision:	https://reviews.freebsd.org/D901
Reviewed by:	bapt
With hat:	portmgr
2014-10-06 19:17:22 +00:00
Bryan Drewery
32852abae0 - Allow LINUXBASE for shebangs.
PR:		193878
Submitted by:	Jan Beich <jbeich@vfemail.net>
With hat:	portmgr
2014-10-03 18:47:47 +00:00
Bryan Drewery
63fc9a3edb check-plist no longer needs to check for directories owned by dependencies.
pkg-1.3.8's auto directory handling makes this a non-issue.

We should add a new check to warn of possibly needing @dir for empty dirs
though.

With hat:	portmgr
2014-10-03 18:22:46 +00:00
Bryan Drewery
36716bd31e Garbage collect dependency mtree check removed in r368803 2014-10-03 18:14:18 +00:00
Antoine Brodin
68bcf28124 Do not report directories in plist as orphans
With hat:	portmgr
2014-09-22 07:53:57 +00:00
Baptiste Daroussin
cdc718adfc adjust check_stagedir.sh to take in account %%KEY%%@dirrm* 2014-09-22 06:22:56 +00:00
Baptiste Daroussin
6423d85837 Update to 1.3.8 Changes:
- Plist parser do not accept modes like o+w g+s u+r
- @owner/@group with no argument reset the default ownership to root/wheel
- Plug regression tests into the release mechanism as mandatory
- Allow url in repository configuration to be overriden by another configuration
  file
- If one of -P, -I or -R is not explicitly given on the command line do not emit
  error messages while searching for a mechanism to find data about the latest
  available ports.
- External keywords can now take arguments
- Directories under PREFIX are automatically handled and removed if needed
- MTREE are not packaged anymore neither extracted on final installation
- OS major checking (to determine if pkg is running on an upgraded base system)
  uses the same mechanism as ABI detection instead of relying on UNAME_r which
  can have false positivie on jails
- Add @dir keyword for plist which is used to package explicitly directories
  (directories with non root/wheel or outside prefix) and empty directories
  (@dirrm and @dirrmtry are now considered as deprecated)
- root/wheel are now considered as the default user/group when creating a
  package except @owner/@group are used to change that behaviour
- Import newer version of libucl which improves error messages in case of
  problem parsing manifest or configuration files
- Fix pkg register so it checks for conflicts before actually copying files on
  to the filesystem
- pkg now support a new no_provide_lib annotation to preventing automatic
  populating of provided libs (useful for packages bundling libraries like wine)
- Improve documentations
- Ability to select usage of IPv4/IPv6 via config, repository config or command
  line
- Lots of bug fixes

Side effects:
- Convert to install-mtree target into a no-op target Add empty directories to
  plist of ports that needs them to run:
- share/aclocal to devel/automake and devel/automake14
- share/applications to devel/desktop-file-utils
- share/xml share/sgml to textproc/xmlcatmgr
- Prevent check-plist to issue warnings about some @dir*
- Adjist check_leftovers.sh to not take in account anything related to mtree
- Bump the default required version of pkg to 1.3.8
2014-09-22 05:47:32 +00:00
Antoine Brodin
8c8d939697 Fix typo
With hat:	portmgr
2014-09-17 19:02:59 +00:00
Tijl Coosemans
fad34ea21f Turn the installation of *.la files, without some form of USES=libtool in
the port Makefile, into a stage-qa error.  All ports that would trigger
this error have been converted.  Many thanks to all people involved in
this, especially Dmitry Marakasov (amdmi3) who handled most ports.

At this moment over 2200 ports have USES=libtool and over 20000 library
dependencies between packages have been removed.

This also marks the point where :keepla is no longer special.  It is now
only needed if a port uses *.la files at run-time.

QA-run by:	antoine
Approved by:	portmgr (antoine)
2014-09-15 18:23:21 +00:00
Antoine Brodin
fbcb1bc222 Make check-stagedir.sh aware of (owner,group,perm) syntax for keywords
Differential Revision:	https://reviews.freebsd.org/D712
Reviewed by:	bapt
With hat:	portmgr
2014-09-02 14:36:29 +00:00
Antoine Brodin
26222800aa - Make it possible to use sample keyword with a full path
- Prefer @dirrmtry over @unexec rmdir in makeplist

Differential Revision:	https://reviews.freebsd.org/D705
Reviewed by:	bapt
With hat:	portmgr
2014-09-01 17:06:19 +00:00
Baptiste Daroussin
d96aa38d95 Remove support for pkg_install
Merge back bsd.pkgng.mk into bsd.port.mk
Add a note about @stopdaemon not being supported anymore

With hat:	portmgr
Differential Revision:	https://reviews.freebsd.org/D693
2014-09-01 13:03:25 +00:00
Antoine Brodin
8ffd5fe7a8 Ignore references to stagedir in .fmt and .log files generated for tex formats
Those are harmless (records from which file they were generated from) and
removing them would require ugly hacks according to hrs@

PR:		ports/192933
Differential Revision:	https://reviews.freebsd.org/D684
Reviewed by:	bapt, hrs
With hat:	portmgr
2014-08-30 08:55:57 +00:00
Antoine Brodin
4d04df1859 Check that the plist doesn't reference the stage dir during stage-qa
====> Running Q/A tests (stage-qa)
Error: '/usr/ports/www/claroline/work/.PLIST.mktmp' is referring to /usr/ports/www/claroline/work/stage
*** Error code 1

Differential Revision: https://reviews.freebsd.org/D685
Reviewed by:	bdrewery
With hat:	portmgr
2014-08-25 22:10:42 +00:00
Bryan Drewery
3777dc8252 - Add the same workaround for ignoring PREFIX/info removal when PREFIX !=
LOCALBASE, as check-stagedir has.

With hat:	portmgr
2014-08-19 14:36:49 +00:00
Antoine Brodin
4451bbef17 Advise trying INSTALL_TARGET=install-strip before ${STRIP_CMD}
Phabric:	D477
Reviewed by:	bdrewery
With hat:	portmgr
2014-08-17 17:48:26 +00:00
Bryan Drewery
759281b0d7 - Fix 'make check-plist' incorrectly considering all installed packages as
run dependencies if the port being checked has no RUN_DEPENDS. This could
  cause false-positive "Possibly owned by dependency" warnings.

With hat:	portmgr
2014-08-11 20:20:23 +00:00
Bryan Drewery
deff4ba4c7 - Fix check-plist so that its 'files in plist but missing from STAGEDIR' check
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
2014-07-24 21:03:10 +00:00
Antoine Brodin
57abe3e15a Do not report parent directories of LOCALBASE as orphans
Reported and tested by:	gerald
With hat:	portmgr
2014-06-30 22:26:51 +00:00
Antoine Brodin
b06fe94540 Do not report files @commented by multiple options as orphans
With hat:	portmgr
2014-06-20 21:07:30 +00:00
Rene Ladan
3143a73f6d Mk/Scripts/qa.sh: add /bin/tcsh as a valid shebang.
Phabric:	D231
Approved by:	portmgr (antoine)
2014-06-17 14:33:53 +00:00
Daichi GOTO
af01be4cba fix a typo 2014-06-13 10:30:45 +00:00
Baptiste Daroussin
2bacde9c3b Add an @shell keyword to handle adding and remove a shell path in /etc/shell
Bump port revision of all ports that were doing it wrong prior to the keyword

CR:		D208
Reviewed by:	antoine
With hat:	portmgr
2014-06-11 17:42:36 +00:00
Antoine Brodin
4c05fc29da Add more files to orphans white list:
- .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
2014-05-19 16:09:00 +00:00
Bryan Drewery
e380c31a46 - %D is based on @cwd, not PREFIX; Fix false-postives when using pkg_install
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
2014-05-18 01:51:43 +00:00
Bryan Drewery
2387ec96ea - Fix check-plist showing @sample dest files as orphans and also showing in
makeplist.

Reported by:	droso
With hat:	portmgr
2014-05-16 17:21:44 +00:00
Bryan Drewery
94ec4229c2 - Move security-check.awk to Mk/Scripts where it is more proper these days.
With hat:	portmgr
2014-05-09 22:35:50 +00:00
Bryan Drewery
1d6dc187d6 - Fix regression handling files with spaces from r350006.
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
2014-05-09 22:29:30 +00:00
Tijl Coosemans
e9ccd0e2a8 Let stage-qa detect .la libraries and warn that a port needs USES=libtool.
PR:		ports/189255
Approved by:	portmgr (antoine)
2014-05-06 11:57:22 +00:00
Bryan Drewery
009875f080 - Ignore MTREE owned PREFIX and PREFIX/info removal for now.
The removal of PREFIX/info may be a bug in bsd.port.mk and needs
  more testing.

With hat:	portmgr
Reported by:	gerald
2014-05-04 03:09:58 +00:00
Bryan Drewery
f6add42b9a - Always ignore /root/.ccache. Missed with r352918
With hat:	portmgr
2014-05-04 03:08:38 +00:00
Bryan Drewery
779bba4486 - Fix check-stagedir causing staging violating. Quote all directory names
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
2014-04-24 22:42:06 +00:00
Bryan Drewery
eacc5a1959 - Fix false-positive orphanned dir when '@unexec rmdir -p' is used.
Reported by:	antoine
With hat:	portmgr
2014-04-24 22:31:24 +00:00
Bryan Drewery
821e60e4cc - Refactor a bit into functions
With hat:	portmgr
2014-04-24 22:30:05 +00:00
Bryan Drewery
4541c779c7 check-plist: Don't error if GNOME_MTREE_FILE is missing, which can happen
in nox11 ports that USE_GNOME.

With hat:	portmgr
Reported by:	swills
2014-04-24 12:00:27 +00:00
Antoine Brodin
a373437d73 - Handle plist containing @unexec /bin/rmdir
- Handle directories ending with digits

With hat:	portmgr
2014-04-23 20:46:45 +00:00
Bryan Drewery
3964423d4f - Fix handling of "@comment @cwd" so it does not reset real @cwd; only
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
2014-04-22 23:28:27 +00:00
Antoine Brodin
fc05fd3aae Fix directory keywords handling
Reviewed by:	bdrewery
With hat:	portmgr
2014-04-22 14:11:48 +00:00
Bryan Drewery
a12e34d03e - For pkg run-depends dir listing, consider deps recursively.
pkg_install already did this.
- Speedup the pkg_install run-depends listing by processing unique
  packages.

With hat:	portmgr
Reported by:	antoine
2014-04-22 12:56:13 +00:00
Antoine Brodin
4053a4a28f Fill orphans white list with files regenerated by installation scripts:
- info directories
- fonts.dir and fonts.scale
- desktop database
- mime database

With hat:	portmgr
2014-04-21 22:08:32 +00:00
Antoine Brodin
a45906707f - Do not advise to strip non FreeBSD binaries [1]
- Shorten messages

Requested and tested by:	xmj [1]
With hat:	portmgr
2014-04-21 20:17:00 +00:00
Bryan Drewery
b8334287c4 - Split MTREE check into its own check
- 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
2014-04-21 18:42:15 +00:00
Bryan Drewery
e81c57a53d - Sort directories by Lexicographical Depth-First order (find -ds)
With hat:	portmgr
2014-04-21 16:22:20 +00:00
Antoine Brodin
5be1bc5fe0 Fix plist_sub_sed_sort.sh when value contains spaces 2014-04-20 23:47:25 +00:00
Bryan Drewery
e15449a9ef - Rename check-orphans to check-plist. Keep the old for backwards-compat.
- 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.
2014-04-19 06:44:56 +00:00
Bryan Drewery
193b6cc6d8 - Fix HOMEDIR handling to not exclude all directories for ports without USERS
Reported by:	antoine
With hat:	portmgr
2014-04-17 14:45:49 +00:00
Bryan Drewery
e0e4f6e0e6 - Document PLIST_SUB_SED= will disable PLIST_SUB hints
- Avoid a redundant 'test -d'
- Properly show %%PORTEXAMPLES%% %%PORTDOCS%% where needed
- Avoid some forking for always-ignored files

With hat:	portmgr
2014-04-17 14:42:44 +00:00