From: Chris Gianelloni Date: Tue, 11 Jan 2005 14:10:19 +0000 (+0000) Subject: Added a -F or --fetchonly command line option and closing out bug #77480. Also added... X-Git-Tag: CATALYST_2_0_6_916~858 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9a87fa82672e4578df60f28204b268a142d4192b;p=catalyst.git Added a -F or --fetchonly command line option and closing out bug #77480. Also added a portage version check to livecd-stage1 to close out bug #68307. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@515 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index bd145359..ef9e30b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for gentoo/src/catalyst # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.142 2005/01/11 13:12:36 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.143 2005/01/11 14:10:18 wolf31o2 Exp $ + + 11 Jan 2005; Chris Gianelloni catalyst, + targets/embedded/embedded-chroot.sh, targets/grp/grp-chroot.sh, + targets/livecd-stage1/livecd-stage1-chroot.sh, + targets/livecd-stage1/livecd-stage1.sh, + targets/netboot/netboot-packages.sh, targets/stage1/stage1-chroot.sh, + targets/stage2/stage2-chroot.sh, targets/stage3/stage3-chroot.sh: + Added a -F or --fetchonly command line option and closing out bug #77480. + Also added a portage version check to livecd-stage1 to close out bug #68307. 11 Jan 2005; Chris Gianelloni livecd/runscript-support/livecdfs-update.sh, diff --git a/catalyst b/catalyst index 73fdb0b7..f6082bf4 100755 --- a/catalyst +++ b/catalyst @@ -1,7 +1,7 @@ #!/usr/bin/python # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.57 2005/01/05 00:17:37 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.58 2005/01/11 14:10:18 wolf31o2 Exp $ # Maintained in full by John Davis @@ -18,6 +18,7 @@ def usage(): print " -C --cli catalyst commandline (MUST BE LAST OPTION)" print " -d --debug enable debugging" print " -f --file read specfile" + print " -F --fetchonly fetch files only" print " -h --help print this help message" print " -s --snapshot generate a Portage snapshot" print " -v --version display version information" @@ -188,8 +189,8 @@ if __name__ == "__main__": # parse out the command line arguments try: - opts,args = getopt.getopt(sys.argv[1:], "hvdc:C:f:Vs:", ["help", "version", "debug",\ - "config=", "cli=", "file=", "verbose","snapshot="]) + opts,args = getopt.getopt(sys.argv[1:], "hvdc:C:f:FVs:", ["help", "version", "debug",\ + "config=", "cli=", "file=", "fetch", "verbose","snapshot="]) except getopt.GetoptError: usage() @@ -198,6 +199,7 @@ if __name__ == "__main__": # defaults for commandline opts debug=False verbose=False + fetch=False myconfig="" myspecfile="" mycmdline=[] @@ -242,6 +244,14 @@ if __name__ == "__main__": if o in ("-f", "--file"): myspecfile=a + + if o in ("-F", "--fetchonly"): + if len(sys.argv) < 3: + print "!!! catalyst: please specify one of either -f or -C\n" + usage() + sys.exit(2) + else: + conf_values["FETCH"]="1" if o in ("-V", "--verbose"): if len(sys.argv) < 3: diff --git a/targets/embedded/embedded-chroot.sh b/targets/embedded/embedded-chroot.sh index 65be6f9f..85579d8a 100755 --- a/targets/embedded/embedded-chroot.sh +++ b/targets/embedded/embedded-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-chroot.sh,v 1.10 2004/10/15 02:46:58 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-chroot.sh,v 1.11 2005/01/11 14:10:19 wolf31o2 Exp $ /usr/sbin/env-update source /etc/profile @@ -27,6 +27,11 @@ then export clst_myemergeopts="--usepkg --buildpkg --newuse" fi +if [ -n "${clst_FETCH}" ] +then + export clst_myemergeopts="${clst_myemergeopts} -f" +fi + # setup the environment export FEATURES="${clst_myfeatures}" export CONFIG_PROTECT="-*" diff --git a/targets/grp/grp-chroot.sh b/targets/grp/grp-chroot.sh index 3350b70a..4e7f8226 100755 --- a/targets/grp/grp-chroot.sh +++ b/targets/grp/grp-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/grp-chroot.sh,v 1.10 2004/10/15 02:46:58 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/grp-chroot.sh,v 1.11 2005/01/11 14:10:19 wolf31o2 Exp $ /usr/sbin/env-update source /etc/profile @@ -37,13 +37,18 @@ then unset DISTDIR export PKGDIR="/tmp/grp/${clst_grp_target}" + if [ -n "${clst_FETCH}" ] + then + export clst_myemergeopts="${clst_myemergeopts} -f" + fi + if [ -n "${clst_VERBOSE}" ] then - emerge --usepkg --buildpkg --noreplace --newuse -vp ${clst_grp_packages} || exit 1 + emerge --usepkg --buildpkg --noreplace --newuse -vp ${clst_myemergeopts} ${clst_grp_packages} || exit 1 sleep 15 fi - emerge --usepkg --buildpkg --noreplace --newuse ${clst_grp_packages} || exit 1 + emerge --usepkg --buildpkg --noreplace --newuse ${clst_myemergeopts} ${clst_grp_packages} || exit 1 else unset DISTDIR #don't grab MS core fonts, etc. diff --git a/targets/livecd-stage1/livecd-stage1-chroot.sh b/targets/livecd-stage1/livecd-stage1-chroot.sh index 18fd89d8..5ebcc841 100755 --- a/targets/livecd-stage1/livecd-stage1-chroot.sh +++ b/targets/livecd-stage1/livecd-stage1-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-chroot.sh,v 1.10 2004/12/15 00:50:35 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-chroot.sh,v 1.11 2005/01/11 14:10:19 wolf31o2 Exp $ /usr/sbin/env-update source /etc/profile @@ -24,9 +24,14 @@ fi if [ -n "${clst_PKGCACHE}" ] then - clst_emergeopts="--usepkg --buildpkg --newuse" + export clst_emergeopts="--usepkg --buildpkg --newuse" else - clst_emergeopts="" + export clst_emergeopts="" +fi + +if [ -n "${clst_FETCH}" ] +then + export clst_emergeopts="${clst_emergeopts} -f" fi ## setup the environment @@ -44,6 +49,15 @@ then sleep 15 fi -for packages in ${clst_packages}; do - emerge ${clst_emergeopts} ${packages} -done +portage_version=`/usr/lib/portage/bin/portageq best_version / sys-apps/portage \ + | cut -d/ -f2 | cut -d- -f2,3` + +if [ `echo ${portage_version} | cut -d- -f1 | cut -d. -f3` -ge 51 ] && + [ `echo ${portage_version} | cut -d- -f2 | cut -dr -f2` -ge 4 ] +then + emerge ${clst_emergeopts} ${clst_packages} +else + for packages in ${clst_packages}; do + emerge ${clst_emergeopts} ${packages} + done +fi diff --git a/targets/livecd-stage1/livecd-stage1.sh b/targets/livecd-stage1/livecd-stage1.sh index 0bdc588d..363e885a 100755 --- a/targets/livecd-stage1/livecd-stage1.sh +++ b/targets/livecd-stage1/livecd-stage1.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/Attic/livecd-stage1.sh,v 1.14 2004/12/16 15:26:22 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/Attic/livecd-stage1.sh,v 1.15 2005/01/11 14:10:19 wolf31o2 Exp $ case $1 in enter) @@ -16,7 +16,7 @@ case $1 in ;; preclean) - killall -9 gconfd-2 + #killall -9 gconfd-2 #cp ${clst_sharedir}/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh ${clst_chroot_path}/tmp #${clst_CHROOT} ${clst_chroot_path} /tmp/livecd-stage1-preclean-chroot.sh || exit 1 #rm -f ${clst_chroot_path}/tmp/livecd-stage1-preclean-chroot.sh diff --git a/targets/netboot/netboot-packages.sh b/targets/netboot/netboot-packages.sh index 050294b5..99518c51 100644 --- a/targets/netboot/netboot-packages.sh +++ b/targets/netboot/netboot-packages.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/netboot/Attic/netboot-packages.sh,v 1.2 2004/10/11 14:19:30 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/netboot/Attic/netboot-packages.sh,v 1.3 2005/01/11 14:10:19 wolf31o2 Exp $ /usr/sbin/env-update source /etc/profile @@ -11,7 +11,12 @@ source /etc/profile # setup our environment export FEATURES="${clst_myfeatures}" export CONFIG_PROTECT="-*" -export USE_ORDER="env:conf:defaults" +export USE_ORDER="env:conf:defaults" + +if [ "${clst_FETCH}" ] +then + export clst_myemergeopts="${clst_myemergeopts} -f" +fi # START BUILD if [ "${clst_VERBOSE}" ] diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index c756c8ac..b72477f7 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.25 2004/11/23 00:02:57 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.26 2005/01/11 14:10:19 wolf31o2 Exp $ /usr/sbin/env-update source /etc/profile @@ -27,6 +27,11 @@ then export clst_myemergeopts="${clst_myemergeopts} --usepkg --buildpkg --newuse" fi +if [ -n "${clst_FETCH}" ] +then + export clst_myemergeopts="${clst_myemergeopts} -f" +fi + # setup our environment export FEATURES="${clst_myfeatures}" export ROOT=${1} diff --git a/targets/stage2/stage2-chroot.sh b/targets/stage2/stage2-chroot.sh index 48b4115c..866348e9 100755 --- a/targets/stage2/stage2-chroot.sh +++ b/targets/stage2/stage2-chroot.sh @@ -1,7 +1,7 @@ #!/bin/sh # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-chroot.sh,v 1.9 2004/11/23 00:02:57 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-chroot.sh,v 1.10 2005/01/11 14:10:19 wolf31o2 Exp $ /usr/sbin/env-update source /etc/profile @@ -27,6 +27,11 @@ then export bootstrap_opts="-r" fi +if [ -n "${clst_FETCH}" ] +then + export bootstrap_opts="-f" +fi + GRP_STAGE23_USE="$(portageq envvar GRP_STAGE23_USE)" diff --git a/targets/stage3/stage3-chroot.sh b/targets/stage3/stage3-chroot.sh index 57681b45..7865269e 100755 --- a/targets/stage3/stage3-chroot.sh +++ b/targets/stage3/stage3-chroot.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-chroot.sh,v 1.14 2005/01/11 13:12:36 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/stage3-chroot.sh,v 1.15 2005/01/11 14:10:19 wolf31o2 Exp $ /usr/sbin/env-update source /etc/profile @@ -27,6 +27,11 @@ then export clst_myemergeopts="${clst_myemergeopts} --usepkg --buildpkg --newuse" fi +if [ -n "${clst_FETCH}" ] +then + export clst_myemergeopts="${clst_myemergeopts} -f" +fi + GRP_STAGE23_USE="$(portageq envvar GRP_STAGE23_USE)" # setup the build environment @@ -41,7 +46,7 @@ USE="build" emerge portage if [ -n "${clst_VERBOSE}" ] then - emerge ${clst_myemergeopts} -vp system || exit 1 + emerge -e ${clst_myemergeopts} -vp system || exit 1 sleep 15 fi