Something we ran in to here is that when you use mksiimage to create an
image, there is no sanity check to verify that each package in the rpm list
is available in the repository in some form.

For package type rpm, which is managed by yum/yume and 'PackManSmart.pm'
(systeminstaller-oscar), the files_find function in fact is basically
a no-op - just returning the full array of packages back.

The comment is that the "smart" package management can handle dependencies.
I agree with this.  However, if you include a package that doesn't exist
in the rpmlist, you aren't really notified.

This led to some pain here recently.  For the short term, we're using this
"incorrect" fix.  I know it isn't great on a few levels, but I think it
does illustrate what I'm trying to solve.  If someone wants to offer some
ideas, I'd be willing to take a crack at fixing this for real.

Erik


diff -Naru 
systeminstaller-oscar-2.3.1.sgi-orig/lib/SystemInstaller/Package/PackManSmart.pm
 systeminstaller-oscar-2.3.1.sgi/lib/SystemInstaller/Package/PackManSmart.pm
--- 
systeminstaller-oscar-2.3.1.sgi-orig/lib/SystemInstaller/Package/PackManSmart.pm
    2007-08-20 09:04:07.000000000 -0500
+++ systeminstaller-oscar-2.3.1.sgi/lib/SystemInstaller/Package/PackManSmart.pm 
2007-08-20 13:50:29.000000000 -0500
@@ -67,6 +67,18 @@
 # are resolved. The package manager will fail later when it cannot
 # resolve dependencies.
 #
+# SGI: The original version of this function simply returned @pkglist
+# back with the justifaction, that you see above, that the smart package
+# management will handle all dependencies.  While this is true, what we
+# do not have is a sanity check for if a package is in the rpm list
+# but is not available in a repository.  That should signal a critical
+# error -- that we want to install something that isn't available.
+# yume & yum only call out warnings if a listed package isn't found and
+# don't error out.  So here we simply verify that every listed package
+# exists in the repositories somewhere.  Note that using yume in this
+# function may not technically be correct since that's more of a
+# PackMan thing.  This is our first go at fixing this.
+#
 # Input:       rpm paths, architecture, pkg list
 # Returns:     file list or null if failure.
 
@@ -75,6 +87,31 @@
         my $arch   = shift;
         my (@pkglist) = @_;
 
+        my @repoDirs = split(",",$rpmdir);
+        my $yumeCmd = "yume ";
+        my @yumeOutput;
+
+        foreach my $p (@repoDirs) {
+                $yumeCmd .= "--repo $p ";
+        }
+
+        $yumeCmd .= '--repoquery -qa --qf "%{NAME}"';
+        @yumeOutput =  split(/\n/,`$yumeCmd`);
+
+        if ( $? != 0) {
+                print "ERROR: This yume command failed: $yumeCmd\n";
+                return ();
+        }
+
+        foreach my $p (@pkglist) {
+                $p =~ s/\+/\\+/g; # Escape plues so grep doesn't fail
+                if (!(grep(/^${p}$/, @yumeOutput))) {
+                        print "ERROR: Package $p, from the package list, is 
not available in the repos!\n";
+                        #exit 1;
+                        return ();
+                }
+        }
+
         return @pkglist;
 
 } #files_find

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Oscar-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to