From 6d78a0dc2a14a0bc58640c21a48bfb3e3de6dda5 Mon Sep 17 00:00:00 2001 From: "John P. Davis" Date: Mon, 13 Sep 2004 14:27:07 +0000 Subject: [PATCH] bugfixes for #60887 and #63338 git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@436 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 6 ++- catalyst | 42 ++++++++++++++++++--- livecd/runscript-support/livecdfs-update.sh | 13 ++++++- 3 files changed, 52 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 28ecb5be..d2b536f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for gentoo/src/catalyst # Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.82 2004/09/09 05:09:11 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.83 2004/09/13 14:27:07 zhen Exp $ + + 13 Sep 2004; John Davis catalyst, + livecd/runscript-support/livecdfs-update.sh: + bugfixes for #60887 and #63338 09 Sep 2004; John Davis catalyst: bugfixes for #63382 and #63338 diff --git a/catalyst b/catalyst index 2daada0f..bc2c63e8 100755 --- a/catalyst +++ b/catalyst @@ -1,7 +1,7 @@ #!/usr/bin/python # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.46 2004/09/09 05:28:20 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.47 2004/09/13 14:27:07 zhen Exp $ # Maintained in full by John Davis @@ -193,25 +193,49 @@ if __name__ == "__main__": myconfig="" myspecfile="" mycmdline=[] - + myopts=[] + + # check preconditions if len(opts) == 0: - print "!!! catalyst: please specify one of either -f or -C" + print "!!! catalyst: please specify one of either -f or -C\n" + usage() sys.exit(2) + # check to see if -f and -C are used together + for i in opts: + myopts.append(i[0]) + + if ('-f' in myopts or '--file' in myopts) and ('-C' in myopts or '--cli' in myopts): + print "!!! catalyst: please specify one of either -f or -C\n" + usage() + sys.exit(2) + for o, a in opts: if o in ("-h", "--help"): usage() - sys.exit(2) + sys.exit(1) if o in ("-v", "--version"): print "Catalyst version "+__version__ - sys.exit(2) + sys.exit(1) if o in ("-d", "--debug"): conf_values["DEBUG"]="1" + + # the debug option cannot be used alone + if not ('-f' in myopts or '--file' in myopts) or ('-C' in myopts or '--cli' in myopts): + print "!!! catalyst: please specify one of either -f or -C\n" + usage() + sys.exit(2) if o in ("-c", "--config"): myconfig=a + + # the config file option cannot be used alone + if not ('-f' in myopts or '--file' in myopts) or ('-C' in myopts or '--cli' in myopts): + print "!!! catalyst: please specify one of either -f or -C\n" + usage() + sys.exit(2) if o in ("-C", "--cli"): x=sys.argv.index(o)+1 @@ -224,7 +248,13 @@ if __name__ == "__main__": if o in ("-V", "--verbose"): conf_values["VERBOSE"]="1" - + + # the verbosity option cannot be used alone + if not ('-f' in myopts or '--file' in myopts) or ('-C' in myopts or '--cli' in myopts): + print "!!! catalyst: please specify one of either -f or -C\n" + usage() + sys.exit(2) + # import configuration file and import our main module using those settings parse_config(myconfig) sys.path.append(conf_values["sharedir"]+"/modules") diff --git a/livecd/runscript-support/livecdfs-update.sh b/livecd/runscript-support/livecdfs-update.sh index 13d57e46..ff8a4eed 100755 --- a/livecd/runscript-support/livecdfs-update.sh +++ b/livecd/runscript-support/livecdfs-update.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/livecdfs-update.sh,v 1.11 2004/08/31 01:40:24 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript-support/Attic/livecdfs-update.sh,v 1.12 2004/09/13 14:27:07 zhen Exp $ /usr/sbin/env-update source /etc/profile @@ -10,7 +10,6 @@ if [ -e /etc/sshd/sshd_config ] then #allow root logins to the livecd by default sed -i "s/^#PermitRootLogin\ yes/PermitRootLogin\ yes/" /etc/ssh/sshd_config - #mv /etc/ssh/sshd_config1 /etc/ssh/sshd_config fi # fix /etc/issue for mingetty and friends @@ -108,3 +107,13 @@ then exit 1 fi fi + +# tweak the livecd fstab so that users know not to edit it +# http://bugs.gentoo.org/show_bug.cgi?id=60887 +mv /etc/fstab /etc/fstab.old +echo "###############################################" >> /etc/fstab +echo "## ATTENTION: THIS IS THE FSTAB ON THE LIVECD" >> /etc/fstab +echo "## PLEASE EDIT THE FSTAB IN /mnt/gentoo/etc" >> /etc/fstab +echo "###############################################" >> /etc/fstab +cat /etc/fstab.old >> /etc/fstab +rm /etc/fstab.old -- 2.26.2