Apologies, this was an error due to manual merge.
I have made the required changes, ran "make packages" and also ran the test cases and they are clean.

Attached is the new patch.
Could any one please push this.

Thanks,
Thejaswini K

On 09/08/12 23:56, Danek Duvall wrote:
[email protected] wrote:

Author: [email protected]
Repository: /hg/pkg/gate
Branch: default
Latest revision: 4361a284bbcb8b50c83056f440cdd6d64d30508c
Total changesets: 1
Log message:
7140506 Package Manager and Update Manager should use get_default_image_dir
7140761 Package Manager window title wrong
I had to back this out; the automated build had this to say:

     C0301: 73: Line too long (86/80)
     E0602: 72:CheckForUpdates.__init__: Undefined variable 'debug'

The first isn't too bad (though still would have caused the build to fail,
as we've set it up), but the second looks like a bad copy/paste error that
needs to be corrected before this can go back again.

Danek
# HG changeset patch
# User [email protected]
# Date 1347254863 -19800
# Node ID c3922d06ad0655e8dbf191d6fa79507ba762490c
# Parent  94435d89e7c57c77644ce9850491b67136c57a7e
7140506 Package Manager and Update Manager should use get_default_image_dir
7140761 Package Manager window title wrong

diff -r 94435d89e7c5 -r c3922d06ad06 src/checkforupdates.py
--- a/src/checkforupdates.py    Sat Sep 08 11:23:12 2012 -0700
+++ b/src/checkforupdates.py    Mon Sep 10 10:57:43 2012 +0530
@@ -37,6 +37,7 @@
 import traceback
 import warnings
 
+import pkg.client.api as api
 import pkg.client.api_errors as apx
 import pkg.client.progress as progress
 import pkg.client.printengine as printengine
@@ -63,8 +64,14 @@
                 global_settings.client_name = nongui_misc.get_um_name()
                 self.api_lock = nrlock.NRLock()
                 self.image_dir_arg = image_directory
+                self.exact_match = True
                 if self.image_dir_arg == None:
-                        self.image_dir_arg = nongui_misc.get_image_path()
+                        self.image_dir_arg, self.exact_match =  \
+                            api.get_default_image_root()
+                if not self.exact_match:
+                        logger.debug("Unable to get image directory")
+                        sys.exit(enumerations.UPDATES_UNDETERMINED)
+                        
                 self.application_path = application_path
                 self.check_all = check_all
                 self.check_cache_only = check_cache
@@ -264,7 +271,7 @@
         """Main routine for this utility"""
         set_check_all = True
         set_check_cache = False
-        image_dir = "/"
+        image_dir = None 
         try:
                 # Unused variable pargs; pylint: disable-msg=W0612
                 opts, pargs = getopt.getopt(sys.argv[1:], "hdnacR:",
diff -r 94435d89e7c5 -r c3922d06ad06 src/modules/gui/installupdate.py
--- a/src/modules/gui/installupdate.py  Sat Sep 08 11:23:12 2012 -0700
+++ b/src/modules/gui/installupdate.py  Mon Sep 10 10:57:43 2012 +0530
@@ -558,8 +558,11 @@
 
         def __on_confirm_cancel_button_clicked(self, widget):
                 self.w_confirm_dialog.hide()
-                if self.top_level and widget: # User clicked cacnel, widget != 
None
-                        gobject.idle_add(self.parent.install_terminated)
+                if widget: # User clicked cancel, widget != None
+                     if self.top_level:
+                         gobject.idle_add(self.parent.install_terminated)
+                     else:
+                         self.w_dialog.hide()
 
         def __on_createplandialog_delete(self, widget, event):
                 self.__on_cancelcreateplan_clicked(None)
@@ -1023,10 +1026,8 @@
                 self.w_confirm_ok_button.grab_focus()
                 self.__start_substage(None,
                             bounce_progress=False)
-                if self.top_level:
+                if not self.top_level:
                         self.__reset_window_title()
-                else:
-                        self.w_dialog.hide()
                 self.w_confirm_dialog.show()
 
 
diff -r 94435d89e7c5 -r c3922d06ad06 src/modules/gui/misc.py
--- a/src/modules/gui/misc.py   Sat Sep 08 11:23:12 2012 -0700
+++ b/src/modules/gui/misc.py   Mon Sep 10 10:57:43 2012 +0530
@@ -19,7 +19,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 SPECIAL_CATEGORIES = ["locale", "plugin"] # We should cut all, but last part 
of the
@@ -66,7 +66,6 @@
 from pkg.gui.misc_non_gui import get_log_info_ext as ge_log_info_ext
 from pkg.gui.misc_non_gui import get_catalogrefresh_exception_msg as get_msg
 from pkg.gui.misc_non_gui import get_um_name as get_um
-from pkg.gui.misc_non_gui import get_image_path as g_image_path
 from pkg.gui.misc_non_gui import is_frameworkerror as is_frameworke
 
 from pkg.client import global_settings
@@ -187,9 +186,6 @@
                     gtk.MESSAGE_INFO)
                 return False
         return True
-
-def get_image_path():
-        return g_image_path()
                 
 def get_version():
         return g_version()
diff -r 94435d89e7c5 -r c3922d06ad06 src/modules/gui/misc_non_gui.py
--- a/src/modules/gui/misc_non_gui.py   Sat Sep 08 11:23:12 2012 -0700
+++ b/src/modules/gui/misc_non_gui.py   Mon Sep 10 10:57:43 2012 +0530
@@ -46,19 +46,6 @@
 LOG_ERROR_EXT = "_error.log"
 LOG_INFO_EXT = "_info.log"
 PKG_CLIENT_NAME_UM = "updatemanager"
-IMAGE_DIRECTORY_DEFAULT = "/"   # Image default directory
-IMAGE_DIR_COMMAND = "svcprop -p update/image_dir svc:/application/pkg/update"
-
-
-def get_image_path():
-        try:
-                image_directory = os.environ["PKG_IMAGE"]
-        except KeyError:
-                image_directory = \
-                    os.popen(IMAGE_DIR_COMMAND).readline().rstrip()
-                if len(image_directory) == 0:
-                        image_directory = IMAGE_DIRECTORY_DEFAULT
-        return image_directory
 
 def get_log_dir():
         return LOG_DIR
diff -r 94435d89e7c5 -r c3922d06ad06 src/packagemanager.py
--- a/src/packagemanager.py     Sat Sep 08 11:23:12 2012 -0700
+++ b/src/packagemanager.py     Mon Sep 10 10:57:43 2012 +0530
@@ -19,7 +19,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 NOTEBOOK_PACKAGE_LIST_PAGE = 0            # Main Package List page index
@@ -4957,11 +4957,13 @@
                 elif option in ("-i", "--info-install"):
                         info_install_arg = argument
 
+        provided_image_dir = True
         if image_dir == None:
-                try:
-                        image_dir = os.environ["PKG_IMAGE"]
-                except KeyError:
-                        image_dir = "/"
+                image_dir, provided_image_dir = api.get_default_image_root()
+
+        if not provided_image_dir:
+                print _("Unable to get the image directory")
+                sys.exit(1)
 
         try:
                 gtk.init_check()
diff -r 94435d89e7c5 -r c3922d06ad06 src/svc/pkg-update.xml
--- a/src/svc/pkg-update.xml    Sat Sep 08 11:23:12 2012 -0700
+++ b/src/svc/pkg-update.xml    Mon Sep 10 10:57:43 2012 +0530
@@ -19,7 +19,7 @@
 
        CDDL HEADER END
 
-       Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights 
reserved.
+       Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights 
reserved.
 
        NOTE:  This service manifest is not editable; its contents will
        be overwritten by package or patch operations, including
@@ -76,10 +76,6 @@
                <propval name='duration' type='astring' value='transient' />
        </property_group>
 
-       <property_group name='update' type='application'>
-               <propval name='image_dir' type='astring' value='/' />
-       </property_group>
-
        <stability value='Unstable' />
 
        <template>
diff -r 94435d89e7c5 -r c3922d06ad06 src/um/update-refresh.sh
--- a/src/um/update-refresh.sh  Sat Sep 08 11:23:12 2012 -0700
+++ b/src/um/update-refresh.sh  Mon Sep 10 10:57:43 2012 +0530
@@ -77,9 +77,9 @@
 let dither=dither/32767
 sleep $dither
 
-image_dir=$(svcprop -p update/image_dir $fmri || echo "/")
+image_dir=/
 pkg -R $image_dir refresh -q 2>/dev/null
 
 # Check and cache whether updates are available
-/usr/lib/pm-checkforupdates -R $image_dir --nice
+/usr/lib/pm-checkforupdates --nice
 exit 0
diff -r 94435d89e7c5 -r c3922d06ad06 src/updatemanager.py
--- a/src/updatemanager.py      Sat Sep 08 11:23:12 2012 -0700
+++ b/src/updatemanager.py      Mon Sep 10 10:57:43 2012 +0530
@@ -19,7 +19,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 import getopt
@@ -38,6 +38,7 @@
 except ImportError:
         sys.exit(1)
 
+import pkg.client.api as api
 import pkg.client.progress as progress
 import pkg.gui.enumerations as enumerations
 import pkg.gui.installupdate as installupdate
@@ -64,8 +65,14 @@
                 global_settings.client_name = gui_misc.get_um_name()
                 self.api_lock = nrlock.NRLock()
                 self.image_dir_arg = image_directory
+                self.exact_match = True
                 if self.image_dir_arg == None:
-                        self.image_dir_arg = gui_misc.get_image_path()
+                        self.image_dir_arg, self.exact_match = \
+                            api.get_default_image_root()
+                if not self.exact_match:
+                        if debug:
+                                print >> sys.stderr, ("Unable to get the image 
directory")
+                        sys.exit(enumerations.UPDATES_UNDETERMINED)
                 self.application_path = application_path
                 self.gconf = pmgconf.PMGConf()
                 try:
diff -r 94435d89e7c5 -r c3922d06ad06 src/updatemanagernotifier.py
--- a/src/updatemanagernotifier.py      Sat Sep 08 11:23:12 2012 -0700
+++ b/src/updatemanagernotifier.py      Mon Sep 10 10:57:43 2012 +0530
@@ -19,7 +19,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 import os
@@ -62,7 +62,6 @@
 SHOW_NOTIFY_ICON_DEFAULT = True
 IMAGE_DIRECTORY_DEFAULT = "/"
 LASTCHECK_DIR_NAME = 
os.path.join(os.path.expanduser("~"),'.updatemanager/notify')
-IMAGE_DIR_COMMAND = "svcprop -p update/image_dir svc:/application/pkg/update"
 CHECKFOR_UPDATES = "/usr/lib/pm-checkforupdates"
 UPDATEMANAGER = "pm-updatemanager"
 
@@ -316,14 +315,9 @@
                 gobject.timeout_add(random_delay * 1000, 
self.check_for_updates)
 
         def check_for_updates(self):
-                image_directory = 
os.popen(IMAGE_DIR_COMMAND).readline().rstrip()
-                if debug == True:
-                        print "image_directory: %s" % image_directory
-                if len(image_directory) == 0:
-                        image_directory = IMAGE_DIRECTORY_DEFAULT
                 proc = subprocess.Popen([CHECKFOR_UPDATES,
                             '--nice', '--checkupdates-cache',
-                            '--image-dir', image_directory],
+                            '--image-dir', IMAGE_DIRECTORY_DEFAULT],
                             stdout=subprocess.PIPE)
 
                 output = proc.communicate()[0].strip()
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to