[SVN] r2931 - trunk/tools/dar

svn-commits at rpmforge.net svn-commits at rpmforge.net
Fri Mar 4 02:29:21 CET 2005


Author: dag
Date: 2005-03-04 02:29:20 +0100 (Fri, 04 Mar 2005)
New Revision: 2931

Added:
   trunk/tools/dar/dar-shell
Modified:
   trunk/tools/dar/Makefile
   trunk/tools/dar/dar-exec
Log:
Added nifty dar-shell tool.

Modified: trunk/tools/dar/Makefile
===================================================================
--- trunk/tools/dar/Makefile	2005-03-03 13:12:58 UTC (rev 2930)
+++ trunk/tools/dar/Makefile	2005-03-04 01:29:20 UTC (rev 2931)
@@ -10,7 +10,7 @@
 libdir=/usr/lib
 sbindir=/usr/sbin
 
-DIST_SCRIPTS=dar-build dar-dotty dar-exec dar-kickoff dar-new dar-prepare dar-repo dar-sync dar-update
+DIST_SCRIPTS=dar-build dar-dotty dar-exec dar-kickoff dar-new dar-prepare dar-repo dar-shell dar-sync dar-update
 DIST_LIBS=dar-functions compartment.sh
 
 DESTDIR=

Modified: trunk/tools/dar/dar-exec
===================================================================
--- trunk/tools/dar/dar-exec	2005-03-03 13:12:58 UTC (rev 2930)
+++ trunk/tools/dar/dar-exec	2005-03-04 01:29:20 UTC (rev 2931)
@@ -19,6 +19,10 @@
 for distname in $DISTS; do
 	echo "Executing \"$CMD\" for $distname."
 
+	if [ -r "$CONFIGDIR/dists/$dist/config" ]; then
+		source "$CONFIGDIR/dists/$dist/config"
+	fi
+
 	### Check for building as user
 	if [ $AS_ROOT -eq 1 ]; then
 		DO_SU="/bin/su - -c"

Added: trunk/tools/dar/dar-shell
===================================================================
--- trunk/tools/dar/dar-shell	2005-03-03 13:12:58 UTC (rev 2930)
+++ trunk/tools/dar/dar-shell	2005-03-04 01:29:20 UTC (rev 2931)
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+### dar-shell  [ -d <dists> ]
+
+source "/usr/lib/dar/dar-functions"
+
+daropts "d:" $@
+CMD="$OPTS"
+
+if [ ! -d "$ROOT" ]; then
+	echo "ERROR: probably in chroot jail" >&2
+	exit 1
+fi
+
+set_dists
+set_as_root
+AS_ROOT=1
+
+if [ -z "$DISTS" ]; then
+	DISTS="$DEFAULT_DISTS"
+fi
+
+for distname in $DISTS; do
+	echo "Entering $distname shell."
+
+	if [ -r "$CONFIGDIR/dists/$dist/config" ]; then
+		source "$CONFIGDIR/dists/$dist/config"
+	fi
+
+	chroot $CHROOTDIR/$distname
+done
+echo -n "Returning to parent shell. Press ENTER."
+read a
+
+exit 0


Property changes on: trunk/tools/dar/dar-shell
___________________________________________________________________
Name: svn:executable
   + *




More information about the commits mailing list