head 1.3; access; symbols pkgsrc-2013Q2:1.2.0.14 pkgsrc-2013Q2-base:1.2 pkgsrc-2013Q1:1.2.0.12 pkgsrc-2013Q1-base:1.2 pkgsrc-2012Q4:1.2.0.10 pkgsrc-2012Q4-base:1.2 pkgsrc-2012Q3:1.2.0.8 pkgsrc-2012Q3-base:1.2 pkgsrc-2012Q2:1.2.0.6 pkgsrc-2012Q2-base:1.2 pkgsrc-2012Q1:1.2.0.4 pkgsrc-2012Q1-base:1.2 pkgsrc-2011Q4:1.2.0.2 pkgsrc-2011Q4-base:1.2; locks; strict; comment @# @; 1.3 date 2013.08.15.11.12.06; author marino; state dead; branches; next 1.2; commitid H8gHqh7qKxKFBx1x; 1.2 date 2011.11.14.02.00.20; author marino; state Exp; branches; next 1.1; 1.1 date 2011.11.02.21.13.23; author marino; state Exp; branches; next ; desc @@ 1.3 log @Remove pkgtools/tinderbox-dragonfly This package is no longer in use, and is far behind upstream now. It is heavily customized so maintenance is far from trivial. There were no objections to the announcement of my intentions to remove this package which I made on package-users@@ a month ago. I feel it is better to retire this package than allow it to bitrot further. @ text @$NetBSD: patch-aj,v 1.2 2011/11/14 02:00:20 marino Exp $ --- ../FreeBSD/lib/buildscript 2011-10-16 00:52:55.000000000 +0000 +++ lib/buildscript @@@@ -8,7 +8,7 @@@@ cleanup() { if [ -e ${dir}/.keep ]; then cd ${dir} - objdir=$(make -V WRKDIR) + objdir=`bmake -V '\${WRKDIR}'` tar cfjC /tmp/work.tbz ${objdir}/.. work fi @@@@ -36,7 +36,6 @@@@ add_pkg() { for i in $pkgs; do echo "pkg_add $i" base=$(basename $i .tgz) - base=$(basename $base .tbz) if pkg_info -q -e $base; then echo "skipping $base, already added" else @@@@ -48,6 +47,8 @@@@ add_pkg() { fi done fi + # pkgsrc requires PKG_PATH variable be unset + unset PKG_PATH } del_pkg() { @@@@ -58,6 +59,8 @@@@ del_pkg() { if [ ! -z "${pkgs}" ]; then recursion=1 dellist="" + locklist="" + recursion_virgin=1 while [ $recursion -eq 1 ]; do unset delpkg nextpkg recursion=0 @@@@ -72,6 +75,27 @@@@ del_pkg() { fi done pkgs="${nextpkg}" + # Apparently pkgsrc packages can remain installed and in the /var + # database even after pkg_delete -f command. This could send the + # script into an infinite recursion loop because Tinderbox doesn't + # think that can happen. To recover from this, if we find a repeating + # recursion pattern with an empty delete pattern, bail out. + if [ -z "${delpkg}" ]; then + if [ "${recursion}" -eq 1 ]; then + if [ "${recursion_virgin}" -eq 1 ]; then + locklist="${pkgs}" + recursion_virgin=0 + else + if [ "${pkgs}" = "${locklist}" ]; then + delpkg="${pkgs}" + pkgs="" + recursion=0 + fi + fi + fi + else + recursion_virgin=1 + fi if [ "$dellist" != "" -a "$dellist" = "$delpkg" ]; then echo "deleted list =\""$dellist"\", packages to delete ="\"$delpkg\" #" echo "The following packages were left behind (perhaps your dependency list is incomplete):" @@@@ -91,6 +115,37 @@@@ del_pkg() { done fi find /var/db/pkg -type f -empty -delete + # pkgsrc requires PKG_PATH variable be unset + unset PKG_PATH +} + +get_package_options() { + # If the option file exists, it's stored in PKG_OPTIONS_FILE env var. + # The format is ${DISTNAME}:jobs override:options list + # example: gcc-4.6.1::-gcc-fortran + # In this example, there is no makejob override, fortran removed + # example: gawk-3.1.8:1:portals + # In the above example, MAKE_JOBS=1, portals option added + # Don't include any "nbX" suffixes, that is ${PKGNAME}. + # Use the "DISTNAME" definition in the makefile. + + INFO_DISTNAME=$1 + MAKEJOBS_OVERRIDE= + SPECIFIC_OPTIONS= + if [ -z "${PKG_OPTIONS_FILE}" ]; then + return + fi + + instructions=`grep ${INFO_DISTNAME}: ${PKG_OPTIONS_FILE}` + if [ -z "${instructions}" ]; then + return + fi + + test_override=`echo ${instructions} | awk 'BEGIN {FS=":"}; /^.+:[0-9]+:/ {print $2}'` + if [ -n "{test_override}" ]; then + MAKEJOBS_OVERRIDE="${test_override}" + fi + SPECIFIC_OPTIONS="`echo ${instructions} | awk 'BEGIN {FS=":"}; /^.+:[0-9]*:/ {print $3}'`" } dir=$1 @@@@ -102,35 +157,42 @@@@ FD=$5 BD=$6 RD=$7 TD=$8 -PLISTCHECK=$9 +pkgname=$9 +PLISTCHECK=${10} L=$(echo ${LOCALBASE} | sed 's,^/,,') +export NO_PKGTOOLS_REQD_CHECK=1 +export WRKOBJDIR=/work + +cd $dir || exit 1 + +INFO_OPTVAR=`bmake -V '\${PKG_OPTIONS_VAR}'` +get_package_options `bmake -V '\${DISTNAME}'` + if [ $phase = 1 ]; then - cd $dir || exit 1 + INFO_MAINTAINER=`bmake -V '\${MAINTAINER}'` + INFO_PREFIX=`bmake -V '\${PREFIX}'` echo "build started at $(date)" echo "port directory: ${dir}" echo "building for: $(uname -rm)" - echo "maintained by: $(make maintainer)" - echo "Makefile ident: $(ident ${dir}/Makefile | grep 'FreeBSD:' | sed 's/^[ \t]*//')" - echo "prefixes: LOCALBASE=${L} PREFIX=$(make -V PREFIX)" + echo "maintained by: ${INFO_MAINTAINER}" + echo "Makefile ident: $(ident ${dir}/Makefile | grep 'NetBSD:' | sed 's/^[ \t]*//')" + echo "prefixes: LOCALBASE=${L} PREFIX=${INFO_PREFIX}" echo "Begin Configuration:" echo "---Begin Environment---" - printenv + printenv | sort echo "---End Environment---" echo "" echo "---Begin OPTIONS List---" - make showconfig + if [ -n "${INFO_OPTVAR}" -a -n "${SPECIFIC_OPTIONS}" ]; then + bmake show-options ${INFO_OPTVAR}="${SPECIFIC_OPTIONS}" + else + bmake show-options + fi echo "---End OPTIONS List---" echo "" - optionsfile=$(make -V OPTIONSFILE) - if [ -f "${optionsfile}" ]; then - echo "---Begin OPTIONS configuration---" - cat ${optionsfile} - echo "---End OPTIONS configuration---" - echo "" - fi echo "End Configuration." echo "FETCH_DEPENDS=${FD}" @@@@ -165,6 +227,7 @@@@ if [ $phase = 1 ]; then ./${L}/share/xml ./${L}/etc/gconf ./var/db/fontconfig +./distcache EOF # Record a "pristine" mtree. @@@@ -173,11 +236,11 @@@@ EOF add_pkg $FD cd $dir || exit 1 - pkgname=$(make package-name) + echo "================================================================" echo "========================================" - if /pnohang $TIMEOUT /tmp/make.log1 ${pkgname} make checksum; then + if /pnohang $TIMEOUT /tmp/make.log1 ${pkgname} bmake checksum; then cat /tmp/make.log1 echo "0" > /tmp/status else @@@@ -186,36 +249,41 @@@@ EOF else - cd $dir || exit 1 - pkgname=$(make package-name) - echo "================================================================" echo "========================================" add_pkg ${ED} + + # For an unfathomable reason, pkgsrc insists on bringing in build + # dependencies in order to extract the files. Not only is this + # annoying if you want to check the contents of the tarball and you + # have to build all the dependencies first, it means this script + # has to be reordered where build dependencies come in very early. + + add_pkg ${BD} + cd $dir - /pnohang $TIMEOUT /tmp/make.log2 ${pkgname} make extract || cleanup 2 + # The config options need to come here because make extract pulls in + # make configure first, which is where this input is needed. + if [ -n "${INFO_OPTVAR}" -a -n "${SPECIFIC_OPTIONS}" ]; then + /pnohang $TIMEOUT /tmp/make.log2 ${pkgname} bmake extract ${INFO_OPTVAR}="${SPECIFIC_OPTIONS}" || cleanup 2 + else + /pnohang $TIMEOUT /tmp/make.log2 ${pkgname} bmake extract || cleanup 2 + fi cat /tmp/make.log2 del_pkg ${ED} - # Fetch depends still need to be here for 'make extract' since that target - # always reruns 'make fetch' due to the lack of fetch cookie (and no place - # to put it since WRKDIR isn't created by 'make fetch') - del_pkg $FD - echo "================================================================" echo "========================================" add_pkg ${PD} cd $dir - /pnohang $TIMEOUT /tmp/make.log3 ${pkgname} make patch || cleanup 3 + /pnohang $TIMEOUT /tmp/make.log3 ${pkgname} bmake patch || cleanup 3 cat /tmp/make.log3 del_pkg ${PD} echo "================================================================" echo "========================================" - add_pkg ${BD} - # Files we do not care about changing between pre-build and post-cleanup cat > /tmp/mtree.buildexclude < /tmp/.set_${portdir} @@@@ -259,32 +327,32 @@@@ EOF rm -f /tmp/.set_${portdir} fi - /pnohang $TIMEOUT /tmp/make.log4 ${pkgname} make build || cleanup 4 + # MAKE_JOBS normally defined in $LOCALBASE/etc/mk.conf, but it's + # inside the tarball. By default it's not set, so we override it here. + # We can use the options file to specify exactly the number of jobs we want + + if [ -n "${MAKEJOBS_OVERRIDE}" ]; then + echo "=> Number jobs set to ${MAKEJOBS_OVERRIDE} in options file" + PORT_JOBS="MAKE_JOBS=${MAKEJOBS_OVERRIDE}" + else + ncpus=$(/sbin/sysctl hw.ncpu | awk '{print $2}') + if [ "${npcus}" = "1" ]; then + echo "=> Single job, only 1 CPU" + PORT_JOBS="MAKE_JOBS=1" + else + factor=$(echo "$ncpus*2+1" | /usr/bin/bc) + echo "=> Multiple CPUs: ${factor} jobs set" + PORT_JOBS="MAKE_JOBS=${factor}" + fi + fi + + /pnohang $TIMEOUT /tmp/make.log4 ${pkgname} bmake build ${PORT_JOBS} || cleanup 4 cat /tmp/make.log4 echo "================================================================" echo "========================================" - pkg_info | awk '{print $1}' | sort > /tmp/pkgs_pre_test - add_pkg ${TD} - pkg_info | awk '{print $1}' | sort > /tmp/pkgs_post_test - cd $dir - /pnohang $TIMEOUT /tmp/make.log5 ${pkgname} make -k regression-test - cat /tmp/make.log5 - - RTD=`comm -3 /tmp/pkgs_pre_test /tmp/pkgs_post_test | tr -d '\t'` - del_pkg ${RTD} - rm /tmp/pkgs_pre_test /tmp/pkgs_post_test - - mtree -X /tmp/mtree.buildexclude -x -f /tmp/mtree.prebuild -p / | egrep -v "^(${L}/var|${L}/lib/X11/xserver/SecurityPolicy|${L}/share/nls/POSIX|${L}/share/nls/en_US.US-ASCII|etc/services|compat |${L} |etc/manpath.config|etc/.*.bak|${L}/info/dir|${L}/lib/X11/fonts/.*/fonts\.|${L}/man/..( |/man. )|${L}/lib/X11/fonts/TrueType|${L}/etc/gconf/gconf.xml.defaults/%gconf-tree.*.xml|usr/X11R6 )" > /tmp/list.preinstall - - if [ -s /tmp/list.preinstall ]; then - echo "================================================================" - echo "Fatal error: filesystem was touched prior to 'make install' phase" - cat /tmp/list.preinstall - echo "================================================================" - cleanup 0 - fi + echo "Pkgsrc does not have per-package regression test capability, skipped." echo "================================================================" echo "========================================" @@@@ -306,7 +374,7 @@@@ EOF mtree -X /tmp/mtree.exclude -xcn -k uid,gid,mode -p / > /tmp/mtree cd $dir - if /pnohang $TIMEOUT /tmp/make.log6 ${pkgname} make install; then + if /pnohang $TIMEOUT /tmp/make.log6 ${pkgname} bmake install; then cat /tmp/make.log6 echo "0" > /tmp/status else @@@@ -316,14 +384,15 @@@@ EOF echo "================================================================" echo "========================================" cd $dir - if /pnohang $TIMEOUT /tmp/make.log7 ${pkgname} make package; then + echo "Starting make process for ${pkgname}" + if /pnohang $TIMEOUT /tmp/make.log7 ${pkgname} bmake package; then echo "0" > /tmp/status else echo "1" > /tmp/status fi cat /tmp/make.log7 - prefix=$(make -V PREFIX) + prefix=`bmake -V '\${PREFIX}'` du -skx / | awk '{print $1}' > /tmp/size del_pkg ${pkgname} @@@@ -349,14 +418,18 @@@@ EOF echo "================================================================" fi - echo + echo "=== Deleting /var/db/pkg/pkgdb.byfile.db" + rm -f /var/db/pkg/pkgdb.byfile.db + echo "=== Checking filesystem state" if [ -s /tmp/list4 ]; then echo "list of extra files and directories in / (not present before this port was installed but present after it was deinstalled)" cat /tmp/list4 - touch /tmp/leftovers + # Files left over here are okay as long as they are gone by list 6 + # Just list them for informational purposes, but don't act on it. + # touch /tmp/leftovers fi if [ -s /tmp/list5 ]; then echo "list of files present before this port was installed but missing after it was deinstalled)" @@@@ -373,9 +446,10 @@@@ EOF fi # BUILD_DEPENDS need to be present at install-time, e.g. gmake + # FETCH_DEPENDS contains the digests which is needed throught the process # Concatenate and remove duplicates - BRD=$(echo $BD $RD | tr ' ' '\n' | sort -u | tr '\n' ' ') - del_pkg ${BRD} + BRFD=$(echo $BD $RD $FD | tr ' ' '\n' | sort -u | tr '\n' ' ') + del_pkg ${BRFD} cd /var/db/pkg if [ $(echo $(echo * | wc -c)) != 2 ]; then echo "leftover packages:" * @@@@ -395,9 +469,6 @@@@ EOF grep ' missing$' /tmp/list3 > /tmp/list5 grep -vE ' (extra|missing)$' /tmp/list3 > /tmp/list6 if [ -n "${PLISTCHECK}" ]; then - if grep -vqE "(${L})/etc/" /tmp/list4; then - #echo "1" > /tmp/status - fi if [ -s /tmp/list5 ]; then #echo "1" > /tmp/status fi @@@@ -430,7 +501,7 @@@@ EOF if [ -e ${dir}/.keep ]; then cd ${dir} - objdir=$(make -V WRKDIR) + objdir=`bmake -V '\${WRKDIR}'` tar cfjC /tmp/work.tbz ${objdir}/.. work fi @ 1.2 log @pkgtools/tinderbox-dragonfly: Several bug fixes This update of tinderbox addresses several issues: 1) Updates obsolete failure message on options.mk 2) Adds support for PKG_DEVELOPER=yes 3) Switches build failure default to build only once, twice is the option. 4) Merge BOOTSTRAP_DEPENDS with FETCH_DEPENDS in order to maintain the same database structure as Tinderbox. Removes two patches. 5) Change behavior where leftover files immediately after package deinstall is no longer considered an error, but still list the files that do this. 6) Add a way out of an infinite recursion loop as seen when the package name changed between portbuild and buildscript (considered a safeguard). 7) Push the package name from portbuild to buildscript to avoid issue with php5 packages getting renamed to php53 (for example), which was the cause for the infinite loop on lang/pear. 8) Fix enterbuild by allowing it to properly detected when the port has entered the sleep state. 9) Fix php/pgsql bug on row limiting, should be fixed upstream for next released. Requires old patch to be reincarnated. 10) Fix PLIST, several files were missing 11) Add utility script to add all 10K packages to database (this takes several hours to do) @ text @d1 1 a1 1 $NetBSD$ @ 1.1 log @Import pkgtools/tinderbox-dragonfly Tinderbox is a well-known package building system for FreeBSD. This commit ports the original Tinderbox to DragonFly. The scripts are highly platform specific, so only one operating system can be supported per package. With interest, alternative versions such as tinderbox-netbsd and tinderbox-sunos could be developed fairly easily as they would share the pkgsrc-specific changes with this package. The repository for the project is: https://github.com/jrmarino/pkgsrc-tinderbox @ text @a4 8 @@@@ -1,6 +1,6 @@@@ #!/bin/sh -# usage: $0 DIRNAME PHASE ED PD FD BD RD TD [PLISTCHECK] +# usage: $0 DIRNAME PHASE ED PD FD BD RD TD SD [PLISTCHECK] # PHASE is 1 (checksum) or 2 (package) cleanup() { d31 38 a68 1 @@@@ -91,6 +92,37 @@@@ del_pkg() { d106 1 a106 1 @@@@ -102,37 +134,46 @@@@ FD=$5 d111 1 a111 1 +SD=$9 a120 1 +pkgname=`bmake -V '\${PKGNAME}'` a161 1 + echo "BOOTSTRAP_DEPENDS=${SD}" d163 1 a163 3 echo "PATCH_DEPENDS=${PD}" echo "EXTRACT_DEPENDS=${ED}" @@@@ -165,19 +206,20 @@@@ if [ $phase = 1 ]; then d171 2 a172 4 mtree -X /tmp/mtree.preexclude -xcn -k uid,gid,mode -p / > /tmp/mtree.pristine - add_pkg $FD + add_pkg $SD $FD d185 1 a185 1 @@@@ -186,15 +228,27 @@@@ EOF d217 6 a222 1 @@@@ -207,15 +261,13 @@@@ else d239 1 a239 1 @@@@ -247,7 +299,7 @@@@ EOF d244 1 a244 1 + portdir=$(echo ${dir} | sed -e 's|^/usr/pkg/||' -e 'y/\//_/') d248 1 a248 1 @@@@ -259,32 +311,32 @@@@ EOF d302 1 a302 1 @@@@ -306,7 +358,7 @@@@ EOF d311 1 a311 1 @@@@ -316,14 +368,14 @@@@ EOF d316 1 d329 1 a329 1 @@@@ -349,8 +401,10 @@@@ EOF d341 11 a351 1 @@@@ -374,8 +428,8 @@@@ EOF d354 1 d358 2 a359 2 + BRSD=$(echo $BD $RD $SD | tr ' ' '\n' | sort -u | tr '\n' ' ') + del_pkg ${BRSD} d363 11 a373 1 @@@@ -430,7 +484,7 @@@@ EOF @