Title: [Oscar-devel] Bug in scripts/start_over
Hi Ted:
 
I believe that if you re-install OSCAR with the latest revision, it will generate the "pre-oscar rpmlist" during installation, therefore before you run "start_over" you should always have this list.  From the sounds of it, we should simply bail if the pre-oscar rpmlist does not exist since this should not be a situation we want to be in.
 
However, I'll let Erich comment on this after he gets back next week.
 
Cheers,
 
Bernard


From: [EMAIL PROTECTED] on behalf of Ted Powell
Sent: Tue 06/06/2006 19:09
To: OSCAR Devel
Subject: [Oscar-devel] Bug in scripts/start_over

I have r4969 of scripts/start_over.

In the case where $oscar_home/tmp/pre-oscar.rpmlist does not exist
(my situation), %deleterpms remains empty, and this is not handled
correctly.

    my %deleterpms;
    #
    # EF: Do we have a pre-oscar rpmlist? Only then we can safely uninstall.
    #
    if (-f "$oscar_home/tmp/pre-oscar.rpmlist") {
        # much code, some of which adds entries to deleterpms
    }
    # More code, none of which touches deleterpms

    my $cmd = "yum $yes remove ".join(" ",keys(%deleterpms));
    my $err = &do_command($cmd);

The argument to &do_command is therefore: "yum  remove "

The resulting output from the script:

    Using /opt/oscar-5.0a1r4871 as OSCAR base directory
    ##### deleting all OSCAR packages and their dependencies #####
    Deleting all OSCAR images.
    /usr/bin/mksimachine --Delete --all
    yum  remove
    Error: Need to pass a list of pkgs to remove
    Loading "installonlyn" plugin

    usage: yum [options] < update | install | info | remove | list |
        clean | provides | search | check-update | groupinstall |
        groupupdate | grouplist | groupinfo | groupremove |
        makecache | localinstall | erase | upgrade | whatprovides |
        localupdate | resolvedep | shell | deplist >

    options:
      -h, --help            show this help message and exit
      -t, --tolerant        be tolerant of errors
      -C                    run entirely from cache, don't update cache
      -c  [config file]     config file location
      -R  [minutes]         maximum command wait time
      -d  [debug level]     debugging output level
      -e  [error level]     error output level
      -y                    answer yes for all questions
      --version             show Yum version and exit
      --installroot=[path]  set install root
      --enablerepo=[repo]   enable one or more repositories (wildcards allowed)
      --disablerepo=[repo]  disable one or more repositories (wildcards allowed)
      --exclude=[package]   exclude package(s) by name or glob
      --obsoletes           enable obsoletes processing during updates
      --noplugins           disable Yum plugins
    yum returned an error, exiting.

Not desirable, as the script evidently has more things to do.

(Later)
In the case of no pre-oscar.rpmlist, the script goes much better with
this patch. Someone else will have to test the pre-oscar.rpmlist-exists
case.
------------------------------------------------------------------------
--- scripts/start_over-orig     2006-06-06 17:17:49.000000000 -0700
+++ scripts/start_over  2006-06-06 18:59:28.000000000 -0700
@@ -220,16 +220,18 @@
 # constructed from repository info (I hope)...
 #
 #my $cmd = "yum $yes -C remove ".join(" ",keys(%deleterpms));
-my $cmd = "yum $yes remove ".join(" ",keys(%deleterpms));
-my $err = &do_command($cmd);
-
-if ($err) {
-    print "yum returned an error, exiting.\n";
-    exit 1;
+if (%deleterpms) {
+    my $cmd = "yum $yes remove ".join(" ",keys(%deleterpms));
+    my $err = &do_command($cmd);
+
+    if ($err) {
+       print "yum returned an error, exiting.\n";
+       exit 1;
+    }
 }

 my %orepo_done;
-$err = 0;
+# $err = 0; (not used)
 for my $dist (keys %distro_pools) {
     my %d = %{$distro_pools{$dist}};
     my $orepo = $d{oscar_repo};
------------------------------------------------------------------------

--
Ted Powell <[EMAIL PROTECTED]>   http://psg.com/~ted/
"If you don't look, you don't know."
    Dr. Sam Ting, Nobel laureate experimental physicist.


_______________________________________________
Oscar-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oscar-devel

_______________________________________________
Oscar-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to