Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Dec 2006 12:48:27 +0100
From:      "Alexander Leidinger" <netchild@FreeBSD.org>
To:        "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org>
Cc:        erdgeist@erdgeist.org
Subject:   ports/107135: ports/sysutils/ezjail improvements
Message-ID:  <1166874507.18278@Magellan.Leidinger.net>
Resent-Message-ID: <200612231220.kBNCKI3M055333@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         107135
>Category:       ports
>Synopsis:       ports/sysutils/ezjail improvements
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 23 12:20:18 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Alexander Leidinger
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
FreeBSD 
>Environment:


System: FreeBSD 7.0-CURRENT #230: Fri Dec 22 15:25:00 CET 2006
    root@Magellan.Leidinger.net:/big/usr/src/sys/i386/compile/WORK



>Description:


Problems:
 - ezjail-admin update -P can not be used in a crontab
 - when the packages in a flavor is a link, cpio copies the link instead of the package

The attached patch detects if ezjail-admin is run withhin cron and uses "portsnap cron" then. If packages are links, it removes the link after the cpio and copies the package. I did not change the cpio line because other links in the flavor should be preserved (e.g. malloc.conf).


>How-To-Repeat:





>Fix:


--- patch-ezjail-admin begins here ---
--- ezjail-2.0.1/ezjail-admin	Mon Jul 24 13:07:58 2006
+++ ezjail-2.0.1/ezjail-admin	Tue Nov  7 15:11:49 2006
@@ -145,7 +145,11 @@
     echo "Gathering local information may take a while."
     cd ${ezjail_jailbase}/usr/ports/ && cvs -d ${ezjail_portscvsroot} up -Pd
   else
-    portsnap fetch
+    if [ -z "$TERM" -o "$TERM" = dumb ]; then
+      portsnap cron
+    else
+      portsnap fetch
+    fi
     [ -d ${ezjail_jailbase}/usr/ports ] && ezjail_portsnapaction=update
     portsnap -p ${ezjail_jailbase}/usr/ports ${ezjail_portsnapaction:-"extract"}
   fi
@@ -371,6 +375,17 @@
     # install files and config to new jail
     cd ${ezjail_flavours}/${ezjail_flavour} && find * | cpio -p -u -v ${ezjail_rootdir} > /dev/null
     [ $? = 0 ] || echo "Warning: Could not fully install flavour."
+
+    # if the packages are links and not files we have to copy them now
+    if [ -d ${ezjail_rootdir}/pkg ]; then
+      cd ${ezjail_rootdir}/pkg
+      for file in *; do
+        real_file=$(realpath ${file})
+        if [ ! "${real_file}" = "$file" ]; then
+          rm ${file} && cp ${real_file} ${file}
+        fi
+      done
+    fi
 
     # If a config is found, make it auto run on jails startup
     if [ -f ${ezjail_rootdir}/ezjail.flavour ]; then
--- patch-ezjail-admin ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1166874507.18278>