Re: Can someone help me write a "yes-man" program
- From: Ignoramus1214 <ignoramus1214@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 21 Aug 2008 13:22:14 -0500
On 2008-08-19, Cameron Laird <claird@xxxxxxxxx> wrote:
In article <slrngal8ft.4jb.avl@xxxxxxxxxxxxxxxxxxxxxxxx>,
Andreas Leitgeb <avl@xxxxxxxx> wrote:
Ignoramus16322 <ignoramus16322@xxxxxxxxxxxxxxxxxxxx> wrote:
I am aware of a program "yes", but my issue is that it somehow does
not work with the Ubuntu system upgrade script,
I don't know, which upgrade script you mean. I do have ubuntu,
but there is no script "upgrade", and the only other upgrade
script "update-manager" uses GUI and is not driveable with expect
Whatever script/tool you actually mean, it may have some option
to answer all questions with yes, or if not, since it's a script
you might create a copy of it and comment out all the requests for
affirmation :-)
PS: don't know expect enough to provide the requested solution,
but perhaps the alternative is even better, anyway.
Me, too: while I understand the use of yes(1) and Expect(1),
I don't know of a program that matches the description in the
aspect that it accepts "yes" from Expect(1) but not yes(1).
If there's more to the story--if the program demands more
sophistication than just eternal "yes", for example--then it
might well be appropriate to talk about Expect(1). We'll need
more details, though ...
The Ubuntu script is called
do-release-upgrade
I am using it to upgrade my server farm at work
it calls a bunch of internal ubuntu libraries that I do not want to
modify, here it is
#!/usr/bin/python2.5
import warnings
warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning)
import apt
from UpdateManager.Core.MetaRelease import MetaReleaseCore
from UpdateManager.Core.DistUpgradeFetcherCore import DistUpgradeFetcherCore
from optparse import OptionParser
from gettext import gettext as _
import time
import sys
if __name__ == "__main__":
parser = OptionParser()
parser.add_option ("-d", "--devel-release", action="store_true",
dest="devel_release", default=False,
help=_("Check if upgrading to the latest devel release "
"is possible"))
parser.add_option ("-p", "--proposed", action="store_true",
dest="proposed_release", default=False,
help=_("Try upgrading to the latest release using "
"the upgrader from $distro-proposed"))
parser.add_option ("-m", "--mode", default="server",
dest="mode",
help=_("Run in a special upgrade mode.\n"
"Currently 'desktop' for regular upgrades of "
"a desktop system and 'server' for server "
"systems are supported."))
parser.add_option ("-f", "--frontend", default="DistUpgradeViewText",
dest="frontend",
help=_("Run the specified frontend"))
(options, args) = parser.parse_args()
print _("Checking for a new ubuntu release")
m = MetaReleaseCore(useDevelopmentRelease=options.devel_release,
useProposed=options.proposed_release)
# this will timeout eventually
while m.downloading:
time.sleep(0.5)
if m.new_dist is None:
print _("No new release found")
sys.exit(1)
# we have a new dist
progress = apt.progress.TextFetchProgress()
fetcher = DistUpgradeFetcherCore(new_dist=m.new_dist,
progress=progress)
fetcher.run_options += ["--mode=%s" % options.mode,
"--frontend=%s" % options.frontend,
]
fetcher.run()
--
Due to extreme spam originating from Google Groups, and their inattention
to spammers, I and many others block all articles originating
from Google Groups. If you want your postings to be seen by
more readers you will need to find a different means of
posting on Usenet.
http://improve-usenet.org/
.
- Follow-Ups:
- Re: Can someone help me write a "yes-man" program
- From: Cameron Laird
- Re: Can someone help me write a "yes-man" program
- References:
- Can someone help me write a "yes-man" program
- From: Ignoramus16322
- Re: Can someone help me write a "yes-man" program
- From: Andreas Leitgeb
- Re: Can someone help me write a "yes-man" program
- From: Cameron Laird
- Can someone help me write a "yes-man" program
- Prev by Date: Re: Tcl/Tk 8.5 vs iwidget 4.0.2
- Next by Date: Re: How to upgrade to 8.5?
- Previous by thread: Re: Can someone help me write a "yes-man" program
- Next by thread: Re: Can someone help me write a "yes-man" program
- Index(es):
Relevant Pages
|