changeset 1282:44073390f2b3

Move the manifest tracking from build-one-package to run-build-stages and make it actually work.
author Rob Landley <rob@landley.net>
date Thu, 11 Nov 2010 04:49:16 -0600
parents 720b109bc978
children ba8e5317049c
files sources/control-images/bootstrap-skeleton/files/build-one-package.sh sources/control-images/bootstrap-skeleton/files/run-build-stages.sh
diffstat 2 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/sources/control-images/bootstrap-skeleton/files/build-one-package.sh	Tue Nov 09 20:43:04 2010 -0600
+++ b/sources/control-images/bootstrap-skeleton/files/build-one-package.sh	Thu Nov 11 04:49:16 2010 -0600
@@ -1,16 +1,12 @@
-#!/bin/sh
+#!/bin/ash
+
+# Yes, ash.  Because neither bash 2 nor hush support -o pipefail
+
+set -o pipefail
 
 source /mnt/functions.sh || exit 1
 
-# build $1 using manifest file $2
-
-# Is it already installed?
-
-if [ ! -z "$2" ] && [ -z "$FORCE" ] && grep -q "$1" "$2"
-then
-  echo "$1 already installed"
-  exit 0
-fi
+# build $1
 
 set_titlebar "$1"
 
@@ -42,25 +38,18 @@
 
 # Call package build script
 
-if ! time "/mnt/build/${1}.$EXT"
+mkdir -p /home/log
+time "/mnt/build/${1}.$EXT" | tee "/home/log/$1.log"
+if [ $? -ne 0 ]
 then
   echo "$1" died >&2
   exit 1
 fi
 
-# Add file to manifest, removing previous version (if any).
-
-if [ ! -z "$2" ]
-then
-  sed -i -e "/$1/d" "$2" &&
-  echo "$1" >> "$2" || exit 1
-fi
+# Delete copy of source if build succeeded
 
 if [ -d "/mnt/packages/$1" ]
 then
-
-  # Delete copy of source if build succeeded
-
   cd /home &&
   rm -rf "$1" &&
   sync || exit 1
--- a/sources/control-images/bootstrap-skeleton/files/run-build-stages.sh	Tue Nov 09 20:43:04 2010 -0600
+++ b/sources/control-images/bootstrap-skeleton/files/run-build-stages.sh	Thu Nov 11 04:49:16 2010 -0600
@@ -2,8 +2,19 @@
 
 # Run each of the individual package build files, in order.
 
+[ -z "$MANIFEST" ] && MANIFEST=/usr/src/packages
+touch "$MANIFEST"
+  
 [ -z "$FILTER" ] || FILTER="/$FILTER/d"
 for i in $(sed -r -e "$FILTER" -e "s@#.*@@" /mnt/package-list)
 do
+  if [ -z "$FORCE" ] && grep -q "$i" "$MANIFEST"
+  then
+    echo "$i already installed"
+    continue
+  fi
   /mnt/build-one-package.sh "$i" || exit 1
+  
+  sed -i -e "/$i/d" "$MANIFEST" &&
+  echo "$i" >> "$MANIFEST" || exit 1
 done