pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/bootstrap * Move the "extra" scripts installed by boot...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/81d5f485a81c
branches:  trunk
changeset: 516210:81d5f485a81c
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Mon Jul 17 14:30:05 2006 +0000

description:
* Move the "extra" scripts installed by bootstrap for certain platforms
  into a separate package pkgtools/bootstrap-extras.  Teach the bootstrap
  script to look for those scripts from the bootstrap-extras package.

* When registering the installed software, set WRKOBJDIR to the bootstrap
  work directory to protect against a read-only pkgsrc tree.

diffstat:

 bootstrap/bootstrap           |   57 ++++---
 bootstrap/files/fakeldd       |    2 -
 bootstrap/files/install-sh.in |  291 ------------------------------------------
 bootstrap/files/mkdir-sh      |   45 ------
 bootstrap/files/strip-sh      |   26 ---
 bootstrap/mkbootstrapkit      |    5 +-
 6 files changed, 38 insertions(+), 388 deletions(-)

diffs (truncated from 559 to 300 lines):

diff -r cd6127aa12bb -r 81d5f485a81c bootstrap/bootstrap
--- a/bootstrap/bootstrap       Mon Jul 17 14:25:07 2006 +0000
+++ b/bootstrap/bootstrap       Mon Jul 17 14:30:05 2006 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.66 2006/07/14 23:19:15 jlam Exp $
+# $NetBSD: bootstrap,v 1.67 2006/07/17 14:30:05 jlam Exp $
 #
 #
 # Copyright (c) 2001-2002 Alistair G. Crooks.  All rights reserved.
@@ -174,7 +174,8 @@
                fi
                if [ `uname -r` -lt 6 ]; then
                        echo_msg "Installing fake ldd script"
-                       run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 755 files/fakeldd $prefix/sbin"
+                       run_cmd "$install_sh -c -o $user -g $group -m 755 ../pkgtools/bootstrap-extras/files/fakeldd $prefix/sbin"
+                       need_extras=yes
                        echo "LDD=                      $prefix/sbin/fakeldd" >> ${MKCONF_EXAMPLE}
                fi
                ;;
@@ -220,7 +221,7 @@
 mkdir_p()
 {
        for dir in $@; do
-               run_cmd "$shprog $wrkdir/install-sh -d -o $user -g $group $dir"
+               run_cmd "$install_sh -d -o $user -g $group $dir"
        done
 }
 
@@ -277,6 +278,7 @@
 done
 
 # set defaults for system locations if not already set by the user
+wrkobjdir=${wrkdir}/pkgsrc
 if [ "$ignoreusercheck" = "yes" ]; then
        [ -z "$prefix" ] && prefix=${HOME}/pkg
        [ -z "$pkgdbdir" ] && pkgdbdir=${prefix}/var/db/pkg
@@ -303,6 +305,7 @@
 bmakexenv=
 bmakexargs=
 tnftpxenv=
+need_extras=no
 case "$opsys" in
 Darwin)
        root_group=wheel
@@ -565,10 +568,10 @@
        fi
 fi
 
-if [ ! -x ${wrkdir}/install-sh ]; then
-       run_cmd "$sedprog -e 's|@DEFAULT_INSTALL_MODE@|'${default_install_mode-0755}'|' files/install-sh.in > $wrkdir/install-sh"
-       run_cmd "$chmodprog +x $wrkdir/install-sh"
-fi
+# build install-sh
+run_cmd "$sedprog -e 's|@DEFAULT_INSTALL_MODE@|'${default_install_mode-0755}'|' ../sysutils/install-sh/files/install-sh.in > $wrkdir/install-sh"
+run_cmd "$chmodprog +x $wrkdir/install-sh"
+install_sh="$shprog $wrkdir/install-sh"
 
 is_root
 if [ $? = 1 ]; then
@@ -696,28 +699,30 @@
        
 if [ "$need_bsd_install" = "yes" ]; then
        echo_msg "Installing BSD compatible install script"
-       run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 755 $wrkdir/install-sh $prefix/bin/install-sh"
+       run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/install-sh/install-sh $prefix/bin/install-sh"
        BSTRAP_ENV="INSTALL='$prefix/bin/install-sh -c' $BSTRAP_ENV"
        echo "TOOLS_PLATFORM.install?=  $prefix/bin/install-sh" >> ${MKCONF_EXAMPLE}
 fi
 
 if [ "$need_fixed_strip" = "yes" ] ; then
        echo_msg "Installing fixed strip script"
-       run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 755 files/strip-sh $prefix/bin/strip"
+       run_cmd "$install_sh -c -o $user -g $group -m 755 ../pkgtools/bootstrap-extras/files/strip-sh $prefix/bin/strip"
        echo "TOOLS_PLATFORM.strip?=            $prefix/bin/strip" >> ${MKCONF_EXAMPLE}
+       need_extras=yes
 fi
 
 if [ "$need_mkdir" = "yes" ]; then
        echo_msg "Installing fixed mkdir script \"mkdir-sh\""
-       run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 755 files/mkdir-sh $prefix/sbin/mkdir-sh"
-       echo "TOOLS_PLATFORM.mkdir?=            $prefix/sbin/mkdir-sh -p" >> ${MKCONF_EXAMPLE}
+       run_cmd "$install_sh -c -o $user -g $group -m 755 ../pkgtools/bootstrap-extras/files/mkdir-sh $prefix/bin/mkdir-sh"
+       echo "TOOLS_PLATFORM.mkdir?=            $prefix/bin/mkdir-sh -p" >> ${MKCONF_EXAMPLE}
+       need_extras=yes
 fi
 
 echo_msg "Installing bmake"
 copy_src ../devel/bmake/files bmake
 run_cmd "(cd $wrkdir/bmake && env CPPFLAGS='$CPPFLAGS -I../../libnbcompat' LDFLAGS='$LDFLAGS -L../../libnbcompat' LIBS='-lnbcompat' $bmakexenv $shprog ./boot-strap -q -o $opsys --prefix=$prefix 
--sysconfdir=$sysconfdir --mksrc none --with-default-sys-path="$prefix/share/mk" $bmakexargs)"
-run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 755 $wrkdir/bmake/$opsys/bmake $prefix/bin/bmake"
-run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 644 $wrkdir/bmake/bmake.1 $mandir/man1/bmake.1"
+run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/bmake/$opsys/bmake $prefix/bin/bmake"
+run_cmd "$install_sh -c -o $user -g $group -m 644 $wrkdir/bmake/bmake.1 $mandir/man1/bmake.1"
 
 bmake=$prefix/bin/bmake
 
@@ -726,8 +731,8 @@
 yes)   echo_msg "Installing awk"
        copy_src ../lang/nawk/files awk
        run_cmd "(cd $wrkdir/awk && $bmake)"
-       run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $prefix/bin/nawk"
-       run_cmd "$shprog $wrkdir/install-sh -c -o $user -g $group -m 644 $wrkdir/awk/nawk.1 $mandir/man1/nawk.1"
+       run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $prefix/bin/nawk"
+       run_cmd "$install_sh -c -o $user -g $group -m 644 $wrkdir/awk/nawk.1 $mandir/man1/nawk.1"
        echo "TOOLS_PLATFORM.awk?=              $prefix/bin/nawk" >> ${MKCONF_EXAMPLE}
        BSTRAP_ENV="AWK=\"$prefix/bin/nawk\" $BSTRAP_ENV"
        ;;
@@ -808,27 +813,33 @@
 
 # register packages
 echo_msg "Registering installed packages"
-run_cmd "(cd ../pkgtools/bootstrap-mk-files && $bmake MAKECONF=${MKCONF_EXAMPLE} bootstrap-register)"
+run_cmd "(cd ../pkgtools/bootstrap-mk-files && $bmake MAKECONF=${MKCONF_EXAMPLE} WRKOBJDIR=$wrkobjdir bootstrap-register)"
 case "$need_awk" in
-yes)   run_cmd "(cd ../lang/nawk && $bmake MAKECONF=${MKCONF_EXAMPLE} bootstrap-register)" ;;
+yes)   run_cmd "(cd ../lang/nawk && $bmake MAKECONF=${MKCONF_EXAMPLE} WRKOBJDIR=$wrkobjdir bootstrap-register)" ;;
 esac
 case "$need_sed" in
-yes)   run_cmd "(cd ../textproc/nbsed && $bmake MAKECONF=${MKCONF_EXAMPLE} LIBNBCOMPAT_STYLE=inplace bootstrap-register)" ;;
+yes)   run_cmd "(cd ../textproc/nbsed && $bmake MAKECONF=${MKCONF_EXAMPLE} LIBNBCOMPAT_STYLE=inplace WRKOBJDIR=$wrkobjdir bootstrap-register)" ;;
+esac
+case "$need_bsd_install" in
+yes)   run_cmd "(cd ../sysutils/install-sh && $bmake MAKECONF=${MKCONF_EXAMPLE} WRKOBJDIR=$wrkobjdir bootstrap-register)" ;;
+esac
+case "$need_extras" in
+yes)   run_cmd "(cd ../pkgtools/bootstrap-extras && $bmake MAKECONF=${MKCONF_EXAMPLE} WRKOBJDIR=$wrkobjdir bootstrap-register)" ;;
 esac
 case "$need_ftp" in
-yes)   run_cmd "(cd ../pkgtools/tnftp && $bmake MAKECONF=${MKCONF_EXAMPLE} bootstrap-register)" ;;
+yes)   run_cmd "(cd ../pkgtools/tnftp && $bmake MAKECONF=${MKCONF_EXAMPLE} WRKOBJDIR=$wrkobjdir bootstrap-register)" ;;
 esac
 case "$need_mtree" in
-yes)   run_cmd "(cd ../pkgtools/mtree && $bmake MAKECONF=${MKCONF_EXAMPLE} bootstrap-register)" ;;
+yes)   run_cmd "(cd ../pkgtools/mtree && $bmake MAKECONF=${MKCONF_EXAMPLE} WRKOBJDIR=$wrkobjdir bootstrap-register)" ;;
 esac
 case "$need_pax" in
-yes)   run_cmd "(cd ../pkgtools/pax && $bmake MAKECONF=${MKCONF_EXAMPLE} bootstrap-register)" ;;
+yes)   run_cmd "(cd ../pkgtools/pax && $bmake MAKECONF=${MKCONF_EXAMPLE} WRKOBJDIR=$wrkobjdir bootstrap-register)" ;;
 esac
-run_cmd "(cd ../pkgtools/pkg_install && $bmake MAKECONF=${MKCONF_EXAMPLE} bootstrap-register)"
+run_cmd "(cd ../pkgtools/pkg_install && $bmake MAKECONF=${MKCONF_EXAMPLE} WRKOBJDIR=$wrkobjdir bootstrap-register)"
 
 # Install the man page.
 echo_msg "Installing packages(7) man page"
-run_cmd "(cd ../pkgtools/pkgmanpages && $bmake MAKECONF=${MKCONF_EXAMPLE} install)"
+run_cmd "(cd ../pkgtools/pkgmanpages && $bmake MAKECONF=${MKCONF_EXAMPLE} WRKOBJDIR=$wrkobjdir install)"
 
 echo ""
 echo "Please remember to add $prefix/bin to your PATH environment variable"
diff -r cd6127aa12bb -r 81d5f485a81c bootstrap/files/fakeldd
--- a/bootstrap/files/fakeldd   Mon Jul 17 14:25:07 2006 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-#!/bin/sh
-/usr/bin/elfdump -Dl $* | /usr/bin/nawk 'NF == 7 || NF == 8 {printf "x x %s\n",$1}'
diff -r cd6127aa12bb -r 81d5f485a81c bootstrap/files/install-sh.in
--- a/bootstrap/files/install-sh.in     Mon Jul 17 14:25:07 2006 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,291 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: install-sh.in,v 1.3 2005/03/04 03:11:50 jschauma Exp $
-# This script now also installs multiple files, but might choke on installing
-# multiple files with spaces in the file names.
-#
-# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
-#
-# Copyright 1991 by the Massachusetts Institute of Technology
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  M.I.T. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog @DEFAULT_INSTALL_MODE@"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-stripflags=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-msrc=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
-    case $1 in
-       -c) instcmd="$cpprog"
-           shift
-           continue;;
-
-       -d) dir_arg=true
-           shift
-           continue;;
-
-       -m) chmodcmd="$chmodprog $2"
-           shift
-           shift
-           continue;;
-
-       -o) chowncmd="$chownprog $2"
-           shift
-           shift
-           continue;;
-
-       -g) chgrpcmd="$chgrpprog $2"
-           shift
-           shift
-           continue;;
-
-       -s) stripcmd="$stripprog"
-           shift
-           continue;;
-
-       -S) stripcmd="$stripprog"
-           stripflags="-S $2 $stripflags"
-           shift
-           shift
-           continue;;
-
-       -t=*) transformarg=`echo "$1" | sed 's/-t=//'`
-           shift
-           continue;;
-
-       -b=*) transformbasename=`echo "$1" | sed 's/-b=//'`
-           shift
-           continue;;
-
-       *)  if [ x"$src" = x ]
-           then
-               src=$1
-               msrc=$1
-           else
-               # this colon is to work around a 386BSD /bin/sh bug
-               :
-               msrc="$msrc $1"
-               dst=$1
-           fi
-           shift
-           continue;;
-    esac
-done
-
-if [ x"$dir_arg" = x -a x"$msrc" != x"$src $dst" ]
-then
-       if [ ! -d "$dst" ]; then
-               echo "install: destination is not a directory"
-               exit 1
-       fi
-else
-       msrc=$src
-fi
-
-
-if [ x"$src" = x ]
-then
-       echo "install:  no input file specified"
-       exit 1
-else
-       true
-fi
-
-if [ x"$dir_arg" != x ]; then
-       dst=$src



Home | Main Index | Thread Index | Old Index