On Fri, 2005-07-15 at 20:13 +0900, Jason Stubbs wrote:
> By the way, you seemed to attach a unified diff between your modified
> portage and an empty directory. Please don't do the same for busybox.
> Sending a 1.4MB patch to a public mailing list is not very nice -
> especially not in one go.

I'm sincerilly truly sorry, I'll try to triple check in the futur.
I just can't believe what I did.
I ran the same command and here's the output ???

> Patches belong on bugs.gentoo.org anyway.

Sorry, I'm getting use to the LKML.
As I sent a bad patch, I'll send the correction here, but I'll send
patch in bugs.gentoo.org in the futur.

Thanks

Kristian
diff -uNrp portage-2.0.51.19/bin/ebuild.sh portage-2.0.51.19-preconfig/bin/ebuild.sh
--- portage-2.0.51.19/bin/ebuild.sh	2005-02-26 06:22:37.000000000 -0500
+++ portage-2.0.51.19-preconfig/bin/ebuild.sh	2005-07-14 20:21:38.000000000 -0400
@@ -548,6 +548,11 @@ src_unpack() {
 	fi	
 }
 
+src_preconfig() {
+	echo "default preconfig"
+	return `false`
+}
+
 src_compile() {
 	if [ -x ./configure ]; then
 		econf
@@ -685,6 +690,20 @@ dyn_unpack() {
 	trap SIGINT SIGQUIT
 }
 
+dyn_preconfig() {
+	echo ">>> Preconfiguring source..."
+	cd ${S}
+	local preconfigured = 1
+	echo "some more stuff"
+	src_preconfig && preconfigured=0 || preconfigured=1
+
+	if [ preconfigured ]; then
+		echo ">>> Source preconfigured."
+	else
+		echo ">>> Could not preconfigure the source."
+	fi
+}
+
 dyn_clean() {
 	if [ "$USERLAND" == "BSD" ] && type -p chflags &>/dev/null; then
 		chflags -R noschg,nouchg,nosappnd,nouappnd,nosunlnk,nouunlnk \
@@ -1778,7 +1797,7 @@ for myarg in $*; do
 			set +x
 		fi
 		;;
-	unpack|compile|test|clean|install)
+	unpack|preconfig|compile|test|clean|install)
 		if [ "${SANDBOX_DISABLED="0"}" == "0" ]; then
 			export SANDBOX_ON="1"
 		else
diff -uNrp portage-2.0.51.19/pym/portage.py portage-2.0.51.19-preconfig/pym/portage.py
--- portage-2.0.51.19/pym/portage.py	2005-03-03 11:45:01.000000000 -0500
+++ portage-2.0.51.19-preconfig/pym/portage.py	2005-07-14 20:53:15.000000000 -0400
@@ -2253,9 +2253,14 @@ def spawnebuild(mydo,actionmap,mysetting
 			retval=spawnebuild(actionmap[mydo]["dep"],actionmap,mysettings,debug,alwaysdep=alwaysdep,logfile=logfile)
 			if retval:
 				return retval
+
+	# Do not log for preconfig as it break interactivity.
+	if mydo=="preconfig":
+		logfile=None
+
 	# spawn ebuild.sh
 	mycommand = EBUILD_SH_BINARY + " "
-	if selinux_enabled and ("sesandbox" in features) and (mydo in ["unpack","compile","test","install"]):
+	if selinux_enabled and ("sesandbox" in features) and (mydo in ["unpack","preconfig","compile","test","install"]):
 		con=selinux.getcontext()
 		con=string.replace(con,mysettings["PORTAGE_T"],mysettings["PORTAGE_SANDBOX_T"])
 		selinux.setexec(con)
@@ -2295,7 +2300,7 @@ def doebuild(myebuild,mydo,myroot,mysett
 
 	validcommands = ["help","clean","prerm","postrm","preinst","postinst",
 	                "config","setup","depend","fetch","digest",
-	                "unpack","compile","test","install","rpm","qmerge","merge",
+	                "unpack","preconfig","compile","test","install","rpm","qmerge","merge",
 	                "package","unmerge", "manifest"]
 
 	if mydo not in validcommands:
@@ -2533,7 +2538,7 @@ def doebuild(myebuild,mydo,myroot,mysett
 			return unmerge(mysettings["CATEGORY"],mysettings["PF"],myroot,mysettings)
 
 	# if any of these are being called, handle them -- running them out of the sandbox -- and stop now.
-	if mydo=="clean":
+	if mydo in ["clean","config"]:
 		logfile=None
 	if mydo in ["help","clean","setup"]:
 		return spawn(EBUILD_SH_BINARY+" "+mydo,mysettings,debug=debug,free=1,logfile=logfile)
@@ -2623,13 +2628,18 @@ def doebuild(myebuild,mydo,myroot,mysett
 			  "depend": {                 "args":(0,1)},         # sandbox  / portage
 			  "setup":  {                 "args":(1,0)},         # without  / root
 			 "unpack":  {"dep":"setup",   "args":(0,1)},         # sandbox  / portage
-			"compile":  {"dep":"unpack",  "args":(nosandbox,1)}, # optional / portage
+		  "preconfig":  {"dep":"unpack",  "args":(nosandbox,1)}, # optional / portage
 			   "test":  {"dep":"compile", "args":(nosandbox,1)}, # optional / portage
 			"install":  {"dep":"test",    "args":(0,0)},         # sandbox  / root
 			    "rpm":  {"dep":"install", "args":(0,0)},         # sandbox  / root
     	"package":  {"dep":"install", "args":(0,0)},         # sandbox  / root
 	}
-	
+
+	if "preconfig" in mysettings["FEATURES"].split():
+		actionmap["compile"] =  {"dep":"preconfig",  "args":(nosandbox,1)} # optional / portage
+	else:
+		actionmap["compile"] =  {"dep":"unpack",  "args":(nosandbox,1)} # optional / portage
+
 	if mydo in actionmap.keys():	
 		if mydo=="package":
 			for x in ["","/"+mysettings["CATEGORY"],"/All"]:
--- busybox-1.00-r4.ebuild	2005-07-14 20:39:47.000000000 -0400
+++ busybox-1.00-r6.ebuild	2005-07-14 20:38:51.000000000 -0400
@@ -91,6 +91,7 @@ src_unpack() {
 		done
 		if [[ -r ${S}/.config ]] ; then
 			einfo "Found your ${configfile} and using it."
+			touch ${BUILDDIR}/.preconfigured
 			return 0
 		fi
 	fi
@@ -136,7 +137,20 @@ src_unpack() {
 	make oldconfig > /dev/null
 }
 
+src_preconfig() {
+	emake CROSS="${CROSS}" menuconfig
+	touch "${BUILDDIR}/.preconfigured"
+}
+
 src_compile() {
+	if [ ! -f ${BUILDDIR}/.preconfigured ]; then
+		ewarn "You can add preconfig to FEATURES if you want to interactively"
+		ewarn "configure busybox."
+		ewarn "DO NOT add preconfig to FEATURES in your make.conf but use:"
+		ewarn "$ FEATURES=preconfig emerge busybox"
+		ewarn ""
+		ewarn "Default config will be used."
+	fi
 	busybox_set_env
 	emake -j1 CROSS="${CROSS}" depend || die "depend failed"
 	emake CROSS="${CROSS}" busybox || die "build failed"

Reply via email to