Changeset 10612 in hybrid


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:
37 added
4 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/cfg/nanobsd.wleiden

    r10605 r10612  
    2828NANO_PACKAGE_DIR=$NANO_CONF_DIR/../pkg/All
    2929
     30# Wireless Leiden ports from $WL_PORTSDIR are copied OVER $PORTSDIR
    3031PORTSDIR='/usr/ports'
    3132WL_PORTSDIR="$NANO_CONF_DIR/../ports/"
     33
    3234# Dirty quirk to allow comments in part below
    33 PACKAGE_LIST=`cat <<EOF | sed 's/#.*$//g'
    34 $PORTSDIR/benchmarks/iperf
    35 $PORTSDIR/devel/py-Jinja2
    36 $PORTSDIR/devel/py-yaml
    37 $PORTSDIR/dns/dnsmasq
    38 $PORTSDIR/editors/vim-lite
    39 $PORTSDIR/ftp/curl
    40 $PORTSDIR/lang/python
    41 $PORTSDIR/net-mgmt/net-snmp
    42 $PORTSDIR/net/isc-dhcp42-server
    43 $PORTSDIR/net/pen
    44 $PORTSDIR/net/sixxs-aiccu
    45 $PORTSDIR/security/nmap
    46 $PORTSDIR/security/openvpn
    47 $PORTSDIR/security/sudo
    48 $PORTSDIR/shells/bash-static
    49 $PORTSDIR/sysutils/screen
    50 $PORTSDIR/sysutils/ucspi-tcp
    51 $PORTSDIR/www/thttpd
    52 $PORTSDIR/www/tinyproxy
    53 
    54 
    55 # Wireless Leiden ports at $WL_PORTSDIR
    56 $WL_PORTSDIR/net/lvrouted
     35PACKAGE_LIST=`cat <<EOF | sed -e 's/#.*$//g' | xargs
     36benchmarks/iperf
     37devel/py-Jinja2
     38devel/py-yaml
     39dns/dnsmasq
     40editors/vim-lite
     41ftp/curl
     42lang/python
     43net-mgmt/net-snmp
     44net/isc-dhcp42-server
     45net/pen
     46net/sixxs-aiccu
     47security/nmap
     48security/openvpn
     49security/sudo
     50shells/bash-static
     51sysutils/screen
     52sysutils/ucspi-tcp
     53www/thttpd
     54www/tinyproxy
     55
     56# Extra WL ports
     57net/lvrouted
    5758`
    5859# Package target
    5960# Dirty quirk to allow comments in part below
    60 PKG_MAKE_ARGS=`cat <<EOF | sed 's/#.*$//g'
     61PKG_MAKE_ARGS=`cat <<EOF | sed 's/#.*$//g' | xargs
    6162PACKAGES=$(dirname $NANO_PACKAGE_DIR)
    6263BATCH=yes PACKAGE_BUILDING=yes
  • branches/releng-9.0/nanobsd/tools/image

    r10593 r10612  
    2222# rebuild                       - Rebuild NanoBSD (aka force rebuilding all)
    2323# deploy on <node> [and reboot] - Deploy the image on node and reboot if needed
     24# ports update                  - Update the packages from ports
     25# ports force rebuild           - Forcefully rebuilding all required packages
    2426EOF
    2527}
     
    110112}
    111113
    112 
    113114#
    114115# Argument parsing
     
    150151  fi
    151152  deploy_image
     153elif [ "$1" = "ports" ]; then
     154  if [ "$2" = "update" ]; then
     155    # Fetch the latest details and provide listing of packages to be updated
     156    portsnap fetch update || exit 1
     157
     158    # HACK: install our own ports _inside_ the normal ports dir
     159    cp -fR $WL_PORTSDIR/* $PORTSDIR
     160
     161    # Make sure portmaster is present to update all ports
     162    portmaster --version 1>/dev/null 2>/dev/null || make -C /usr/ports/ports-mgmt/portmaster BATCH=yes install clean || exit 1
     163
     164    # Update via portmaster
     165    portmaster --no-confirm --update-if-newer -y -d -G  `echo $PKG_MAKE_ARGS | xargs -n1 echo -m `  $PACKAGE_LIST || exit 1
     166
     167    . ${BASEDIR}/package-build.sh
     168  elif [ "$2" = "force" -a "$3" = "rebuild" ]; then
     169    export FORCE_REBUILD=1
     170    . ${BASEDIR}/package-build.sh
     171  else
     172    shift 1
     173    echo "Arguments Error - '$*'"; exit 128
     174  fi
    152175else
    153176  echo "Argument Error - '$1'"; exit 128
  • 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.