Changeset 10612 in hybrid for branches/releng-9.0/nanobsd/tools/package-build.sh
- Timestamp:
- Apr 29, 2012, 6:02:29 PM (13 years ago)
- 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
-
- Property svn:externals
-
branches/releng-9.0/nanobsd/tools/package-build.sh
r10272 r10612 1 1 #!/bin/sh 2 2 # Install all required packages 3 # 3 4 # XXX: Welcome to port hell, if /usr/ports has been updated, you actually want 4 5 # to delete all installed packages and start over again, hence why people used 5 6 # to run this stuff in jails, etc. 7 # 8 # Rick van der Zwet <rick@wirelessleiden.nl> 9 # 6 10 7 . $(dirname $0)/package-build.inc.sh11 . `dirname $0`/package-build.inc.sh 8 12 9 DEBUG=${DEBUG:- 0}10 DEP_CHECK_ONLY=${DEP_CHECK_ONLY:- 0}13 DEBUG=${DEBUG:-'0'} 14 DEP_CHECK_ONLY=${DEP_CHECK_ONLY:-'0'} 11 15 12 16 # make options, for package building 13 LOGDIR=`mktemp -d "/tmp/$(basename $0 .sh)-$(date +%Y%m%d-%H:%M:%S).X"`17 LOGDIR=`mktemp -d /tmp/$(basename $0 .sh)-$(date '+%Y%m%d-%H:%M:%S')X` 14 18 15 19 p_info Log directory ${LOGDIR} 16 20 p_info Make options are: 17 p_info $(p_list ${PKG_MAKE_ARGS})21 p_info `p_list ${PKG_MAKE_ARGS}` 18 22 23 # HACK: install our own ports _inside_ the normal ports dir 24 cp -fR $WL_PORTSDIR/* $PORTSDIR 25 26 # Pre-req dependency fixing 19 27 p_info Checking whether there are currently unmet dependencies 20 28 RETVAL=0 … … 30 38 if [ -n "${PKG_DEP_FAIL}" ]; then 31 39 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}` 33 41 RETVAL=1 34 42 fi … … 45 53 46 54 55 # Cleanup of old packages 47 56 if [ -d "${NANO_PACKAGE_DIR}" ]; then 48 57 p_warn "Deleted all (old) packages at ${NANO_PACKAGE_DIR}" … … 52 61 mkdir -p ${NANO_PACKAGE_DIR} 53 62 63 64 # Build required packages 54 65 MAKE="make ${PKG_MAKE_ARGS}" 55 56 66 BUILD_LIST='' 57 # Build required packages58 67 set ${PACKAGE_LIST} 59 68 while [ "$1" ]; do … … 62 71 63 72 # Build new one 64 LOGFILE="$LOGDIR/build $(echo $PACKAGE | tr '/' '_').log"73 LOGFILE="$LOGDIR/build_`echo $PACKAGE | tr '/' '_'`.log" 65 74 echo "" 66 75 p_info Packaging $PACKAGE 67 cd $ {PACKAGE}76 cd $PORTSDIR/$PACKAGE 68 77 69 70 78 # Check for build dependencies 71 79 BUILDDEP_PKG=`${MAKE} build-depends-list | awk -F: '{print $2}'` 72 80 if [ -n "${BUILDDEP_PKG}" ]; then 73 81 p_info Build dependencies needed are: 74 p_info $(p_list ${BUILDDEP_PKG})82 p_info `p_list ${BUILDDEP_PKG}` 75 83 fi 76 84 … … 79 87 if [ -n "${PKGDEP_PKGS}" ]; then 80 88 p_info Package dependencies also packaged are: 81 p_info $(p_list ${PKGDEP_PKGS})89 p_info `p_list ${PKGDEP_PKGS}` 82 90 fi 83 91 84 92 # Check if package is already installed 85 93 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 87 105 VERSION=`echo ${VERSION} | sed 's/^.*-//g'` 88 106 p_info ${PACKAGE} already installed at ${VERSION} 89 107 MAKE_OPTION='' 90 elif [ "${VERSION}" = "An" ]; then91 #XXX: Better way to detect whether a package needs updating92 # 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 $096 MAKE_OPTION='deinstall reinstall'97 108 else 98 109 p_info ${PACKAGE} not installed, installing... … … 130 141 done 131 142 132 p_info $(echo ${BUILD_LIST} | wc -w)packages build succesfully143 p_info `echo ${BUILD_LIST} | wc -w` packages build succesfully 133 144 134 145 if [ ${DEBUG} -eq 0 ]; then
Note:
See TracChangeset
for help on using the changeset viewer.