Commit graph

126 commits

Author SHA1 Message Date
dmcmahill
a6bbcb2584 fix broken sed regexp which sometimes causes a failed pkg fail in marking others as broken 2005-03-17 22:49:15 +00:00
dmcmahill
ef23058a67 Avoid feeding very long lines to grep/egrep. The grep/egrep implementation
on some systems, e.g. solaris, will simply drop long lines.  These longs
lines are found in the flattened up and down dependency lists in the bulk
cache files.  Instead, use sed to deal with this.

Fixes problems noted in Solaris bulk builds.  Patch tested on NetBSD-2.0
and Solaris-2.9
2005-03-12 13:27:03 +00:00
sketch
b6aec517bc Pass the correct programs to the mkdatabase script. 2005-01-27 17:55:42 +00:00
tv
23c895bb83 The pipe triggers a subshell even though () is not used. So use "exit" and
|| on the outside of the command to determine whether the packages found
in the loop are up to date.
2005-01-21 13:24:13 +00:00
tv
737cb046a6 Fix missing {} around variable name, noted by wiz.
Change one instance of $(...) to `...` per policy.
2005-01-21 13:11:46 +00:00
tv
76a832fa68 Fix error in previous; add explicit version check first, then the optionally
excluded timestamp check.
2005-01-19 22:12:27 +00:00
tv
5b254ab9a7 * Add USE_BULK_TIMESTAMPS (default "yes") to control whether dependency
binpkg timestamps, and ${PKGDIR} file timestamps, will be used to
  determine if a rebuild is necessary.  If changed to "no", then rebuilds
  will only happen when PKGNAME actually changes.

* Add LINTPKGSRC_DB (and companion USE_LINTPKGSRC_CACHE, default "no") to
  make pre-build generate a reusable database with "lintpkgsrc -E"; helps
  with nfs-mounted pkgsrc.  A future change will allow use of this in the
  upload script.

* Add entry for PRUNEPACKAGES in build.conf-example (this was missing).
2005-01-19 20:58:00 +00:00
jmmv
cd4de569dd Add a blank line between multiple "broken due to a broken dependency"
messages for better readability.
2005-01-17 08:52:50 +00:00
tv
7ac5f2db44 Fix checking of up to date binary packages. The problem with DEPENDS
containing constructs of the form

    {perl>=5.8.3nb1,perl-thread>=5.8.3nb1}

is that a Bourne shell "for" interprets this as two separate items in the
list, nuking the {}s.  The above will never succeed and thus always cause
Perl-dependent packages to be rebuilt unconditionally.

Just adding more \s isn't enough -- the parsing of the depends list has to
be moved out of the "for" clause.  So, echo them one per line and use "read"
to pull them in without allowing the shell to peek at those characters.
2005-01-12 22:51:54 +00:00
tv
1b0eb440fd nfs-pkgsrc friendliness change:
Add a knob to relocate all the global bulk state files in one setting.
BULKFILESDIR; defaults to PKGSRCDIR as before.
2005-01-11 18:44:10 +00:00
jlam
4952f1a79c Don't hard-code "lang/perl58". Instead, use the value of PERL5_PKGSRCDIR
which is computed based on whether perl or perl-thread should be the
default.
2004-11-23 19:44:02 +00:00
jlam
b2320b8957 Preserve the .work.log file from a broken build as .broken.work.html
in the package directory, and add a link to it from .broken.html at
the point where the build fails.  Also adjust the auxilliary scripts
to handle/cleanup .broken.work.html files.

This should enhance the ability of developers to debug broken builds
by providing important information about what is happening as a build
progresses and fails.
2004-11-16 18:34:12 +00:00
jlam
d13b06f317 Bulk builds should be defaulting to building perl58. 2004-11-12 15:39:22 +00:00
jlam
17c3aafac1 * Make PKGSRC_TOPDIR a private variable by renaming it to _PKGSRC_TOPDIR,
as it's only used internally by bsd.prefs.mk.

* Make _PKGSRCDIR a public variable by renaming it to PKGSRCDIR.
  Also, generate its value from ${_PKGSRC_TOPDIR} so it's less fragile
  than the old method of stripping off the last two components of
  ${.CURDIR}.  PKGSRCDIR may now be used after bsd.prefs.mk is defined.

* Change all references to _PKGSRCDIR to PKGSRCDIR.
2004-10-07 02:01:37 +00:00
grant
51bd835ca8 correctly use PKG_SUFX instead of ".tgz".
this fixes a problem where bulk builds with PKG_SUFX=.tbz would
needlessly, repeatedly rebuild dependency packages because
${PKGNAME}.tgz did not exist.
2004-07-25 08:40:46 +00:00
dmcmahill
f2b6b7c157 make sure we get BMAKE set when calling printdepends and printindex 2004-06-25 13:45:00 +00:00
jschauma
f78237671a According to egrep(1):
Portability note: unlike GNU grep, traditional grep did not con-
  form to POSIX.2, because traditional grep lacked a -q option and
  its  -s option behaved like GNU grep's -q option.  Shell scripts
  intended to be portable to traditional grep should avoid both -q
  and -s and should redirect output to /dev/null instead.

And, guess what, that's exactly what we run into when we call IRIX'
egrep(1) with '-q' (which it doesn't know).  So let's follow this
suggestion and use neither '-q' nor '-s' and redirect output to
/dev/null instead.
2004-04-10 16:23:00 +00:00
jschauma
2cca9690d9 Commentary cleanup:
- If it's a full sentence, start capitalize first letter and end with a
  period.
- Break comments at ~80 chars so it fits into a terminal.[*]

(* This should be done for the code as well, but then it'll need testing.
   I'll do this at another point in time.)
2004-04-09 18:43:14 +00:00
dmcmahill
eb0a5dcca7 Add support in the bulk build code to properly deal with SPECIFIC_PKGS=1.
In particular, when SPECIFIC_PKGS is set in /etc/mk.conf, you can now do

  sh mk/bulk/build

and have the right thing happen.  Only those packages explicitly listed
and those which are depended upon are considered for the build.  Other
than the restricted list of packages, the bulk build works the same way
as a full bulk build.
2004-04-07 22:56:34 +00:00
grant
b6f7f60e16 s/netbsd.org/NetBSD.org/ 2004-02-25 09:20:59 +00:00
agc
1e90841f0d Add a new definition, _PRESERVE_WRKDIR, which defaults to "no". This
definition is not intended to be set by the user, and so has a leading
'_', and is undocumented.

If set to "yes", then a "make clean" of the package will not be done,
thereby preserving the working directory.  This is useful for
debugging problems in bulk builds.
2004-01-26 21:24:41 +00:00
heinz
4d478bb0cf Use $FIND with "-print". Noted by Georg Schwarz in PR pkg/24248 2004-01-26 21:10:31 +00:00
grant
15a0f7f8f5 reverse some "if ! command;" statements so this works with Solaris'
/bin/sh, which doesn't deal with !

bulk builds now work out-of-the-box on Solaris. woo :-)
2004-01-20 09:41:52 +00:00
grant
c0baecbda3 tiny whitespace tweak 2004-01-20 05:56:34 +00:00
grant
5128c89aa8 minor whitespace cleanup. 2004-01-17 06:22:20 +00:00
sketch
fed8dd643d Make sure programs compatible with pkgsrc are used, rather than relying
on the first in path.  Fixes possible issues with Solaris.
2003-12-03 17:13:02 +00:00
hubertf
bba9c15fbd This patch addresses three problems:
1) When checking if any of the required binary pkgs is newer, it's
   not good to look into the (already existing) binary pkg, as that
   might be unchanged. Instead, look at the DEPENDS.

   In the context of the recent jpeg changes, the gd package itself was
   not changed, but the DEPENDS were (via buildlink files). Now looking
   into the existing gd binary pkg still said it wanted jpeg-6b instead
   of the now-wanted jpeg>=6b, which was only available via the DEPENDS.

   That's the first chunk of the patch below.

2) While debugging this, I found that the change in rev. 1.48 was
   wrong, as can be seen throughout the last bulk build, search for errors
   like:

	find: "/usr/cvs.local/pkgsrc/packages/i386/All/gd-2.0.15.tgz": No such file or directory

   As the whole operation is really on two files (as assured by "pkg_admin
   lsbest" for pkg and REFS by definition), the quotes can be ommitted.

   Why this wasn't caught when that change was tested is beyond me - maybe
   different sh(1) behaviour? (The error happened on 1.6.1_STABLE, see
   e.g. http://smaug.fh-regensburg.de/~feyrer/ftp/pub/NetBSD/pkgstat-i386/last/www/p5-Template-Toolkit/.broken.yui.html).

   Anyways, that's addressed in the second part of the patch below, too.

3) Use ${FIND} while there.
2003-10-10 21:45:55 +00:00
jlam
841b57441b Merge pkgviews-mk branch into the HEAD by running:
cd pkgsrc/mk
	cvs update -Pd -A
	cvs update -Pd -j pkgviews-mk-base -j pkgviews-mk
2003-09-02 06:59:37 +00:00
gavan
8f1aedda6a Replace [ $A -nt $B ] with a portable equivalent 2003-08-21 16:24:31 +00:00
grant
1ea30e1f8f quote some args to ${GREP}.
from gavan@.
2003-08-08 08:51:01 +00:00
dmcmahill
30b1a989cb replace the -u and -d options to tflat with 'up' and 'down' as the former
causes problems with some awks.  Patch provided by Jonathan Perkin in
PR pkg/22246
2003-07-25 11:29:33 +00:00
grant
58657ac9cf portability fixes:
quote a shell test, and run ${AWK} -f tflat instead of using
#!/usr/bin/awk.
2003-07-11 23:54:32 +00:00
jmmv
f1446ddf2b Drop trailing whitespace. Ok'ed by wiz. 2003-05-06 17:40:18 +00:00
dmcmahill
4e23ffd1d9 correct the 'broken due to depends' processing. This change makes the
summary email list correctly the packages which are broken because of
their dependencies.  Problem noted on Huberts most recent bulk build.
2003-02-13 22:51:03 +00:00
kei
2a95fc68a5 honor PKG_SKIP_REASON as well as PKG_FAIL_REASON, like normal build does. 2003-02-08 23:27:00 +00:00
schmonz
a2849a9dca Replace IGNORE into PKG_FAIL_REASON and PKG_SKIP_REASON, so pkgsrc
can stop builds when a dependency is broken, yet continue builds
when a dependency is merely skipped (usually because it duplicates
functionality in the base system). Thus IGNORE_FAIL, the
oft-misunderstood and naught-documented option, goes away.

This addresses many people's complaints on tech-pkg@ and other
lists, as well as PR pkg/18157.
2002-12-07 02:37:56 +00:00
jlam
b119dbc8ef Merge pkgsrc/mk from the buildlink2 branch back into the main trunk. 2002-08-22 08:21:26 +00:00
mrauch
740ad47954 Make bulk builds aware of packages with INTERACTIVE_STAGE and mark them as
"not packaged" instead of "broken".
2002-07-21 11:53:18 +00:00
dmcmahill
187edbfd07 don't hard code the start time stamp file as .start.${arch} but allow
OBJMACHINE and OBJHOSTNAME to work.  Also don't hardcode /usr/pkg and
/usr/X11R6 for LOCALBASE and X11BASE.  Finally, fix a few typos in messages
while here.
2002-06-29 03:33:34 +00:00
hubertf
207d50e572 Use <pre> to surround build logs - monospaced fonts are so much more readable.
OK'd by Dan McMahill
2002-03-04 21:10:47 +00:00
dmcmahill
0aa7588bd1 add some html markup to the .broken files (which now have .html extenstion).
The primary purpose is so when a package is broken due to broken depends,
there are links to the build logs of the broken dependencies.

Suggested by Brook Milligan on tech-pkg.
2002-01-20 03:07:05 +00:00
dmcmahill
d99a79b2eb add the OBJHOSTNAME functionality that appeared in 1.901 of bsd.pkg.mk.
When OBJHOSTNAME is set, the various cache files and log files will include
the hostname in their names.  Useful when multiple machines of the same
architecture share pkgsrc.
2002-01-12 02:25:59 +00:00
dmcmahill
f68e56c389 - add 'bulk-cache' and 'clean-bulk-cache' targets to create and remove
the cache files used during a bulk pkgsrc build.

- replace the code in the build script that used to create the cache
  files with a 'make bulk-cache' call.
2001-12-17 02:32:22 +00:00
dmcmahill
6ce14a63b7 add more checks to be more robust in the face of an index file which
may not be 100% accurate.
2001-12-16 14:27:07 +00:00
agc
ccff9099bc Modify all references to PKGSRCDIR to _PKGSRCDIR, except in the external
references of the pkglint package.

_PKGSRCDIR is an internal definition in bsd.pkg.mk, and a few packages
which would like to refer to other packages in the build tree. It should
not be set by users, but neither should it stop a user from building a
package if it is defined, so make it obvious that this is the case.
2001-12-15 20:25:34 +00:00
abs
6dd01d2785 lose some more pkg/ references 2001-11-28 10:21:46 +00:00
hubertf
b3e7e7baec The $DEPENDS file has the pkg's directory in the first column, followed by
whitespeace, followed by it's required pkgs. Make sure to look for that
whitespace, to not catch any wrong positives, e.g.

	egrep "x11/kdebase.*" $DEPENDSFILE

will catch depends for both KDE1 and KDE2 and do weird things then (among
other things, think that kdelibs-2.2.1 is ok as a dependency when building
in x11/kdebase, which is certainly not!)

Eight broken pkgs less in the bulk builds by adding a single space!
(Now if adding some more would help further... :-)
2001-11-07 00:29:20 +00:00
abs
783b4399f5 When working out if an installed package should be left as it
matches one of the DEPENDS, the bulk-build system looked up the
package in the INDEXFILE, then used the pkgdir returned to check
against the DEPENDS. If for some reason the package was not found
in the index file the package was left installed as 'requires
installed package'.
2001-10-20 09:07:13 +00:00
dmcmahill
32188bfde2 if an outdated package is still installed and 'make deinstall' fails
to remove it, then try again with 'pkg_delete -r'.  This can happen when
some other out date pacakges are installed and we're trying to bulk build
a single package.
2001-07-21 19:36:47 +00:00
hubertf
d392e30e8a Add date when a buid for a pkg started, and comment a place that has some
side effecs
2001-05-09 02:54:38 +00:00
dmcmahill
6ce703782b don't exit if a depends can't be pkg_add'ed. In this case it will be
rebuilt from sources.
2001-05-09 02:39:31 +00:00
dmcmahill
ab699dabf0 some code cleanup.
- use the PKGPATH variable instead of getting it indirectly

- don't use `foo` when we only want the return value, not the output.

Also, in the non-cache case, we need to remove un-needed packages as noted
in the most recent non-cached bulk build.

Patches provided by Hubert and slightly modified by me.
2001-05-03 21:19:55 +00:00
dmcmahill
0c4917e918 do some extra checks. In particular, don't try to pkg_add a package if
it doesn't exist (doh!).
2001-05-02 13:51:43 +00:00
dmcmahill
fe65792de1 get rid of an unneeded awk invocation 2001-03-31 00:03:03 +00:00
dmcmahill
c341f514d3 -add support for a BULK_PREREQ make variable. BULK_PREREQ contains a list
of packages which must stay installed during the build, but are not pulled
 in by the DEPENDS for each package.  Currently, BULK_PREREQ will always include
 pkgtools/digest.  At this time, the primary use will be to add
 BULK_PREREQ+=pkgtools/xpkgwedge
 in /etc/mk.conf to do an xpkgwedge'd bulk build.  It is up to the user to make
 sure that the list of packages in BULK_PREREQ is a flattened list (ie all the
 DEPENDS are listed too).  Again, at this time, xpkgwedge is really the only
 package that should be added to the list.

-add an ADMINSIG build.conf variable.  This is the signature at the end of the
 email report.  Maybe now I'll quit forwarding reports signed as "-Hubert".

-while here, eliminate grep|awk lines and `grep >/dev/null` replacing them
 with pure awk and grep -q.
2001-03-19 11:25:39 +00:00
dmcmahill
4e817902cb reduce the verbosity when adding/removing pkgs. Suggested by Hubert 2001-02-17 15:48:51 +00:00
dmcmahill
7a46b730b6 when removing out of date binary packages from ${PACKAGES}/All, also remove
the links from the package category subdirectories so we don't leave bad
links around.
2001-02-15 20:13:28 +00:00
dmcmahill
8595fb34da only use the depends cache files during a bulk build, otherwise revert to
the old behaviour.  This is done because unless we're in the middle of a
bulk build, we don't really know that the cache files are up to date.  These
are fairly time consuming (relative to a single smallish package build) to
generate and depend on all of the pkgsrc makefiles.  During a bulk build, the
overhead is far outweighed by the savings.

In particular, 'make bulk-install' will now work correctly outside of a bulk
build (useful for debugging broken packages).

Thanks to Hubert who noted the 'make bulk-install' problem in a private email.
2001-02-13 23:02:23 +00:00
dmcmahill
82f326d1da when a package fails to package, keep a count of how many others packages
fail as a result.  Then report this number in the generated email and
html summary.  The goal is to help the pkgsrc crew focus our efforts
on the broken packages which have the largest impact.  Thanks to
Christoph Badura for suggesting that I do this and Hubert Feyrer who
suggested an easier to read output format.
2001-02-08 19:17:38 +00:00
dmcmahill
bf85b1aa00 This commit incorporates several speed improvements which have been tested
over several bulk builds on an alpha:

- At the start of a bulk build, 4 files are created to allow fast lookup of
  various dependency tree things.  These files are
  .index       ==  maps package name (foo-2.3) to directory (bar/foo)
  .dependstree == contains the complete pkgsrc dependency tree in a tsort(1)
                  compatible format.
  .depends     == contains 1 line per package and lists all the build depends
                  for the package.
  .supports    == contains 1 line per package and lists all packages which
                  depend on this package.

- When a package fails to build, the list of all packages which depend upon
  it is read from .supports.  Each of those packages is immediately marked
  as broken.  This prevents us from trying to build those packages which can
  have significant overhead if lots of other depends are installed before the
  system notices the broken one.

  In addition, the post-build postprocessing will now indicate that a package
  is 'truely broken' (ie, bad PLIST, failed compilation) vs. a package which
  is broken because it depends on a failed package.  This assists in determining
  where to focus our efforts in fixing broken packages.

- In the old approach, all packages are removed after each one is built.  The
  purpose was to a) conserve disk space, b) verify that all required dependencies
  are in fact listed, and c) prevent conflicts.  The problem was that often times
  several packages in a row have similar depends.  For example we might want to
  build several perl packages in a row.  In the old approach, we would install perl,
  build the pkg, deinstall perl and continue with the next one.

  In the new approach, when it is decided that a pkg is out of date and should be
  rebuilt, the .depends file is used to obtain a list of pkgs we require.  Then
  and pkgs which are no longer needed are removed.  This helps to minimize the total
  number of pkg_add/pkg_delete's in a bulk build.

- Since the order of the build is controlled by the depends tree, all depends for a
  given package will have been built by the time the pkg in question needs them.
  If any of the depends failed to build, then the pkg which needs the failed one will
  have been marked as broken.  Given this, the complete depends list for a pkg is
  read from .depends and the depends installed via pkg_add rather than relying on
  recursive make calls to install the depends.

- while here, fix a few minor bugs
  x - don't leave .make log files around when the build succeeds
  x - make sure we refer to the correct report file in the email
  x - use '.order' for the build order file instead of '.l'
  x - use 'grep -c' instead of 'grep | wc -l'
2001-02-01 08:47:29 +00:00
dmcmahill
7954444aca be consistant about the use of "BULK> " as the prompt relating to the bulk
build system instead of a mix of ">> " and "BULK> ".

replace a few foo -> ${FOO}
2001-01-28 21:20:48 +00:00
hubertf
a638bc5107 Whitespace fix 2000-09-15 21:47:03 +00:00
hubertf
07dccfdb81 remove debug code 2000-09-02 14:05:36 +00:00
hubertf
94e6e8bd17 log more stuff to buildlog 2000-09-02 13:53:06 +00:00
dmcmahill
7b2960addc a couple of minor changes to the bulk-check-uptodate target:
- quote arguments to pkg_admin so the shell doesn't try to expand any *'s.

- be sure that all required binary packages exist.  The previous version
  made sure the required packages were not newer, but missed catching missing
  required packages.

Still todo:
When examining required binary packages to see if they have changed, the test
only looks at the modification time of the binary package.  It does not verify
that the required binary package is also up to date with respect to its
pkgsrc files.
2000-08-25 12:43:28 +00:00
dmcmahill
d768c43c3c escape the \ in an echo command so we see it 2000-08-24 15:48:12 +00:00
hubertf
f3fb78f833 If a required binary pkg is found newer, tell which one. 2000-08-24 02:49:44 +00:00
hubertf
7a01adbfdb Remove a comment that's no longer valid after we have 'pkg_admin lsbest'
now - we can expand all pkg wildcards with that.
2000-08-24 00:59:18 +00:00
hubertf
0711a31398 Back out last commit: It nuked pkgs that we compile in several versions,
e.g. for "normal" and -current pkgs.
2000-08-24 00:52:23 +00:00
hubertf
e0fcb9cbea When rebuilding a pkg, don't only remove the binary pkg currently
available with the current version, but ALL version.

That way, old pkg versions are automatically removed when building new
ones.
2000-08-11 20:38:04 +00:00
hubertf
71fc302230 Suppress any errors from pkg_delete if no pkgs are installed 2000-08-04 03:24:33 +00:00
dmcmahill
b5e3262f6a minor grammar fix 2000-08-01 21:19:21 +00:00
hubertf
8926c8c0b2 s/depends/install-depends/ 2000-08-01 02:56:43 +00:00
hubertf
1d49b935a8 make sure the required packages (depends) are installed before the
package is about to be built. This allows measuring of (only) this
pkg's build cost in some future step.
2000-07-31 22:22:33 +00:00
hubertf
ff3cf6b5cf No need to set PKG_MISC_TARGETS in /etc/mk.conf any more, it's now
on per default in bsd.pkg.subdir.mk
2000-07-28 01:16:04 +00:00
hubertf
ac4380bdd5 initial commit of bulk build targets (more to come) 2000-07-28 00:46:17 +00:00