diff -u system-config-printer-1.5.7+20160212/debian/changelog system-config-printer-1.5.7+20160212/debian/changelog --- system-config-printer-1.5.7+20160212/debian/changelog +++ system-config-printer-1.5.7+20160212/debian/changelog @@ -1,3 +1,18 @@ +system-config-printer (1.5.7+20160212-0ubuntu2) xenial; urgency=medium + + * debian/patches/50_newprinter-support-smb-printer-setup-without-samba-installed.patch: + Allow the setup of SMB printers also when no Samba client software is + installed. Install the software as soon as it is needed for browsing + the network and using the printer. + * debian/patches/47_installpackage-return-only-if-installation-complete.patch: + When installing a package via installpackage.py let the installing + methods only exit when the package is completely installed. + * debian/control: Demoted python3-smbc from Depends: to Suggests:, + it pulls in the Python2 stack, as Samba is not yet fully migrated + to Python3 (LP: #1552868). + + -- Till Kamppeter Mon, 7 Mar 2016 22:06:14 -0300 + system-config-printer (1.5.7+20160212-0ubuntu1) xenial; urgency=medium * New upstream release diff -u system-config-printer-1.5.7+20160212/debian/control system-config-printer-1.5.7+20160212/debian/control --- system-config-printer-1.5.7+20160212/debian/control +++ system-config-printer-1.5.7+20160212/debian/control @@ -9,8 +9,9 @@ Package: system-config-printer-common Architecture: all -Depends: ${shlibs:Depends}, ${python3:Depends}, python3-cups (>= 1.9.60), python3-smbc, python3-dbus, python3-cupshelpers +Depends: ${shlibs:Depends}, ${python3:Depends}, python3-cups (>= 1.9.60), python3-dbus, python3-cupshelpers Recommends: system-config-printer-udev, avahi-utils +Suggests: python3-smbc Conflicts: system-config-printer, system-config-printer-kde (< 0.09ubuntu1) Replaces: system-config-printer, system-config-printer-gnome (<< 1.3.11+20120807-0ubuntu7) Description: Printer configuration GUI only in patch2: unchanged: --- system-config-printer-1.5.7+20160212.orig/debian/patches/47_installpackage-return-only-if-installation-complete.patch +++ system-config-printer-1.5.7+20160212/debian/patches/47_installpackage-return-only-if-installation-complete.patch @@ -0,0 +1,21 @@ +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.5.7+20160212/installpackage.py system-config-printer-1.5.7+20160212.new/installpackage.py +--- system-config-printer-1.5.7+20160212/installpackage.py 2016-02-12 23:12:30.000000000 -0200 ++++ system-config-printer-1.5.7+20160212.new/installpackage.py 2016-03-07 21:57:57.774894711 -0300 +@@ -44,7 +44,7 @@ + try: + if self.iface is not None: + self.iface.InstallPackageNames(xid, [name], +- "hide-finished,show-warnings", ++ "show-progress,show-finished,show-warning", + timeout = 999999) + except dbus.exceptions.DBusException: + pass +@@ -53,7 +53,7 @@ + try: + if self.iface is not None: + self.iface.InstallProvideFiles(xid, [filename], +- "hide-finished,show-warnings", ++ "show-progress,show-finished,show-warning", + timeout = 999999) + except dbus.exceptions.DBusException: + pass only in patch2: unchanged: --- system-config-printer-1.5.7+20160212.orig/debian/patches/50_newprinter-support-smb-printer-setup-without-samba-installed.patch +++ system-config-printer-1.5.7+20160212/debian/patches/50_newprinter-support-smb-printer-setup-without-samba-installed.patch @@ -0,0 +1,112 @@ +diff -Nur -x '*.orig' -x '*~' system-config-printer-1.5.7+20160212/newprinter.py system-config-printer-1.5.7+20160212.new/newprinter.py +--- system-config-printer-1.5.7+20160212/newprinter.py 2016-03-07 21:58:50.534568106 -0300 ++++ system-config-printer-1.5.7+20160212.new/newprinter.py 2016-03-07 21:59:01.266502073 -0300 +@@ -484,11 +484,7 @@ + + # SMB browser + self.smb_store = Gtk.TreeStore (GObject.TYPE_PYOBJECT) +- self.btnSMBBrowse.set_sensitive (PYSMB_AVAILABLE) +- if not PYSMB_AVAILABLE: +- self.btnSMBBrowse.set_tooltip_text (_("Browsing not available " +- "(pysmbc not installed)")) +- ++ self.btnSMBBrowse.set_sensitive (True) + self.tvSMBBrowser.set_model (self.smb_store) + + # SMB list columns +@@ -1380,7 +1376,7 @@ + def _handlePrinterInstallationStage (self, page_nr, step): + if self.dialog_mode != "download_driver": + uri = self.device.uri +- if uri and uri.startswith ("smb://"): ++ if uri and uri.startswith ("smb"): + # User has selected an smb device + uri = SMBURI (uri=uri[6:]).sanitize_uri () + self._installSMBBackendIfNeeded () +@@ -2247,6 +2243,13 @@ + row=[network_dict['device-info'], + PhysicalDevice (network), False]) + model.insert_after (network_iter, find_nw_iter, row=['', None, True]) ++ smbdev_dict = { 'device-class': 'network', ++ 'device-info': _("Windows Printer via SAMBA") } ++ smbdev = cupshelpers.Device ('smb', **smbdev_dict) ++ find_smb_iter = model.append (network_iter, ++ row=[smbdev_dict['device-info'], ++ PhysicalDevice (smbdev), False]) ++ model.insert_after (find_nw_iter, find_smb_iter, row=['', None, True]) + self.devices_uri_iter = uri_iter + self.devices_find_nw_iter = find_nw_iter + self.devices_network_iter = network_iter +@@ -2365,8 +2368,9 @@ + else: + device2.uri = "delete" + devices = [x for x in devices if x.uri not in ("hp", "hpfax", +- "hal", "beh", +- "scsi", "http", "delete")] ++ "hal", "beh", "smb", ++ "scsi", "http", ++ "delete")] + newdevices = [] + for device in devices: + physicaldevice = PhysicalDevice (device) +@@ -2460,6 +2464,26 @@ + + ## SMB browsing + ++ def install_python3_smbc_if_needed (self): ++ global PYSMB_AVAILABLE ++ global pysmb # Make the import of pysmb globally available ++ # Does the SMB client library need to be installed? ++ if not PYSMB_AVAILABLE: ++ debugprint ("No SMB client library present so attempting install") ++ try: ++ pk = installpackage.PackageKit () ++ # The following call means a blocking, synchronous, D-Bus call ++ pk.InstallPackageName (0, 0, "python3-smbc") ++ try: ++ import pysmb ++ PYSMB_AVAILABLE=True ++ debugprint ("SMB client successfully installed and set up.") ++ except: ++ debugprint ("SMB client setup failed.") ++ except: ++ debugprint ("Error during installation/setup of SMB client.") ++ return PYSMB_AVAILABLE ++ + def browse_smb_hosts(self): + """Initialise the SMB tree store.""" + store = self.smb_store +@@ -2665,10 +2689,7 @@ + ready (self.SMBBrowseDialog) + + def set_btnSMBVerify_sensitivity (self, on): +- self.btnSMBVerify.set_sensitive (PYSMB_AVAILABLE and on) +- if not PYSMB_AVAILABLE or not on: +- self.btnSMBVerify.set_tooltip_text (_("Verification requires the " +- "%s module") % "pysmbc") ++ self.btnSMBVerify.set_sensitive (on) + + def on_entSMBURI_changed (self, ent): + allowed_chars = string.ascii_letters+string.digits+'_-./:%[]@' +@@ -2704,6 +2725,10 @@ + self.btnSMBBrowseOk.set_sensitive(iter is not None and is_share) + + def on_btnSMBBrowse_clicked(self, button): ++ """Check whether the needed SMB client library is available and""" ++ """install it if needed""" ++ if not self.install_python3_smbc_if_needed(): return ++ + self.btnSMBBrowseOk.set_sensitive(False) + + try: +@@ -2778,6 +2803,10 @@ + self.tblSMBAuth.set_sensitive(widget.get_active()) + + def on_btnSMBVerify_clicked(self, button): ++ """Check whether the needed SMB client library is available and""" ++ """install it if needed""" ++ if not self.install_python3_smbc_if_needed(): return ++ + uri = self.entSMBURI.get_text () + (group, host, share, u, p) = SMBURI (uri=uri).separate () + user = ''