[PC-BSD Commits] r17287 - pcbsd/current/src-sh/warden/scripts/backend
svn at pcbsd.org
svn at pcbsd.org
Fri Jun 15 07:17:33 PDT 2012
Author: kris
Date: 2012-06-15 14:17:32 +0000 (Fri, 15 Jun 2012)
New Revision: 17287
Modified:
pcbsd/current/src-sh/warden/scripts/backend/createjail.sh
Log:
Improve creating jails with ports, to use portsnap for fetching. Display warnings
if this fails, ditto with system sources.
Modified: pcbsd/current/src-sh/warden/scripts/backend/createjail.sh
===================================================================
--- pcbsd/current/src-sh/warden/scripts/backend/createjail.sh 2012-06-15 09:22:16 UTC (rev 17286)
+++ pcbsd/current/src-sh/warden/scripts/backend/createjail.sh 2012-06-15 14:17:32 UTC (rev 17287)
@@ -67,16 +67,24 @@
then
echo "Installing source..."
mkdir -p "${JAILDIR}/usr/src"
- tar cvf - -C /usr/src . 2>/dev/null | tar xvf - -C "${JAILDIR}/usr/src" 2>/dev/null
- echo "Done"
+ if [ ! -e "/usr/src/COPYRIGHT" ] ; then
+ echo "No system-sources on host.. You will need to manually download these in the jail."
+ else
+ tar cvf - -C /usr/src . 2>/dev/null | tar xvf - -C "${JAILDIR}/usr/src" 2>/dev/null
+ echo "Done"
+ fi
fi
if [ "$PORTS" = "YES" ]
then
- echo "Installing ports..."
+ echo "Fetching ports..."
mkdir -p "${JAILDIR}/usr/ports"
- tar cvf - -C /usr/ports . 2>/dev/null | tar xvf - -C "${JAILDIR}/usr/ports" 2>/dev/null
- echo "Done"
+ cat /usr/sbin/portsnap | sed 's|! -t 0|-z '1'|g' | /bin/sh -s "fetch" "extract" "update" "-p" "${JAILDIR}/usr/ports" >/dev/null 2>/dev/null
+ if [ $? -eq 0 ] ; then
+ echo "Done"
+ else
+ echo "Failed! Please run \"portsnap fetch extract update\" within the jail."
+ fi
fi
# Create an empty fstab
More information about the Commits
mailing list