Commit graph

432 commits

Author SHA1 Message Date
rillig
550a2c6284 Prefixed all status messages with "pre-build>" to show the user where they
come from.
2005-12-08 21:21:15 +00:00
rillig
0e9febc62e Added missing "quotes" around many variables. 2005-12-06 09:15:29 +00:00
rillig
309745e03a Fixed a typo. 2005-12-06 08:25:18 +00:00
rillig
95c876eda2 * allow parallel builds (see parallel.txt) 2005-12-05 22:16:13 +00:00
rillig
d43e179274 Shortened the code to extract pkgsrc variables by 30 lines, taking out
much unnecessary redundancy from the code. Reordered the pkgsrc
variables so that related variables appear adjacently in the output.
2005-12-05 10:19:14 +00:00
rillig
22b5045e6f Renamed some variables to match the pkgsrc variables they are derived
from.
2005-12-03 13:39:04 +00:00
rillig
4f04fb18f4 Removed CVS_USER, as announced on pkgsrc-bulk.
See <http://mail-index.netbsd.org/pkgsrc-bulk/2005/11/24/0003.html>.
2005-12-03 01:00:37 +00:00
rillig
9682ee1f28 - Converted intermediate white-space to all tabs.
- Removed trailing white-space.
2005-11-30 18:33:14 +00:00
rillig
11eba3fcb7 - Ignore the return value of the "unset" command. This would terminate the
program if the program would be run in "set -e" mode.
2005-11-30 18:00:16 +00:00
joerg
013ea94433 Fix usage of BULKFILESDIR:
1. Ensure that it exists before trying to use anything inside of it.
2. Prefix files correctly with BULKFILESDIR to match the rest of
the tree.
3. Most importantly, create the .broken.html files for bootstrap tools
in BULKFILESDIR, otherwise e.g. bmake would be removed in the middle of
a bulk build on non-NetBSD.

Discussed-with: rillig@
2005-11-30 17:31:06 +00:00
rillig
a5d4be0f5a Instead of extracting the PKG_TOOLS_BIN make(1) variable, extract
PKG_DELETE and PKG_INFO. This is more straigt-forward and adds the
proper `-K' command line option to the calls, which in turn fixes bulk
builds that don't use the default PKG_DBDIR.
2005-11-28 21:50:01 +00:00
rillig
2cf64233df Prefixed the messages with "build> " that I had forgotten in the last
commit.
2005-11-28 21:18:20 +00:00
rillig
77e79b7392 Prefixed the status messages from this program with "build> ", to
distinguish them from the various other messages.
2005-11-28 21:11:36 +00:00
rillig
4f68e30cda Print a message before creating the bulk build report, as this takes
quite a long time. Currently the reader of the build log might assume
that the installation of lang/perl5 takes so long, which is wrong.
2005-11-28 20:17:27 +00:00
rillig
d3b9bf035d If the package-specific log directory is empty after building a package,
and ${BULKFILESDIR} != ${PKGSRCDIR}, try to remove the directory.
2005-11-28 20:08:37 +00:00
rillig
01ae880577 - Since printindex does not use the .pkglist cache anymore, this program
does not need to create it.
2005-11-28 01:22:53 +00:00
rillig
8ba3dc01c0 - Don't use the .pkglist cache anymore, as the cache is quite cheap to
regenerate. This change makes printdepends and printindex more
  independent, because before this change, printindex could use the
  cache provided by printdepends, but not the other way round.

- Fixed the section "Sanity checks, part 2" by allowing newline
  characters in the list of packages from which the index is built.
  This bug just hasn't been noticed because the list taken from the
  cache did not have newlines at all.

  The '-' character is not included in the $allowed variable because it
  is handled specially and differently by sh(1) and tr(1).

- Updated the printindex man page.
2005-11-28 01:14:35 +00:00
rillig
d0779b9925 Indentation fix to make the "case" statements look more uniform. 2005-11-24 22:01:54 +00:00
rillig
7565e704a8 Corrected the quoting of variables in clear cases. 2005-11-24 18:21:54 +00:00
rillig
678f9c3d5a 1. Added section headers in the part of the user-settable variables.
2. Reindented two "if" statements that looked like this:

if long_long_command; then :; else
	else_commands
fi

By just scanning the beginnings of the lines, which is a common way of
reading source code, one may easily miss the "hidden" "then" branch at
the end of the line. I have changed it to:

if long_long_command; then :;
else
	else_commands
fi
2005-11-24 12:14:32 +00:00
rillig
63e9bd3fa3 Changed the file extension of BROKENWRKLOG from ".html" to ".txt". This is
mostly a cosmetic change. The motives for this change are that the HTML
files only consisted of "<pre>", the properly quoted text/plain contents
and "</pre>". There has been no documentation of reasons for encoding plain
text in HTML unnecessarily, so this change will produce text/plain files
instead.

Another change is that instead of appending to the BROKENWRKSRC, the file is
overwritten each time. In a single bulk build this will not change anything.
Only when the package is built multiple times in a single bulk build, the
behavior will differ.

Ok'ed by agc.
2005-11-23 20:45:11 +00:00
erh
4d2fdd7bd5 Per request, back out all the SKIP_AUDIT_PACKAGES changes.
bsd.pkg.mk:1.1758-1.1752
bsd.prefs.mk:1.210
bulk/build:1.79
defaults/mk.conf:1.93-1.92
2005-11-23 18:27:13 +00:00
rillig
36386eb147 Put literal strings into .Ql quotes. 2005-11-20 15:46:48 +00:00
rillig
eca9c2c140 Added "" quotes to all arguments to echo(1). 2005-11-20 15:25:39 +00:00
rillig
a4b630d89c Moved the "export BROKENF" command from the top of the program to the
point where it is actually used, which is when mk/bulk/pre-build.local
is executed for allowing user-specific modifications before the build
begins. That way it's easier to see why this command is necessary at
all.
2005-11-20 14:55:13 +00:00
rillig
0750f1e1f7 - If the BULKFILESDIR differs from PKGSRCDIR, create it before trying to
create log files in it.
- Fail early if the ORDERFILE does not exist. (As this program is not in
  "set -e" mode, it had continued without error checking, which resulted
  in _many_ error messages.)
2005-11-20 11:18:45 +00:00
agc
9ee6f68b3c Despite having ALLOW_VULNERABLE_PACKAGES in my /etc/mk.conf, I found
that the bulk builds would only work properly with the audit-packages
package installed at all times.

I am obviously hideously mistaken in this.

By popular request, revert the change to add audit-packages, since I
am told this is the incorrect way of doing this.
2005-11-20 09:52:51 +00:00
wiz
493edd5bb5 Macro usage fixes, use more macros, grammar improvement. 2005-11-20 01:44:32 +00:00
agc
3940af4d32 Allow the bulk builds to work by adding security/audit-packages as a
BULK_PREREQ package.
2005-11-19 19:21:47 +00:00
rillig
d4b999a69e Indentation fix. 2005-11-19 17:31:40 +00:00
rillig
c192f7204c Fixed the documentation in the DIAGNOSTICS section. 2005-11-19 11:19:57 +00:00
rillig
409aeeb499 Made the diagnostics for invalid characters in BULK_PREREQ and the
package list more useful by only showing the invalid characters, not the
complete variable value.
2005-11-19 11:19:10 +00:00
rillig
1616b1c475 - Moved the "man page" comment into a real man page.
- Added more sanity checks.
2005-11-19 10:55:45 +00:00
rillig
d00d26ba33 The toplevel database files are referenced in the report, so they must not
be unlinked. Not even in a comment.
2005-11-19 09:35:20 +00:00
rillig
4100185f57 Replaced ${ECHO_MSG} with ${ECHO} where appropriate. While there, quoted
the filename of the toplevel BROKENFILE correctly.
2005-11-19 03:53:50 +00:00
agc
c1a86103c2 To check if the pkg_install tools are up to date, the bulk build script
cd's into pkgtools/pkglint and does a "make fetch".

Since the audit-packages check was introduced to bsd.pkg.mk, this
"make fetch" will fail with an error message which looks like:

	===> do-fetch [pkglint-4.42.1] ===> Checking for vulnerabilities in pkglint-4.42.1
	===> check-vulnerable [pkglint-4.42.1] ===> *** The audit-packages package must be at least version 1.40
	===> check-vulnerable [pkglint-4.42.1] ===> *** Please install the security/audit-packages package and run
	===> check-vulnerable [pkglint-4.42.1] ===> *** '/usr/pkg/sbin/download-vulnerability-list'.
	*** Error code 1

since there is no audit-packages package installed at this point (we
are still doing the pre-installation checks).

So call "make fetch" with an additional SKIP_AUDIT_PACKAGES=yes
argument at this point.
2005-11-19 00:30:54 +00:00
rillig
630f4b43ad The "Building packages" section has been split up into "Building the
packages" and "Generating the report".
2005-11-18 12:27:26 +00:00
rillig
9484e788d6 Added a new section called "Generating the report". Moved the FTP*
variables into that section, since they have nothing to do with
uploading the binary packages.
2005-11-18 12:11:51 +00:00
agc
b43f1e2ec1 Revert the change in 1.77, which does not work correctly.
However, this does not help people who are doing bulk builds
in sandboxes via read-only nullfs mounts.

A correct, long-term solution to this needs to be found.
2005-11-18 11:43:25 +00:00
rillig
ffb2a1b746 - The text/plain report is generated using printf() instead of
formline(). This prevents long package names from being trimmed.
- Removed the "-p e" command line option from the pax(1) command line.
  This makes it possible to run mk/bulk/post-build as different user
  from the one who did the actual build.
2005-11-18 11:38:00 +00:00
rillig
139533c93f Code cleanup, bugfixes and separation of PKGSRCDIR and BULKFILESDIR.
- Added section headings to make reading the code more efficient.
- Added bp_die() for uniform error messages.
- Added sanity checks:
  - $BULK_BUILD_CONF must be a regular file.
  - Protect against spurious output from the bulk.conf file.
  - Check that configuration variables are defined, non-empty and
    do not contain newlines.
  - Properly extract MAKECONF from the bulk.conf file when getting the
    mk.conf variables.
  - Protect against spurious output from BMAKE show-vars.
- Fixed the use of undefined values ($startdate).
- Changed some calls to my_system() to a more secure form.
- Check if the calls to chdir() actually work.
- Look for the BROKENFILEs in BULKFILESDIR instead of USR_PKGSRC.
- Changed postfix conditions to prefix conditions. Example:
  do_foo() if $bar; ==> if ($bar) { do_foo(); }
2005-11-18 10:18:05 +00:00
agc
9166786972 If the bulk build is taking place in a sandbox, then typically read-only
nullfs mounts are used (on NetBSD).

Only attempt to install new pkg_install tools if the bulk build is not
taking place in a sandbox.

This is a quick and dirty hack to allow sandboxed bulk builds (the majority
of cases, I suspect) to operate properly once again.
2005-11-18 08:58:12 +00:00
rillig
f0d0e72266 Corrected the comment above BULKFILESDIR. It is not only used for the
global log files but also for the package-specific ones.
2005-11-18 08:48:09 +00:00
rillig
f6c9f12624 Properly indented preprocessing directives. 2005-11-18 08:42:35 +00:00
rillig
5a0e397d42 Allow FORCEBROKENFILE files to be created in either PKGSRCDIR or
BULKFILESDIR.
2005-11-18 08:35:58 +00:00
rillig
0c5c5c91ec Changes for separation of BULKFILESDIR and PKGSRCDIR.
- Added a bunch of internal variables that determine the correct places
  for the build log files of the current package.
- Added section headings.
- Moved a sanity check out of the configuration section to not confuse
  the reader.
- mk/bulk/print{depends,index} are called with two arguments, which allows
  separation of BULKFILESDIR and PKGSRCDIR.
- Replaced uses of BUILDLOG, BROKENFILE and BROKENWRKLOG with their
  internal counterparts, which use ${BULKFILESDIR} instead of ${PKGSRCDIR}.
2005-11-16 22:58:59 +00:00
rillig
43a50150db Changes for enabling separate BULKFILESDIR and PKGSRCDIR.
- The main .make file is stored in ${BULKFILESDIR} instead of ${PKGSRCDIR}.
- The PKGLIST variable from the configuration file is passed to the
  bulk-cache command in the environment. There are very few variables left
  that have to be exported via export_config_vars(). Maybe that function
  can be avoided alltogether.
2005-11-16 22:44:06 +00:00
rillig
172d281652 Made printdepends very similar to printindex, as both iterate over all
pkgsrc packages, collecting different information.

- BMAKE is taken from the environment instead of querying `uname -s`.
- package-specific log files can be saved in a directory tree different
  from PKGSRCDIR.
- Added sanity checks for BMAKE, bulkfilesdir and brokenfile.
- The .pkglist cache is saved in ${BULKFILESDIR} instead of ${PKGSRCDIR}.
- Reformatted the diagnostics.
2005-11-16 22:18:03 +00:00
rillig
bb3c9ec9a1 As I'm not sure for what things ${BULKFILESDIR}/${BROKENFILE} is used,
error messages from failed "cd" commands simply go to stderr.
2005-11-16 22:11:11 +00:00
rillig
c86c30c6d4 Another rewrite:
- Changed the implementation how package-specific log files are generated.
  No user-visible changes.
- Stricter preconditions:
  - bulkfilesdir must be an absolute path.
  - brokenfile must not contain slashes.
- The .pkglist file is taken from BULKFILESDIR, not from PKGSRCDIR.
- Error messages use the prefix "[printindex]" instead of "===>", as the
  latter is already reserved for pkgsrc. Everything else would be confusing.
- If a "cd" into a package directory fails, an error message is written to
  ${BULKFILESDIR}/${BROKENFILE}.
2005-11-16 22:07:19 +00:00