Ignore:
Timestamp:
Apr 29, 2012, 6:02:29 PM (13 years ago)
Author:
rick
Message:

Make port building whole bunch more stupid:

1) Bundle ports in the tree itself, instead of global shared banch.
2) Copy the local ports just in the /usr/ports tree to allow playing around

with just the ordenary tools.

Location:
branches/releng-9.0/nanobsd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/releng-9.0/nanobsd

    • Property svn:externals
      •  

        old new  
        1 ports http://svn.wirelessleiden.nl/svn/code/ports
         1
  • branches/releng-9.0/nanobsd/tools/package-build.sh

    r10272 r10612  
    11#!/bin/sh
    22# Install all required packages
     3#
    34# XXX: Welcome to port hell, if /usr/ports has been updated, you actually want
    45# to delete all installed packages and start over again, hence why people used
    56# to run this stuff in jails, etc.
     7#
     8# Rick van der Zwet <rick@wirelessleiden.nl>
     9#
    610
    7 . $(dirname $0)/package-build.inc.sh
     11. `dirname $0`/package-build.inc.sh
    812
    9 DEBUG=${DEBUG:-0}
    10 DEP_CHECK_ONLY=${DEP_CHECK_ONLY:-0}
     13DEBUG=${DEBUG:-'0'}
     14DEP_CHECK_ONLY=${DEP_CHECK_ONLY:-'0'}
    1115
    1216# make options, for package building
    13 LOGDIR=`mktemp -d "/tmp/$(basename $0 .sh)-$(date +%Y%m%d-%H:%M:%S).X"`
     17LOGDIR=`mktemp -d /tmp/$(basename $0 .sh)-$(date '+%Y%m%d-%H:%M:%S')X`
    1418
    1519p_info Log directory ${LOGDIR}
    1620p_info Make options are:
    17 p_info $(p_list ${PKG_MAKE_ARGS})
     21p_info `p_list ${PKG_MAKE_ARGS}`
    1822
     23# HACK: install our own ports _inside_ the normal ports dir
     24cp -fR $WL_PORTSDIR/* $PORTSDIR
     25
     26# Pre-req dependency fixing
    1927p_info Checking whether there are currently unmet dependencies
    2028RETVAL=0
     
    3038  if [ -n "${PKG_DEP_FAIL}" ]; then
    3139      p_err Unmet dependencies found at $PKG, please fix manually:
    32       p_err $(p_list ${PKG_DEP_FAIL})
     40      p_err `p_list ${PKG_DEP_FAIL}`
    3341      RETVAL=1
    3442  fi
     
    4553
    4654
     55# Cleanup of old packages
    4756if [ -d "${NANO_PACKAGE_DIR}" ]; then
    4857        p_warn "Deleted all (old) packages at ${NANO_PACKAGE_DIR}"
     
    5261mkdir -p ${NANO_PACKAGE_DIR}
    5362
     63
     64# Build required packages
    5465MAKE="make ${PKG_MAKE_ARGS}"
    55 
    5666BUILD_LIST=''
    57 # Build required packages
    5867set ${PACKAGE_LIST}
    5968while [ "$1" ]; do
     
    6271
    6372  # Build new one
    64   LOGFILE="$LOGDIR/build$(echo $PACKAGE | tr '/' '_').log"
     73  LOGFILE="$LOGDIR/build_`echo $PACKAGE | tr '/' '_'`.log"
    6574  echo ""
    6675  p_info Packaging $PACKAGE
    67   cd ${PACKAGE}
     76  cd $PORTSDIR/$PACKAGE
    6877
    69  
    7078  # Check for build dependencies
    7179  BUILDDEP_PKG=`${MAKE} build-depends-list | awk -F: '{print $2}'`
    7280  if [ -n "${BUILDDEP_PKG}" ]; then
    7381          p_info Build dependencies needed are:
    74           p_info $(p_list ${BUILDDEP_PKG})
     82          p_info `p_list ${BUILDDEP_PKG}`
    7583  fi
    7684
     
    7987  if [ -n "${PKGDEP_PKGS}" ]; then
    8088          p_info Package dependencies also packaged are:
    81           p_info $(p_list ${PKGDEP_PKGS})
     89          p_info `p_list ${PKGDEP_PKGS}`
    8290  fi
    8391
    8492  # Check if package is already installed
    8593  VERSION=`${MAKE} clean generate-plist check-already-installed | awk '/is already/ {print $2}'`
    86    if [ -n "${VERSION}" ]; then
     94   if [ -n "$FORCE_REBUILD" ]; then
     95     p_warn "${PACKAGE} forcefullly rebuilding..."
     96     MAKE_OPTION='deinstall reinstall'
     97   elif [ "${VERSION}" = "An" ]; then
     98     #XXX: Better way to detect whether a package needs updating
     99     # An older version of lang/python26 is already installed (python26-2.6.2)
     100     p_warn "${PACKAGE} outdated, updating..."
     101     p_warn "re-run package-build.sh to check for unmet ones done using:"
     102     p_warn "$0"
     103     MAKE_OPTION='deinstall reinstall'
     104   elif [ -n "${VERSION}" ]; then
    87105     VERSION=`echo ${VERSION} | sed 's/^.*-//g'`
    88106     p_info ${PACKAGE} already installed at ${VERSION}
    89107     MAKE_OPTION=''
    90    elif [ "${VERSION}" = "An" ]; then
    91      #XXX: Better way to detect whether a package needs updating
    92      # An older version of lang/python26 is already installed (python26-2.6.2)
    93      p_warn ${PACKAGE} outdated, updating...
    94      p_warn re-run package-build.sh to check for unmet ones done using:
    95      p_warn $0
    96      MAKE_OPTION='deinstall reinstall'
    97108   else
    98109     p_info ${PACKAGE} not installed, installing...
     
    130141done
    131142 
    132 p_info $(echo ${BUILD_LIST} | wc -w) packages build succesfully
     143p_info `echo ${BUILD_LIST} | wc -w` packages build succesfully
    133144
    134145if [ ${DEBUG} -eq 0 ]; then
Note: See TracChangeset for help on using the changeset viewer.