From owner-svn-ports-head@FreeBSD.ORG Tue Oct 8 16:05:00 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2D102CD3; Tue, 8 Oct 2013 16:05:00 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 198052D4D; Tue, 8 Oct 2013 16:05:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98G4xte007780; Tue, 8 Oct 2013 16:04:59 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98G4xqA007777; Tue, 8 Oct 2013 16:04:59 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201310081604.r98G4xqA007777@svn.freebsd.org> From: Chris Rees Date: Tue, 8 Oct 2013 16:04:59 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r329805 - in head/ports-mgmt/tinderbox: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Oct 2013 16:05:00 -0000 Author: crees Date: Tue Oct 8 16:04:59 2013 New Revision: 329805 URL: http://svnweb.freebsd.org/changeset/ports/329805 Log: Enable the dependency calculation in chroot patch; massaged in from upstream Approved by: itetcu (maintainer) Added: head/ports-mgmt/tinderbox/files/patch-chroot (contents, props changed) Modified: head/ports-mgmt/tinderbox/Makefile Modified: head/ports-mgmt/tinderbox/Makefile ============================================================================== --- head/ports-mgmt/tinderbox/Makefile Tue Oct 8 16:03:48 2013 (r329804) +++ head/ports-mgmt/tinderbox/Makefile Tue Oct 8 16:04:59 2013 (r329805) @@ -3,6 +3,7 @@ PORTNAME= tinderbox PORTVERSION= 4.0.1 +PORTREVISION= 1 CATEGORIES= ports-mgmt MASTER_SITES= http://tinderbox.marcuscom.com/ \ http://T32.TecNik93.com/FreeBSD/ports/${PORTNAME}/sources/ @@ -11,6 +12,8 @@ DIST_SUBDIR= ${PORTNAME} MAINTAINER= itetcu@FreeBSD.org COMMENT= Port build tinderbox system +RUN_DEPENDS= dialog4ports-static:${PORTSDIR}/ports-mgmt/dialog4ports-static + CONFLICTS= tinderbox-devel-[0-9]* OPTIONS_MULTI= DB Added: head/ports-mgmt/tinderbox/files/patch-chroot ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/tinderbox/files/patch-chroot Tue Oct 8 16:04:59 2013 (r329805) @@ -0,0 +1,365 @@ +Calculate dependencies in a chroot + +Index: lib/makemake +=================================================================== +RCS file: /space/cvs/marcuscom-cvs/portstools/tinderbox/lib/makemake,v +retrieving revision 1.48 +diff -u -r1.48 makemake +--- lib/makemake 6 Nov 2012 21:55:47 -0000 1.48 ++++ lib/makemake 5 Oct 2013 16:30:30 -0000 +@@ -135,11 +135,12 @@ + my ( + %pkgdir, %pkgdeps, %pkgedeps, %pkgpdeps, %pkgfdeps, + %pkgbdeps, %pkgrdeps, @duds, $portbase, $makecache, +- %pkgtdeps, %pkgpkgdeps, ++ %pkgtdeps, %pkgpkgdeps, $chroot, + ); + + $portbase = $ENV{'PORTSDIR'}; +-$makecache = new Tinderbox::MakeCache($portbase, $ENV{'PKGSUFFIX'}); ++$chroot = $ENV{'CHROOT'}; ++$makecache = new Tinderbox::MakeCache($portbase, $chroot, $ENV{'PKGSUFFIX'}); + + while (scalar(@PORTS)) { + my $port = shift @PORTS; +@@ -148,7 +149,7 @@ + + next if (defined($pkgdir{$portdir})); + +- $tportdir = "$portbase/$portdir"; ++ $tportdir = "$chroot$portbase/$portdir"; + if (!-d $tportdir) { + print STDERR "ERROR: Directory $tportdir does not exist.\n"; + if (defined($pkgdeps{$portdir}) +Index: lib/tc_command.pl +=================================================================== +RCS file: /space/cvs/marcuscom-cvs/portstools/tinderbox/lib/tc_command.pl,v +retrieving revision 1.184 +diff -u -r1.184 tc_command.pl +--- lib/tc_command.pl 28 Apr 2013 20:05:40 -0000 1.184 ++++ lib/tc_command.pl 5 Oct 2013 16:30:31 -0000 +@@ -1536,7 +1536,8 @@ + sub addPortToOneBuild { + my $build = $ds->getBuildByName($opts->{'b'}); + my $makecache = +- new Tinderbox::MakeCache($ENV{'PORTSDIR'}, $ENV{'PKGSUFFIX'}); ++ new Tinderbox::MakeCache($ENV{'PORTSDIR'}, $ENV{'CHROOT'}, ++ $ENV{'PKGSUFFIX'}); + my @bports = (); + + if (!$opts->{'d'}) { +@@ -3414,12 +3415,14 @@ + my $cache = shift; + my $deps = shift; + +- my $portdir = $ENV{'PORTSDIR'} . "/" . $port; ++ my $portsdir = $ENV{'CHROOT'} . $ENV{'PORTSDIR'}; ++ ++ my $portdir = $portsdir . "/" . $port; + return undef if (!-d $portdir); + + # Canonicalize the port directory. + $port = abs_path($portdir); +- $port =~ s|$ENV{'PORTSDIR'}/||; ++ $port =~ s|$portsdir/||; + + if (defined($deps)) { + my @list; +Index: lib/tc_command.sh +=================================================================== +RCS file: /space/cvs/marcuscom-cvs/portstools/tinderbox/lib/tc_command.sh,v +retrieving revision 1.175 +diff -u -r1.175 tc_command.sh +--- lib/tc_command.sh 7 Aug 2013 18:25:52 -0000 1.175 ++++ lib/tc_command.sh 5 Oct 2013 16:30:32 -0000 +@@ -1385,7 +1385,7 @@ + cleanDirs ${buildName} ${BUILD_DIR} + + if [ "${MD_FSTYPE}" = "ufs" -o "${MD_FSTYPE}" = "zfs" ]; then +- if [ -n "${MD_SIZE}" -a ${MD_SIZE%[a-zA-Z]} -gt 0 ]; then ++ if [ -n "${MD_SIZE}" ] && [ ${MD_SIZE%[a-zA-Z]} -gt 0 ]; then + # setup md (ramdisk) backing for the build + mdconfig -a -t swap -s ${MD_SIZE} > /tmp/tinderbuild_md.${build} + read MD_UNIT /dev/null) + else +- pdirs="${PORTSDIR}/${portDir}" ++ pdirs="${portDir}" + fi + rmconfig=true + if [ ${cleanOptions} -eq 1 ]; then +@@ -2108,28 +2139,38 @@ + fi + fi + for pdir in ${pdirs}; do +- if [ -d ${pdir} ]; then ++ if [ -d ${CHROOT}${PORTSDIR}/${pdir} ]; then + export TERM=${save_TERM} ++ if ! cp /usr/local/bin/dialog4ports-static ${CHROOT}/; then ++ echo "In order to customise OPTIONS, you must install" ++ echo "ports-mgmt/dialog4ports-static." ++ break ++ fi + read -p "Generating options for ${build}; hit Enter to continue..." key + echo "" + if [ -z "${norecurse}" ]; then +- ( cd ${pdir} && ${rmconfig} \ +- && make -k config-recursive ) ++ chroot ${CHROOT} /bin/sh -c \ ++ "cd ${PORTSDIR}/${pdir} && ${rmconfig} && \ ++ make -k DIALOG4PORTS=/dialog4ports-static \ ++ config-recursive" + else +- ( cd ${pdir} && ${rmconfig} \ +- && make config ) ++ chroot ${CHROOT} /bin/sh -c \ ++ "cd ${PORTSDIR}/${pdir} && ${rmconfig} && \ ++ make DIALOG4PORTS=/dialog4ports-static config" + fi + fi + done + fi + ++ ${tc} addPortToOneBuild -b ${build} ${portDir:+-d} ${portDir} ${norecurse} ++ + if [ -n "${save_SRCBASE}" ]; then + export SRCBASE=${save_SRCBASE} + else + unset SRCBASE + fi + +- addPortToBuild_cleanup ${jail} ${portsTree} ++ addPortToBuild_cleanup ${jail} ${portsTree} ${build} + } + + addPort () { +Index: lib/tinderlib.sh +=================================================================== +RCS file: /space/cvs/marcuscom-cvs/portstools/tinderbox/lib/tinderlib.sh,v +retrieving revision 1.83 +diff -u -r1.83 tinderlib.sh +--- lib/tinderlib.sh 10 Jun 2013 16:49:51 -0000 1.83 ++++ lib/tinderlib.sh 5 Oct 2013 16:30:32 -0000 +@@ -498,9 +498,7 @@ + save_IFS=${IFS} + IFS=' + ' +- # Allow SRCBASE to be overridden +- eval "export SRCBASE=${SRCBASE:-`realpath $(tinderLoc jail ${jail})/src`}" \ +- >/dev/null 2>&1 ++ # Do not set SRCBASE here-- we use chroots nowadays so /usr/src is there + + # Set ARCH (needed for cross-building) + export ARCH=$(${tc} getJailArch -j ${jail}) +@@ -524,13 +522,6 @@ + eval "export __MAKE_CONF=${jailBase}/make.conf" >/dev/null 2>&1 + eval "export LOCALBASE=/nonexistentlocal" >/dev/null 2>&1 + eval "export PKG_DBDIR=/nonexistentdb" >/dev/null 2>&1 +- if [ x"${OPTIONS_ENABLED}" != x"1" ]; then +- eval "export PORT_DBDIR=/nonexistentportdb" >/dev/null 2>&1 +- else +- optionsDir=$(tinderLoc options ${build}) +- +- eval "export PORT_DBDIR=${optionsDir}" >/dev/null 2>&1 +- fi + eval "export LINUXBASE=/nonexistentlinux" >/dev/null 2>&1 + eval "unset DISPLAY" >/dev/null 2>&1 + } +Index: lib/Tinderbox/MakeCache.pm +=================================================================== +RCS file: /space/cvs/marcuscom-cvs/portstools/tinderbox/lib/Tinderbox/MakeCache.pm,v +retrieving revision 1.12 +diff -u -r1.12 MakeCache.pm +--- lib/Tinderbox/MakeCache.pm 4 Mar 2012 12:53:08 -0000 1.12 ++++ lib/Tinderbox/MakeCache.pm 5 Oct 2013 16:30:32 -0000 +@@ -49,6 +49,7 @@ + CACHE => undef, + SEEN => undef, + BASEDIR => shift, ++ CHROOT => shift, + }, $name; + + $self; +@@ -67,7 +68,10 @@ + + $tmp = '-V ' . join(' -V ', @makeTargets); + my $dir = $self->{BASEDIR} . '/' . $port; +- @ret = split("\n", `cd $dir && make $tmp`); ++ my $cmd = "cd $dir && make $tmp"; ++ $cmd = "chroot $self->{CHROOT} /bin/sh -c '$cmd'"; ++ ++ @ret = split("\n", `$cmd`); + + foreach $tmp (@makeTargets) { + $self->{CACHE}->{$port}{$tmp} = shift @ret; +? .fslckout +? .fslckout-mjFA3F63973 +Index: lib/tc_command.sh +=================================================================== +RCS file: /space/cvs/marcuscom-cvs/portstools/tinderbox/lib/tc_command.sh,v +retrieving revision 1.176 +diff -u -r1.176 tc_command.sh +--- lib/tc_command.sh 7 Oct 2013 16:36:54 -0000 1.176 ++++ lib/tc_command.sh 7 Oct 2013 18:34:20 -0000 +@@ -2049,6 +2049,7 @@ + cleanupMounts -t buildoptions -b ${build} + cleanupMounts -t jail -j ${jail} + cleanupMounts -t portstree -p ${portsTree} ++ cleanenv + } + + addPortToBuild () {