[BACK]Return to release.sh CVS log [TXT][DIR] Up to [local] / openbsd / update_openbsd

Diff for /openbsd/update_openbsd/release.sh between version 1.23 and 1.36

version 1.23, 2008/10/11 23:11:58 version 1.36, 2014/11/27 21:17:46
Line 1 
Line 1 
 #!/bin/sh  #!/bin/sh
 # $RedRiver: release.sh,v 1.22 2008/07/08 22:46:01 andrew Exp $  # $AFresh1: release.sh,v 1.35 2014/11/08 20:32:55 andrew Exp $
 #  #
 # Copyright (c) 2002, 2008 Steven Roberts <sroberts@fenderq.com>  # Copyright (c) 2002, 2008 Steven Roberts <sroberts@fenderq.com>
 #  #
Line 16 
Line 16 
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.  # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #  #
   
 TAG=${TAG:=`uname -sr | tr '[:lower:] .' '[:upper:]_'`}  local _origtag=${TAG}
   TAG=`uname -sr | tr '[:lower:] .' '[:upper:]_'`
 KERNEL="GENERIC"  KERNEL="GENERIC"
 ARCH=`machine`  ARCH=`machine`
 DEST="/home/destdir"  DEST="/home/destdir"
Line 24 
Line 25 
 XSRCDIR="/usr/xenocara"  XSRCDIR="/usr/xenocara"
 PORTSPATH="/usr/ports"  PORTSPATH="/usr/ports"
   
 if [ -e ${HOME}/.releaserc ]; then  if [ -e /etc/release.conf ]; then
         . ${HOME}/.releaserc      . /etc/release.conf
 fi  fi
   export CVSROOT
   
   if [ X"" != X"${_origtag}" ]; then
       TAG=$_origtag
   fi
   
   
 # See http://www.openbsd.org/anoncvs.html for instructions on fetching the  # See http://www.openbsd.org/anoncvs.html for instructions on fetching the
 # sources for the first time.  # sources for the first time.
   
   empty_dir() {
   [ X"" == X"$1" ] && exit
   cd $1 || exit
   
   local _old=`${SUDO} mktemp -d .old.XXXXXXX`
   ${SUDO} mv -f * .* $_old 2>/dev/null
   ${SUDO} rm -rf $_old
   
   sync
   }
   
 update_sources() {  update_sources() {
 echo "---------- Update sources ----------"  echo "---------- Update sources ----------"
 _cvstag=-r$TAG  local _d
 if [ X"$TAG" == X"HEAD" ]; then  for _d in /usr/src "${XSRCDIR}" "${PORTSPATH}"; do
         _cvstag=""      if [ -d $_d -a -e $_d/CVS ]; then
 fi          R="-r$TAG"
 for d in /usr/src ${XSRCDIR} ${PORTSPATH}; do          [ "$TAG" = "HEAD" ] && R="-A"
        echo "cd $d && opencvs update $_cvstag -Pd"          echo [$_d] cvs update $R -Pd
        cd $d && opencvs update $_cvstag -Pd          cd $_d &&  cvs update $R -Pd || exit 255
       fi
 done  done
 }  }
   
 build_kernel() {  build_kernel() {
 echo "---------- Build and install a new kernel ----------"  echo "---------- Build and install a new kernel ----------"
   local _status=0
   unset DESTDIR RELEASEDIR
 cd /usr/src/sys/arch/$ARCH/conf  cd /usr/src/sys/arch/$ARCH/conf
 config $KERNEL  config $KERNEL
 cd ../compile/$KERNEL  cd ../compile/$KERNEL
 make clean depend && make  make clean depend && make
 make install  _status=$?
   if [ $_status == 0 ]; then
       make install
       _status=$?
   fi
   if [ $_status != 0 ]; then
       echo Kernel Build Failed
       exit $_status
   fi
 }  }
   
 build_system() {  build_system() {
 echo "---------- Build a new system ----------"  echo "---------- Build a new system ----------"
 rm -rf /usr/obj/*  local _status=0
   unset DESTDIR RELEASEDIR
   empty_dir /usr/obj &
 cd /usr/src && nice make obj  cd /usr/src && nice make obj
 cd /usr/src/etc && env DESTDIR=/ make distrib-dirs  _status=$?
 cd /usr/src && nice make build  if [ $_status == 0 ]; then
 # Update /etc, /var, and /dev/MAKEDEV by hand.      cd /usr/src/etc && env DESTDIR=/ $SUDO make distrib-dirs
       _status=$?
   fi
   if [ $_status == 0 ]; then
       cd /usr/src && nice make SUDO="${SUDO}" build
   fi
   if [ $_status != 0 ]; then
       echo System Build Failed
       exit $_status
   else
       echo Update /etc, /var, and /dev/MAKEDEV, either by hand or using sysmerge\(8\).
   fi
 }  }
   
 make_system_release() {  make_system_release() {
 echo "---------- Make and validate the system release ----------"  echo "---------- Make and validate the system release ----------"
 cd /usr/src/distrib/crunch && make obj depend && make all install  if [ X"$DEST" == X"" ]; then
 export DESTDIR=$DEST; export RELEASEDIR=$RELEASE          echo PLEASE SET \$DEST! >2&
 rm -rf $DESTDIR          exit 1
 mkdir -p $DESTDIR $RELEASEDIR  fi
 cd /usr/src/etc && nice make release  
 cd /usr/src/distrib/sets && sh checkflist  local _status=0
 unset DESTDIR RELEASEDIR  local DESTDIR RELEASEDIR
   
   [ -e $DEST ] && empty_dir $DEST
   ${SUDO} install -d -g wheel -m 775 $DEST $RELEASE
   
   export DESTDIR=$DEST RELEASEDIR=$RELEASE
   cd /usr/src/etc && ${SUDO} nice make SUDO="" release
   _status=$?
   [ $_status == 0 ] && cd /usr/src/distrib/sets && ${SUDO} sh checkflist
   _status=$?
   
   [ $_status == 0 ] || echo System Release Failed
   exit $_status
 }  }
   
 build_xenocara() {  build_xenocara() {
 echo "---------- Build and install xenocara ----------"  echo "---------- Build and install xenocara ----------"
 rm -rf /usr/xobj/*  local _status=0
 mkdir -p /usr/xobj  unset DESTDIR RELEASEDIR
   empty_dir /usr/xobj &
 cd $XSRCDIR  cd $XSRCDIR
 make bootstrap  _status=$?
 make obj  if [ $_status == 0 ]; then
 make build      make bootstrap
       _status=$?
   fi
   if [ $_status == 0 ]; then
       make obj
       _status=$?
   fi
   if [ $_status == 0 ]; then
       make build
       _status=$?
   fi
   if [ $_status != 0 ]; then
       echo Xenocara Build Failed
       exit $_status
   fi
 }  }
   
 make_xenocara_release() {  make_xenocara_release() {
 echo "---------- Make and validate the xenocara release ----------"  echo "---------- Make and validate the xenocara release ----------"
 export DESTDIR=$DEST RELEASEDIR=$RELEASE  local _status=0
 rm -rf $DESTDIR  export DESTDIR=$DEST;export RELEASEDIR=$RELEASE
   if [ X"$DESTDIR" == X"" ]; then
           echo PLEASE SET \$DEST! >2&
           exit
   fi
 mkdir -p $DESTDIR $RELEASEDIR  mkdir -p $DESTDIR $RELEASEDIR
   empty_dir $DESTDIR &
 cd $XSRCDIR  cd $XSRCDIR
 nice make release  _status=$?
   if [ $_status == 0 ]; then
       nice make release
       _status=$?
   fi
 unset DESTDIR RELEASEDIR  unset DESTDIR RELEASEDIR
   if [ $_status != 0 ]; then
       echo Xenocara Release Failed
       exit $_status
   fi
 }  }
   
 usage() {  usage() {
Line 103 
Line 185 
 echo "  system-release   - Make and validate the system release"  echo "  system-release   - Make and validate the system release"
 echo "  xenocara         - Build and install xenocara"  echo "  xenocara         - Build and install xenocara"
 echo "  xenocara-release - Make and validate the xenocara release"  echo "  xenocara-release - Make and validate the xenocara release"
 echo "  full-release     - Do system, xenocara, system-release, xenocara-release"  echo "  full             - xenocara, xenocara-release, system, system-release"
 echo  echo
 }  }
   
 if [ `whoami` != "root" ]; then  if [ X"" == X"${SUDO}" -a `whoami` != "root" ]; then
 echo "You must be root to build a release."  echo "You must be root or set SUDO to build a release."
 exit 1  exit 1
 fi  fi
   
Line 121 
Line 203 
 echo " Kernel: $KERNEL-$ARCH"  echo " Kernel: $KERNEL-$ARCH"
 echo "   Dest: $DEST"  echo "   Dest: $DEST"
 echo "Release: $RELEASE"  echo "Release: $RELEASE"
   if [ X"$CVSROOT" != X"" ]; then
           echo "   Root: $CVSROOT"
   fi
 echo  echo
   
 if [ $# = 0 ]; then usage; exit 1; fi  if [ $# = 0 ]; then usage; exit 1; fi
Line 128 
Line 213 
 for i in $*  for i in $*
 do  do
 case $i in  case $i in
 full-release)  
 build_xenocara  
 build_system  
 make_xenocara_release  
 make_system_release  
 ;;  
 update)  update)
 update_sources  update_sources
 ;;  ;;
Line 151 
Line 230 
 ;;  ;;
 xenocara-release)  xenocara-release)
 make_xenocara_release  make_xenocara_release
   ;;
   full)
   build_xenocara
   make_xenocara_release
   build_system
   make_system_release
 ;;  ;;
 *)  *)
 echo "---------- Abort! Abort! ----------"  echo "---------- Abort! Abort! ----------"

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.36

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>