Commit graph

148 commits

Author SHA1 Message Date
rillig
1a7d02851e Improved a comment. 2006-11-11 23:08:00 +00:00
rillig
d9096da9ad Fixed the warning from GNU awk that in strings, \$ is the same as a
plain $.
2006-11-10 08:17:06 +00:00
rillig
1a51080155 Refined the pattern for lines containing bad macros. White-space is
allowed between the "#" and the "define", and the value must be of the
form "${varname}/...", that is, starting with a double quote, followed
by "${" and a variable name, and directly behind the closing brace must
be a slash. This should catch most false positives while still being
useful.
2006-11-10 07:59:01 +00:00
rillig
d43645467b Added documentation. 2006-11-09 21:29:26 +00:00
rillig
05707c80dc This is also an FAQ of autoconf, so provide a link to there. 2006-11-09 21:07:25 +00:00
rillig
0a17361ac7 Documented the ksh-compatible form of the SKIP_FILTER. 2006-11-09 15:12:46 +00:00
rillig
a226b89651 Added a little comment.
The program now exits with the correct exit status in case of errors.
2006-11-09 15:12:15 +00:00
rillig
085172dcd3 Greatly simplified the code and added documentation. 2006-11-09 15:10:16 +00:00
rillig
e49f88c9ef Fixed the SKIP_FILTER command so that NetBSD's ksh can handle it as well. 2006-11-09 14:41:18 +00:00
rillig
ffe459f4de Rewrote check-portability in awk instead of shell, since the shell has a
huge performance problem: When reading files, it calls read(2) for every
single byte. awk instead reads a whole line at a time. For the lang/php5
package, the execution time changed from (7.8 real 4.5 user 3.1 sys) to
(1.6 real 1.5 user 0.4 sys).
2006-11-09 14:36:18 +00:00
rillig
24675f34ff Added a function cs_explain() to check-subr.sh that prints an
explanation for an error message, nicely formatted.

Added explanations for the checks in check-portability.sh.
2006-11-09 10:52:21 +00:00
rillig
649c0754d5 Added another sentence that explains how to disable this check for
individual files.
2006-11-09 10:31:54 +00:00
rillig
3dfe0787ed Added an explanation how to fix the errors reported by this check. 2006-11-09 10:26:50 +00:00
rillig
c4cb1de1ee Made the code simpler. 2006-11-09 09:51:46 +00:00
rillig
3911155e2f Moved the portability checks from the configure/ directory to checks/,
since according to the comment in check/bsd.check.mk, they belong there.

Added a new check for all C and C++ header files to make sure they don't
contain strings like ${prefix} or ${exec_prefix}, which is currently a
problem with sysutils/dbus and has been noticed in PR 35019. This check
is disabled by default since I don't know anything about possible false
positives, but I plan to enable it for PKG_DEVELOPERs after some
testing.

Added two names for hooks that are placed in the configure and in the
build phase. Now the checks look more like becoming something one could
call a framework, sharing a common structure and a documented interface.
2006-11-09 02:53:15 +00:00
joerg
144c44a4ac Look into DESTDIR when checking for WRKDIR references. 2006-11-05 14:46:50 +00:00
rillig
74d127ee88 Adjusted the check-perms target to the recent update of
sysutils/checkperms.

Regular files are now checked if they needlessly have the executable bit
set.
2006-11-02 02:44:17 +00:00
rillig
ce502552c2 Moved the check whether checkperms(1) exists from load time to run time. 2006-10-21 11:13:10 +00:00
seb
24fa002d66 Since 2006/10/09 the ${PLIST} file does not contain the full
pathnames anymore. Therefore cd to ${PREFIX} to correctly resolve
the relative pathnames.

While here unbreak CHECK_WRKREF for another reason:
Append to ${ERROR_DIR}/${.TARGET} otherwise the "_NONZERO_FILESIZE_P"
check is always false...
2006-10-16 19:02:53 +00:00
rillig
20d92f3be1 Added a new post-installation check to see whether the files have their
permissions properly set. See mk/check/check-perms.mk and
sysutils/checkperms for details.
2006-10-13 06:32:15 +00:00
joerg
72cf605c7c s/LOCALBASE/PREFIX/, but thanks for catching this. 2006-10-10 13:01:26 +00:00
rillig
4fb63bd4af Since a few hours, the .PLIST file does not contain the full pathnames
anymore. Therefore, cd to ${LOCALBASE} to correctly resolve the relative
pathnames.
2006-10-09 23:06:48 +00:00
joerg
5b374e445d Main infrastructure for DESTDIR support.
Packages may set PKG_DESTDIR_SUPPORT to either "destdir" or
"user-destdir" to flag support for this, following the same
rules as PKG_INSTALLATION_TYPES (e.g. define before first include
of bsd.prefs.mk).

The user activates it via USE_DESTDIR. When set to "yes",
packages with "user-destdir" are handled as "destdir".
The installation of the package will not go to ${LOCALBASE},
but a subdirectory of ${WRKDIR} instead. pre/post install scripts are
not run and the package is not registered either. A binary package
can be created instead to be installed normally with pkg_add.

For "user-destdir" packages, everything is run as normal user and
ownership is supposed to be correctled by pkg_create later. Since
the current pkg_install code uses pax and it doesn't allow overwriting
owners, this does not work yet.

For "destdir" packages, installation, packaging and cleaning is run as
root.

This commit does not change the handling of DEPENDS_TARGET or
bin-install to allow recursive usage.
2006-10-09 12:25:44 +00:00
joerg
7545d135e6 - Compute CHEKCK_FILES filter on the entries requested and keep it
as tight as possible. Files we don't handle shouldn't be skipped.
- fonts.alias is not created automatically, so don't remove it.
- create fonts.encoding with mkfontdir using -e X11_ENCODINGSDIR.
  On platforms not following the X11R6 loayout this might need to
  be overriden.
- Fix type1inst calls.
- Modify packages which installed fonts.alias before to actually
  include it in the PLIST and bump the revisions accordingly.
- Modify xorg-fonts* packages to use FONTS_DIRS.* to build indices
  at run time.

Discussed with wiz and jlam.
2006-09-22 21:53:56 +00:00
joerg
86ec0977ff Also ignore fontconfig cache like the "clasic" databases. 2006-09-17 17:02:38 +00:00
rillig
5fbbc4d343 Bugfix: Missing shared libraries are reported again. This feature had been
broken since the introduction of delayed errors and warnings.
2006-09-14 22:00:49 +00:00
joerg
5c0a40494e Avoid spurious false negatives when the directories are reordered
during install phase by sorting explicitly.
2006-08-22 18:50:56 +00:00
heinz
37b9df590f Fixed default path wildcards for CHECK_INTERPRETER_SKIP. Now they
actually apply to the whole subtree.
2006-07-13 19:07:54 +00:00
jlam
990d0b5377 Make the check-vulnerable target more self-sufficient, by moving some
of the logic from fetch/fetch.mk into flavor/pkg/check.mk, so that
check-vulnerable can be used as a source target.

Make check-vulnerable a source target for every phase of the build
workflow, which ensures that it is always run if the user starts a
new phase from the command line.

Fix the cookie-generation targets so that they don't append, only
overwrite to the cookie file.  This works around potential problems
due to recursive makes.

Move the cookie checks so that they surround the corresponding phase
target.  The presence of the cookie should now inform the make process
to avoid doing any processing of phases that occur before the phase
corresponding to the cookie.
2006-07-05 09:08:35 +00:00
rillig
a5906ce386 Moved the command that generates the list of files to its own variable,
so it can be overridden on the command line. This allows to check for
example ${WRKSRC} instead of the installed files. Of course, since the
variable starts with an underscore, this feature is not meant to be
official.
2006-07-03 06:57:20 +00:00
rillig
52285a9477 I forgot to mention in the last commit that share/examples and share/doc
are automatically excluded from the checks, since those files are not
intended to be executed directly.
2006-07-02 09:40:37 +00:00
rillig
0ed5996894 Added a proper interface documentation. Instead of a .for loop, the
run-time for loop is used, which allows for white-space in
CHECK_INTERPRETER_SKIP.
2006-07-02 09:38:42 +00:00
jlam
bbea7f72c2 Fix typo that would cause check-shlibs to never find missing libraries
needed by files in a package.  Noted and fix suggested by <taca> in
private email.
2006-06-23 12:55:15 +00:00
rillig
226335ff5b It is worth a warning if a freshly installed file is not readable. 2006-06-16 12:03:38 +00:00
jlam
877745fd8f Create DELAYED_{ERROR,WARNING}_MSG macros that can be used to output
error and warning messages that are picked up by the error-check
target.  Use them instead of using a bare ${ECHO} for more code clarity.
Implemented as suggested by Roland Illig.
2006-06-14 15:09:34 +00:00
jlam
6b4b7743d0 Be more consistent about how we're emitting errors and warnings. 2006-06-12 03:42:02 +00:00
jlam
fa494e1722 make(1) will automatically delete partially made targets if the target
creation fails, so remove instances where temporary files were created
then moved to the final target filename, and just directly create the
target.  This is just for brevity/clarity, and saves a few tool calls.
2006-06-09 16:41:09 +00:00
jlam
2cc3f64abb Add a new variable CHECK_FILES_SUPPORTED which is a package-settable
variable to show whether the package supports running the check-files
target.

Set CHECK_FILES_SUPPORTED to "no" in pkgtools/pkg_install in the case
where the PREFIX does not match ${LOCALBASE} it's likely the tools are
being installed in some place that's completely outside pkgsrc control,
and check-files fails horribly in that case.
2006-06-09 16:12:08 +00:00
jlam
8c10d39139 Introduce the capability to gather all the warnings and errors that
are generated for a target and output them all at once at the conclusion
of the target's invocation.  The implementation is in bsd.pkg.error.mk,
which defines a macro target "error-check" that will print out any
non-empty warning and error files in ${WARNING_DIR} and ${ERROR_DIR}
and exit appropriately if there were errors.

Convert some targets that were just long sequences of ${ERROR_MSG} or
${WARNING_MSG} within a single shell statement to use the new delayed
error output via error-check.

Modify the compiler "fail" wrappers for C++ and Fortran to be less
verbose during invocation.  Instead collect the warnings and only
print them at the end of the completed phase, e.g. after "configure"
and/or "build" completes.
2006-06-09 13:59:06 +00:00
jlam
6a64f49846 Fix problems with check-files where it fails with a confusing message
that "the files are in the PLIST but not in ${PREFIX}" if the files
that are installed overwrite other files already on the disk.
Overwriting files can legitimately happen when, e.g. doing a "make
update" or "make replace" without removing the old files, or when
re-running "make install" after fixing a broken Makefile during
development.  While here, make the errors print to standard error
using ERROR_CAT.
2006-06-07 20:28:59 +00:00
jlam
aa012e72aa Use WARNING_MSG and ERROR_MSG for consistency. 2006-06-07 17:41:14 +00:00
jlam
0f5fc1ca58 Rewrite to avoid using "grep -H", which Solaris' grep does not support. 2006-06-07 17:05:25 +00:00
jlam
56b17a4580 Note the check-clean target, which removes files related to the check-*
targets.
2006-06-07 17:04:01 +00:00
rillig
58873dc4d8 Check for [[:space:]] instead of [ ]. This fixes a misbehavior when
script files contain CRLF line-ends.
2006-06-06 23:43:10 +00:00
jlam
08763d7226 Fix problem with saving variables whose value contains "$$" by avoiding
it altogether.  In this case, saving _CHECK_WRKREF_SKIP_FILTER was
problematic because the value was cached and in the process, one $
was stripped.  This makes the check-wrkref target work again after
the big refactoring commit from a couple of days ago.
2006-06-06 18:07:50 +00:00
jlam
3058ace76f Move some variable definitions out of bsd.prefs.mk and back into
bsd.pkg.mk.  They didn't actually need to be defined in bsd.prefs.mk,
just somewhere before the "main" bsd.<phase>.mk files were included.
This moves some conditional (?=) definitions back into bsd.pkg.mk so
they won't conflict with any conditional definitions in package
Makefiles.

This should fix the "checksum" problems in lang/php-gd as noted here:

    http://mail-index.netbsd.org/pkgsrc-users/2006/06/05/0012.html

where EXTRACT_SUFX had the wrong value due to the order in while *.mk
files were included.
2006-06-06 15:28:51 +00:00
jlam
3fbe129b69 Use PHASE_MSG, STEP_MSG, WARNING_MSG, and ERROR_MSG in place of ECHO_MSG
in various places.
2006-06-05 22:49:44 +00:00
jlam
e5eb2c56af First pass at implementing support for package system flavors other
than pkgsrc's current one.  This is an important lead-up to any project
that redesigns the pkg_* tools in that it doesn't tie us to past design
(mis)choices.  This commit mostly deals with rearranging code, although
there was a considerable amount of rewriting done in cases where I
thought the code was somewhat messy and was difficult to understand.

The design I chose for supporting multiple package system flavors is
that the various depends, install, package, etc.  modules would define
default targets and variables that may be overridden in files from
pkgsrc/mk/flavor/${PKG_FLAVOR}.  The default targets would do the
sensible thing of doing nothing, and pkgsrc infrastructure would rely
on the appropriate things to be defined in pkgsrc/mk/flavor to do the
real work.  The pkgsrc/mk/flavor directory contains subdirectories
corresponding to each package system flavor that we support.  Currently,
I only have "pkg" which represents the current pkgsrc-native package
flavor.  I've separated out most of the code where we make assumptions
about the package system flavor, mostly either because we directly
use the pkg_* tools, or we make assumptions about the package meta-data
directory, or we directly manipulate the package meta-data files, and
placed it into pkgsrc/mk/flavor/pkg.

There are several new modules that have been refactored out of bsd.pkg.mk
as part of these changes: check, depends, install, package, and update.
Each of these modules has been slimmed down by rewriting them to avoid
some recursive make calls.  I've also religiously documented which
targets are "public" and which are "private" so that users won't rely
on reaching into pkgsrc innards to call a private target.

The "depends" module is a complete overhaul of the way that we handle
dependencies.  There is now a separate "depends" phase that occurs
before the "extract" phase where dependencies are installed.  This
differs from the old way where dependencies were installed just before
extraction occurred.  The reduce-depends.mk file is now replaced by
a script that is invoked only once during the depends phase and is
used to generate a cookie file that holds the full set of reduced
dependencies.  It is now possible to type "make depends" in a package
directory and all missing dependencies will be installed.

Future work on this project include:

    * Resolve the workflow design in anticipation of future work on
      staged installations where "package" conceptually happens before
      "install".

    * Rewrite the buildlink3 framework to not assume the use of the
      pkgsrc pkg_* tools.

    * Rewrite the pkginstall framework to provide a standard pkg_*
      tool to perform the actions, and allowing a purely declarative
      file per package to describe what actions need to be taken at
      install or deinstall time.

    * Implement support for the SVR4 package flavor.  This will be
      proof that the appropriate abstractions are in place to allow
      using a completely different set of package management tools.
2006-06-03 23:11:42 +00:00