pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_comp Update to 1.15:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/40126b06c8ed
branches:  trunk
changeset: 466783:40126b06c8ed
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Fri Jan 23 09:48:53 2004 +0000

description:
Update to 1.15:
- Automatic builds can now be interrupted at any time with CTRL+C and then
  resumed! (with 'auto resume' from the command line).
- MAKE_PACKAGES has been deprecated in favour of two new variables:
  BUILD_PACKAGES, which tells which packages to build after a 'makeroot'
  and AUTO_PACKAGES, used during the 'auto' target.
- MOUNT_SCRIPT and UMOUNT_SCRIPT have been deprecated in favour of MOUNT_HOOKS
  and UMOUNT_HOOKS, which take a list of shell functions or external commands
  to be executed.
- /pkg_comp is now symlinked to /p inside the chroot, to make paths simpler
  when working inside it (i.e., with the 'chroot' target).
- security/audit-packages is not installed any more inside the chroot by
  default.  This is not needed to get pkgsrc security checks working.
  The user can add it to BUILD_PACKAGES for a regular build.
- pkgtools/xpkgwedge is not installed any more during a 'makeroot'.  pkgsrc
  handles this automatically when needed, so we let it install the package
  for us.
- Ensure that libkver's library is preloaded when doing builds inside the
  chroot, so that packages get the right version number in them.
- When creating a template file, sort all variables alphabetically.
- Several miscellaneous changes in the code: simplification of syntax,
  addition of comments to functions, cleanup of messages...

diffstat:

 pkgtools/pkg_comp/DESCR             |    1 +
 pkgtools/pkg_comp/Makefile          |    4 +-
 pkgtools/pkg_comp/files/pkg_comp.8  |   77 ++++--
 pkgtools/pkg_comp/files/pkg_comp.sh |  398 ++++++++++++++++++++++++-----------
 4 files changed, 323 insertions(+), 157 deletions(-)

diffs (truncated from 956 to 300 lines):

diff -r 4e5d909311ea -r 40126b06c8ed pkgtools/pkg_comp/DESCR
--- a/pkgtools/pkg_comp/DESCR   Fri Jan 23 09:47:22 2004 +0000
+++ b/pkgtools/pkg_comp/DESCR   Fri Jan 23 09:48:53 2004 +0000
@@ -11,3 +11,4 @@
   work properly.
 * Avoid autoconf's side effects by keeping a separate chroot for
   each project, like one for GNOME2 and another one for KDE3.
+* Schedule builds of package sets for several different machines.
diff -r 4e5d909311ea -r 40126b06c8ed pkgtools/pkg_comp/Makefile
--- a/pkgtools/pkg_comp/Makefile        Fri Jan 23 09:47:22 2004 +0000
+++ b/pkgtools/pkg_comp/Makefile        Fri Jan 23 09:48:53 2004 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.20 2004/01/20 12:23:57 agc Exp $
+# $NetBSD: Makefile,v 1.21 2004/01/23 09:48:53 jmmv Exp $
 
-DISTNAME=      pkg_comp-1.14
+DISTNAME=      pkg_comp-1.15
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 4e5d909311ea -r 40126b06c8ed pkgtools/pkg_comp/files/pkg_comp.8
--- a/pkgtools/pkg_comp/files/pkg_comp.8        Fri Jan 23 09:47:22 2004 +0000
+++ b/pkgtools/pkg_comp/files/pkg_comp.8        Fri Jan 23 09:48:53 2004 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_comp.8,v 1.18 2004/01/18 20:45:42 zuntum Exp $
+.\" $NetBSD: pkg_comp.8,v 1.19 2004/01/23 09:48:53 jmmv Exp $
 .\"
 .\" pkg_comp - Build packages inside a clean chroot environment
 .\" Copyright (c) 2002, 2003, 2004 Julio M. Merino Vidal <jmmv%NetBSD.org@localhost>
@@ -27,12 +27,12 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 8, 2004
+.Dd January 23, 2004
 .Dt PKG_COMP 8
 .Os
 .Sh NAME
 .Nm pkg_comp
-.Nd build packages inside a chroot
+.Nd build packages inside a sandbox
 .Sh SYNOPSIS
 .Nm
 .Oo Fl Po
@@ -44,9 +44,12 @@
 .Ar target
 .Op Ar pkg_name ...
 .Sh DESCRIPTION
-.Nm
+.Nm ,
+or
+.Em Package Compiler
+in its full name,
 is a tool that makes easy the compilation of packages inside a clean
-chroot environment.
+sandbox.
 This allows an easy tracking of exact dependencies
 and the correct behavior of a package in a fresh system installation.
 .Pp
@@ -73,7 +76,7 @@
 Avoid installation of
 .Va INSTALL_PACKAGES
 and
-.Va MAKE_PACKAGES
+.Va BUILD_PACKAGES
 during the creation of the chroot.
 .El
 .Ss What to use it for?
@@ -100,6 +103,8 @@
 .It
 Avoid autoconf's side effects by keeping a separate chroot for each
 project, like one for GNOME2 and another one for KDE3.
+.It
+Schedule builds of package sets for several different machines.
 .El
 .Sh CONTROL DIRECTORY
 .Nm
@@ -107,8 +112,11 @@
 Instead of using normal system trees, it uses a special directory inside the
 chroot to avoid polluting the system.
 It stores there scripts, object files, built packages, etc.
-This directory is located by default in
-.Pa $DESTDIR/pkg_comp .
+This directory is
+.Pa $DESTDIR/pkg_comp ;
+the symbolic link
+.Pa $DESTDIR/p
+is automatically created to ease pathnames when working inside the chroot.
 .Sh CONFIGURATION
 With
 .Nm
@@ -133,6 +141,12 @@
 The default values shown here are those written in the template when
 issuing a maketemplate.
 .Bl -tag -width indent
+.It AUTO_PACKAGES
+A list of packages to automatically build during the
+.Sy auto
+target.
+A package is in the form section/name, like misc/colorls.
+Defaults to nothing.
 .It AUTO_TARGET
 The pkgsrc target to use when building packages in an automated fashion
 (using the
@@ -145,6 +159,12 @@
 as other values are useless.
 Defaults to
 .Ql package .
+.It BUILD_PACKAGES
+A list of packages to automatically build after the
+.Sy makeroot
+target.
+A package is in the form section/name, like misc/colorls.
+Defaults to nothing.
 .It BUILD_TARGET
 The pkgsrc target to use when building packages.
 It can contain any target supported by the pkgsrc system, but
@@ -186,7 +206,7 @@
 A list of packages to automatically install after the
 .Sy makeroot
 and after installing
-.Sy MAKE_PACKAGES .
+.Sy BUILD_PACKAGES .
 Each name must be the full package name, including the tgz suffix.
 Packages are searched inside
 .Pa $REAL_PACKAGES/All .
@@ -195,12 +215,6 @@
 Where binary packages get installed.
 Defaults to
 .Pa /usr/pkg .
-.It MAKE_PACKAGES
-A list of packages to automatically build after the
-.Sy makeroot
-target.
-A package is in the form section/name, like misc/colorls.
-Defaults to nothing.
 .It MKCONF_VARS
 A list of variable names that will be appended to the generated
 .Pa /etc/mk.conf
@@ -269,9 +283,7 @@
 .It USE_AUDIT_PACKAGES
 If set to
 .Ql yes ,
-install the
-.Pa security/audit-packages
-package inside the chroot and let
+let
 .Nm
 handle the
 .Pa vulnerabilities
@@ -369,20 +381,22 @@
 Mount options.
 Defaults to
 .Sy -t null -o ro .
-.It MOUNT_SCRIPT
-Pathname to a script to run after the file systems are mounted.
-Two arguments are given to it:
+.It MOUNT_HOOKS
+A whitespace separated list of functions or external scripts to be executed
+after file systems are mounted.
+Two arguments are given to each of them:
 .Ar $DESTDIR ,
 and the word
 .Ar mount .
-Defaults to the empty value i.e. no script is to be run.
-.It UMOUNT_SCRIPT
-Pathname to a script to run before the file systems are unmounted.
-Two arguments are given to it:
+Defaults to nothing.
+.It UMOUNT_HOOKS
+A whitespace separated list of functions or external scripts to be executed
+before file systems are unmounted.
+Two arguments are given to each of them:
 .Ar $DESTDIR ,
 and the word
 .Ar umount .
-Defaults to the empty value i.e. no script is to be run.
+Defaults to nothing.
 .El
 .Sh TARGETS
 A target specifies what
@@ -428,8 +442,14 @@
 For this to be useful, you need to set
 .Sy REAL_PACKAGES
 and use
-.Sy MAKE_PACKAGES
+.Sy AUTO_PACKAGES
 or pass package names through the command line.
+.Pp
+If the magic work
+.Ql resume
+is passed as the unique argument to this target,
+.Nm
+will attempt to resume a previous automatic build for the given configuration.
 .El
 .Sh NOTES
 This program uses nullfs to create virtual copies of real trees inside the
@@ -437,7 +457,8 @@
 .Pp
 You need to install the
 .Pa security/audit-packages
-package in the host system if you want security checks to work inside the
+package in the host system (and have an up to date vulnerabilities database)
+if you want security checks to work inside the
 chroot environment.
 .Sh SEE ALSO
 .Xr pkg_delete 1 ,
diff -r 4e5d909311ea -r 40126b06c8ed pkgtools/pkg_comp/files/pkg_comp.sh
--- a/pkgtools/pkg_comp/files/pkg_comp.sh       Fri Jan 23 09:47:22 2004 +0000
+++ b/pkgtools/pkg_comp/files/pkg_comp.sh       Fri Jan 23 09:48:53 2004 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: pkg_comp.sh,v 1.15 2004/01/08 14:06:15 jmmv Exp $
+# $NetBSD: pkg_comp.sh,v 1.16 2004/01/23 09:48:53 jmmv Exp $
 #
 # pkg_comp - Build packages inside a clean chroot environment
 # Copyright (c) 2002, 2003, 2004 Julio M. Merino Vidal <jmmv%NetBSD.org@localhost>
@@ -41,15 +41,23 @@
 # as they require special handling.
 _MKCONF_VARS="OBJMACHINE MKOBJDIRS BSDSRCDIR WRKOBJDIR DISTDIR PACKAGES \
               PKG_DEVELOPER CLEANDEPENDS LOCALBASE PKG_SYSCONFBASE \
-              CFLAGS CPPFLAGS CXXFLAGS USE_AUDIT_PACKAGES PKGVULNDIR"
+              CFLAGS CPPFLAGS CXXFLAGS USE_AUDIT_PACKAGES PKGVULNDIR \
+              USE_XPKGWEDGE"
 
 _TEMPLATE_VARS="DESTDIR ROOTSHELL COPYROOTCFG BUILD_TARGET DISTRIBDIR SETS \
-                SETS_X11 USE_XPKGWEDGE REAL_SRC REAL_SRC_OPTS REAL_PKGSRC \
+                SETS_X11 REAL_SRC REAL_SRC_OPTS REAL_PKGSRC \
                 REAL_PKGSRC_OPTS REAL_DISTFILES REAL_DISTFILES_OPTS \
                 REAL_PACKAGES REAL_PACKAGES_OPTS REAL_PKGVULNDIR \
-                NETBSD_RELEASE MOUNT_SCRIPT UMOUNT_SCRIPT SYNC_UMOUNT \
-                AUTO_TARGET"
+                NETBSD_RELEASE MOUNT_HOOKS UMOUNT_HOOKS SYNC_UMOUNT \
+                AUTO_TARGET AUTO_PACKAGES BUILD_PACKAGES"
+
+_BUILD_RESUME=
 
+# env_clean
+#
+#   Sets all variables that may appear in the config file to the null
+#   string, so that we know the environment is in a consistent state.
+#
 env_clean()
 {
     MKCONF_VARS=""
@@ -59,6 +67,12 @@
     done
 }
 
+# env_setdefaults
+#
+#   Sets several reasonable defaults for many variables we will use.
+#   Also checks for deprecated variables and warns the user about them.
+#   To be called after reading the configuration file.
+#
 env_setdefaults()
 {
     MKCONF_VARS="$MKCONF_VARS ${_MKCONF_VARS}"
@@ -81,6 +95,7 @@
     : ${USE_GCC3:=no}
     : ${USE_AUDIT_PACKAGES:=yes}
     : ${PKGVULNDIR:=/usr/pkg/share}
+    : ${USE_XPKGWEDGE:=yes}
 
     # Default values for global variables used in the script.
     : ${DESTDIR:=/var/chroot/pkg_comp/default}
@@ -91,7 +106,6 @@
     : ${DISTRIBDIR:=/var/pub/NetBSD}
     : ${SETS:=base.tgz comp.tgz etc.tgz text.tgz}
     : ${SETS_X11:=xbase.tgz xcomp.tgz xcontrib.tgz xfont.tgz xmisc.tgz xserver.tgz}
-    : ${USE_XPKGWEDGE:=yes}
     : ${REAL_SRC:=/usr/src}
     : ${REAL_SRC_OPTS:=-t null -o ro}
     : ${REAL_PKGSRC:=/usr/pkgsrc}
@@ -102,27 +116,65 @@
     : ${REAL_PACKAGES_OPTS:=-t null -o rw}
     : ${REAL_PKGVULNDIR:=/usr/pkgsrc/distfiles}
     : ${NETBSD_RELEASE:=no}
-    : ${MOUNT_SCRIPT:=}
-    : ${UMOUNT_SCRIPT:=}
+    : ${MOUNT_HOOKS:=}
+    : ${UMOUNT_HOOKS:=}
     : ${SYNC_UMOUNT:=no}
+
+    if [ -n "${MAKE_PACKAGES}" ]; then
+        warn "MAKE_PACKAGES is deprecated; use {AUTO,BUILD}_PACKAGES instead."
+        : ${AUTO_PACKAGES:=${MAKE_PACKAGES}}
+        : ${BUILD_PACKAGES:=${MAKE_PACKAGES}}
+    fi
+
+    if [ -n "${MOUNT_SCRIPT}" ]; then
+        warn "MOUNT_SCRIPT is deprecated; use MOUNT_HOOKS instead."
+        : ${MOUNT_HOOKS:=${MOUNT_SCRIPT}}
+    fi
+
+    if [ -n "${UMOUNT_SCRIPT}" ]; then
+        warn "UMOUNT_SCRIPT is deprecated; use UMOUNT_HOOKS instead."
+        : ${UMOUNT_HOOKS:=${UMOUNT_SCRIPT}}
+    fi



Home | Main Index | Thread Index | Old Index