changeset 1308:37371bb066c1

Add script.nolink option for packages that really don't like the whole 'tree of symlinks' thing. Migrate vim and remove the -L hack.
author Rob Landley <rob@landley.net>
date Wed, 01 Dec 2010 17:57:46 -0600
parents 6ea4204209d0
children bc558d4af17e
files sources/control-images/bootstrap-skeleton/mnt/build-one-package.sh sources/control-images/lfs-bootstrap/mnt/build/vim.nolink sources/control-images/lfs-bootstrap/mnt/build/vim.sh
diffstat 3 files changed, 41 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/sources/control-images/bootstrap-skeleton/mnt/build-one-package.sh	Wed Dec 01 03:03:18 2010 -0600
+++ b/sources/control-images/bootstrap-skeleton/mnt/build-one-package.sh	Wed Dec 01 17:57:46 2010 -0600
@@ -10,14 +10,22 @@
 
 set_titlebar "$1"
 
-if [ -d "/mnt/packages/$1" ]
+# Three types of /mnt/build scripts:
+#
+# $1.nosrc - no source code in /mnt/build, perform no setup/cleanup.
+# $1.sh - source is symlink tree to "/mnt/build/$1".  This is faster and uses
+#         less disk space but confuses some packages.
+# $1.nolink - source is conventional copy of /mnt/build/$1
+
+if [ ! -e "/mnt/build/$1.nosrc" ]
 then
+  [ -e "/mnt/build/$1.nolink" ] && LINKTYPE=dp || LINKTYPE=s
 
-  # Snapshot source
+  # Snapshot source from /mnt/build/$1 to /home/$1
 
   cd /home &&
   rm -rf "/home/$1" &&
-  cp -sfR "/mnt/packages/$1" "$1" &&
+  cp -${LINKTYPE}fR "/mnt/packages/$1" "$1" &&
   cd "$1" || exit 1
 
   # Lobotomize config.guess so it won't complain about unknown target types.
@@ -39,7 +47,7 @@
 # Call package build script
 
 mkdir -p /home/log
-time "/mnt/build/${1}.$EXT" 2>&1 | tee "/home/log/$1.log"
+time "/mnt/build/$1".* 2>&1 | tee "/home/log/$1.log"
 if [ $? -ne 0 ]
 then
   echo "$1" died >&2
@@ -48,7 +56,7 @@
 
 # Delete copy of source if build succeeded
 
-if [ -d "/mnt/packages/$1" ]
+if [ ! -z "$LINKTYPE" ]
 then
   cd /home &&
   rm -rf "$1" &&
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/vim.nolink	Wed Dec 01 17:57:46 2010 -0600
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+sed -i '$a #define SYS_VIMRC_FILE "/etc/vimrc"' src/feature.h &&
+sed -i 's/find /find -L /g' Makefile src/Makefile &&
+
+./configure --prefix=/usr --enable-multibyte &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  make test || exit 1
+fi
+
+make install &&
+ln -sf vim /usr/bin/vi || exit 1
+for i in /usr/share/man/man1/vim.1 /usr/share/man/*/man1/vim.1
+do
+  ln -sf vim.1 $(dirname $i)/vi.1 || exit 1
+done
+
+cat > /etc/vimrc << "EOF"
+set nocompatible
+set backspace=2
+syntax on
+if (&term == "iterm") || (&term == "putty")
+  set background=dark
+endif
+EOF
--- a/sources/control-images/lfs-bootstrap/mnt/build/vim.sh	Wed Dec 01 03:03:18 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-sed -i '$a #define SYS_VIMRC_FILE "/etc/vimrc"' src/feature.h &&
-sed -i 's/find /find -L /g' Makefile src/Makefile &&
-
-./configure --prefix=/usr --enable-multibyte &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  make test || exit 1
-fi
-
-make install &&
-ln -sf vim /usr/bin/vi || exit 1
-for i in /usr/share/man/man1/vim.1 /usr/share/man/*/man1/vim.1
-do
-  ln -sf vim.1 $(dirname $i)/vi.1 || exit 1
-done
-
-cat > /etc/vimrc << "EOF"
-set nocompatible
-set backspace=2
-syntax on
-if (&term == "iterm") || (&term == "putty")
-  set background=dark
-endif
-EOF