From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Dec 23 12:20:19 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5DE0D16A47B for ; Sat, 23 Dec 2006 12:20:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 3A2A713C458 for ; Sat, 23 Dec 2006 12:20:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id kBNCKIDu055334 for ; Sat, 23 Dec 2006 12:20:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id kBNCKI3M055333; Sat, 23 Dec 2006 12:20:18 GMT (envelope-from gnats) Resent-Date: Sat, 23 Dec 2006 12:20:18 GMT Resent-Message-Id: <200612231220.kBNCKI3M055333@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Alexander Leidinger" Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D8F9916A415 for ; Sat, 23 Dec 2006 12:12:06 +0000 (UTC) (envelope-from netchild@freebsd.org) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id 94EBD13C44B for ; Sat, 23 Dec 2006 12:12:06 +0000 (UTC) (envelope-from netchild@freebsd.org) Received: from outgoing.leidinger.net (p54A5D756.dip.t-dialin.net [84.165.215.86]) by redbull.bpaserver.net (Postfix) with ESMTP id 423E92E192; Sat, 23 Dec 2006 12:49:49 +0100 (CET) Received: from Magellan.Leidinger.net (Magellan.Leidinger.net [192.168.1.1]) by outgoing.leidinger.net (Postfix) with ESMTP id B099B5B480D; Sat, 23 Dec 2006 12:48:27 +0100 (CET) Message-Id: <1166874507.18278@Magellan.Leidinger.net> Date: Sat, 23 Dec 2006 12:48:27 +0100 From: "Alexander Leidinger" To: "FreeBSD gnats submit" X-Send-Pr-Version: gtk-send-pr 0.4.8 Cc: erdgeist@erdgeist.org Subject: ports/107135: ports/sysutils/ezjail improvements X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2006 12:20:19 -0000 >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: