Re: Can someone help me write a "yes-man" program



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/
.



Relevant Pages

  • Re: Jaunty still in Beta?
    ... unstable as beta and alpha RCs, so they can't be used as examples in the ... Debian lists and forums, I believe I can say lots and lots, because that's ... they loose network after a new kernel and/or udev upgrade I think. ... Coming back to Ubuntu though, ...
    (Ubuntu)
  • automate dcpromo during nt4 pdc upgrade to W2k3 DC
    ... I am attempting to script the upgrade of a NT4 PDC to a W2K3 domain ... I have set the UnAttendMode to ... FullUnattended and the upgrade works perfectly up to the point where the ... @rem SetupMgrTag ...
    (microsoft.public.windows.server.migration)
  • Re: How often will LTS releases be released?
    ... years and do not want to do any major upgrade during that time. ... Then we continue this rolling schedule. ... I know that in a system administrators view Ubuntu is much easier to ... and that it could fit in into the thinking above. ...
    (Ubuntu)
  • Re: samba-common = 3.0.23d-4 but 3.0.24-2 is installed
    ... wants to upgrade to is 3.0.23d-4 which is lower. ... The problem is that the pre-removal script ... Reading package lists... ... warning - old pre-removal script returned error exit status 102 ...
    (Debian-User)
  • Re: FC2 upgrade-X problem
    ... Immideately after upgrade completed I ran 'yum update' ... > getting the X server to launch. ... I made up a test script that runs all the ... > longer able to run startx. ...
    (Fedora)