Compare commits

...

13 Commits

Author SHA1 Message Date
openeuler-ci-bot
e1d320c328
!62 backport Fix compatibility with python3 in putFile method
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-12-29 03:26:42 +00:00
openeuler-ci-bot
b59e031c2e
!58 backport Fix writing of advanced settings
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-12-25 06:53:28 +00:00
liyuan
d56e953907 backport Fix compatibility with python3 in putFile method 2023-12-22 02:39:03 +08:00
liyuan
5c6156d326 backport Fix writing of advanced settings 2023-12-21 21:58:11 +08:00
openeuler-ci-bot
dd9b0ff73a
!55 Fix bad call of cups connection getFile
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-11-24 09:24:11 +00:00
openeuler-ci-bot
f3c792425d
!52 backport Fix bad use of NamedTemporaryFile
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-11-10 03:20:32 +00:00
liyuan
32d3b25682 Fix bad call of cups connection getFile 2023-11-07 00:20:35 +08:00
liyuan
50699379c3 backport Fix bad use of NamedTemporaryFile 2023-11-06 08:28:15 +08:00
openeuler-ci-bot
6e449611be
!49 backport Fix TypeError raised by debugprint call
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-11-03 03:13:56 +00:00
liyuan
5ebd7d7e8b backport Fix TypeError raised by debugprint call 2023-11-02 19:54:15 +08:00
openeuler-ci-bot
a5d2f5f85c
!46 backport Fix typo in debugprint call
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-10-27 02:07:29 +00:00
openeuler-ci-bot
a6f46e74bb
!43 backport Several fixes for scp-dbus-service
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-10-20 08:05:00 +00:00
openeuler-ci-bot
23a28d22f9
!40 backport Fix constructing the auth dialog
From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
2023-10-12 08:16:20 +00:00
6 changed files with 205 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From 4ab0958643827777f526b180ece874d40009986d Mon Sep 17 00:00:00 2001
From: Tomas Korbar <tkorbar@redhat.com>
Date: Thu, 27 Sep 2018 17:27:39 +0200
Subject: [PATCH] Fix TypeError raised by debugprint call
- this error is caused by typo in options.py:424 debugprint call
- debugprint function takes only one parameter so i think it should
have been formated string
- fix https://bugzilla.redhat.com/show_bug.cgi?id=1619593
---
options.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/options.py b/options.py
index 4dc0b1fe..d756f98d 100644
--- a/options.py
+++ b/options.py
@@ -421,7 +421,7 @@ class OptionSelectOne(Option):
self.selector.set_active(selected)
else:
debugprint("Unknown value for %s: %s" % (name, value))
- debugprint("Choices:", supported)
+ debugprint("Choices: %s" % (supported))
if len(supported) > 0:
debugprint("Selecting from choices:", supported[0])
self.selector.set_active(0)
--
2.33.0

View File

@ -0,0 +1,67 @@
From f5f670069d6aef364b2245b5b3068e4c4a1c1148 Mon Sep 17 00:00:00 2001
From: Tomas Korbar <tkorbar@redhat.com>
Date: Mon, 19 Nov 2018 13:34:48 +0100
Subject: [PATCH] Fix bad use of NamedTemporaryFile
- os.stat call expects file path not file object
---
troubleshoot/ErrorLogCheckpoint.py | 42 +++++++++++++++---------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/troubleshoot/ErrorLogCheckpoint.py b/troubleshoot/ErrorLogCheckpoint.py
index 7394c581..7ba7396e 100644
--- a/troubleshoot/ErrorLogCheckpoint.py
+++ b/troubleshoot/ErrorLogCheckpoint.py
@@ -134,28 +134,28 @@ class ErrorLogCheckpoint(Question):
if 'error_log_checkpoint' in self.answers:
return self.answers
- with NamedTemporaryFile () as tmpf:
- try:
- self.op = TimedOperation (self.authconn.getFile,
- args=('/admin/log/error_log',
- tmpf.file),
- parent=parent)
- self.op.run ()
- except (RuntimeError, cups.IPPError) as e:
- self.answers['error_log_checkpoint_exc'] = e
- except cups.HTTPError as e:
- self.answers['error_log_checkpoint_exc'] = e
-
- # Abandon the CUPS connection and make another.
- answers = self.troubleshooter.answers
- factory = answers['_authenticated_connection_factory']
- self.authconn = factory.get_connection ()
- self.answers['_authenticated_connection'] = self.authconn
+ tmpf = NamedTemporaryFile()
+ try:
+ self.op = TimedOperation (self.authconn.getFile,
+ args=["/admin/log/error_log"],
+ kwargs={'file': tmpf},
+ parent=parent)
+ self.op.run ()
+ except (RuntimeError, cups.IPPError) as e:
+ self.answers['error_log_checkpoint_exc'] = e
+ except cups.HTTPError as e:
+ self.answers['error_log_checkpoint_exc'] = e
+
+ # Abandon the CUPS connection and make another.
+ answers = self.troubleshooter.answers
+ factory = answers['_authenticated_connection_factory']
+ self.authconn = factory.get_connection ()
+ self.answers['_authenticated_connection'] = self.authconn
- try:
- statbuf = os.stat (tmpf.file)
- except OSError:
- statbuf = [0, 0, 0, 0, 0, 0, 0]
+ try:
+ statbuf = os.stat (tmpf.name)
+ except OSError:
+ statbuf = [0, 0, 0, 0, 0, 0, 0]
self.answers['error_log_checkpoint'] = statbuf[6]
self.persistent_answers['error_log_checkpoint'] = statbuf[6]
--
2.33.0

View File

@ -0,0 +1,30 @@
From eb13a5061d176b813345867942ccaf8f5cf3d6c6 Mon Sep 17 00:00:00 2001
From: Tomas Korbar <tkorbar@redhat.com>
Date: Mon, 19 Nov 2018 13:43:39 +0100
Subject: [PATCH] Fix bad call of cups connection getFile
---
troubleshoot/ErrorLogFetch.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/troubleshoot/ErrorLogFetch.py b/troubleshoot/ErrorLogFetch.py
index d7807899..3840dbc8 100644
--- a/troubleshoot/ErrorLogFetch.py
+++ b/troubleshoot/ErrorLogFetch.py
@@ -69,11 +69,11 @@ class ErrorLogFetch(Question):
with NamedTemporaryFile (delete=False) as tmpf:
success = False
try:
- c.getFile ('/admin/log/error_log', tmpf.file)
+ c.getFile ('/admin/log/error_log', file = tmpf)
success = True
except cups.HTTPError:
try:
- os.remove (tmpf.file)
+ os.remove (tmpf.name)
except OSError:
pass
--
2.33.0

View File

@ -0,0 +1,28 @@
From 48acbc87a83a3d1f34f3b2383d42fcf02f7568bd Mon Sep 17 00:00:00 2001
From: Tomas Korbar <tkorbar@redhat.com>
Date: Mon, 14 Jan 2019 16:07:25 +0100
Subject: [PATCH] Fix writing of advanced settings
After reading from stream we must return again to line 0 if we
want to read file again
---
serversettings.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/serversettings.py b/serversettings.py
index c98b08b1..72423057 100644
--- a/serversettings.py
+++ b/serversettings.py
@@ -440,6 +440,9 @@ class ServerSettings(GtkGUI):
has_browsepoll = True
break
+ # Return to the start of file
+ f.seek(0)
+
for line in f:
line = line.decode('UTF-8')
l = line.lower ().strip ()
--
2.33.0

View File

@ -0,0 +1,30 @@
From 9fb1f6a731dab0c39ba138d29f310622d4f32d4d Mon Sep 17 00:00:00 2001
From: Tomas Korbar <tkorbar@redhat.com>
Date: Mon, 14 Jan 2019 16:09:25 +0100
Subject: [PATCH] Fix compatibility with python3 in putFile method
in python3 os.read returns byte object not a string which caused
writing loop to be endless
by adding b'' comparison we hold compatibility both with python2
and python3
---
cupspk.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cupspk.py b/cupspk.py
index 5b863b43..b7cbc0b3 100644
--- a/cupspk.py
+++ b/cupspk.py
@@ -448,7 +448,7 @@ class Connection:
if fd is not None:
os.lseek (fd, 0, os.SEEK_SET)
buf = os.read (fd, 512)
- while buf != '':
+ while buf != '' and buf != b'':
os.write (tmpfd, buf)
buf = os.read (fd, 512)
else:
--
2.33.0

View File

@ -3,7 +3,7 @@
Name: system-config-printer
Summary: a graphical tool for CUPS administration
Version: 1.5.11
Release: 18
Release: 23
License: GPLv2+
URL: https://github.com/zdohnal/system-config-printer
Source0: https://github.com/zdohnal/system-config-printer/archive/%{version}.tar.gz
@ -12,6 +12,11 @@ Patch0001: 0001-Fix-constructing-the-auth-dialog.patch
Patch0002: 0002-Require-proper-version-of-GDK-and-GTK-in-scp-dbus-se.patch
Patch0003: 0003-Set-programe-name-for-scp-dbus-service-as-well.patch
Patch0004: 0004-Fix-typo-in-debugprint-call.patch
Patch0005: 0005-Fix-TypeError-raised-by-debugprint-call.patch
Patch0006: 0006-Fix-bad-use-of-NamedTemporaryFile.patch
Patch0007: 0007-Fix-bad-call-of-cups-connection-getFile.patch
Patch0008: 0008-Fix-writing-of-advanced-settings.patch
Patch0009: 0009-Fix-compatibility-with-python3-in-putFile-method.patch
BuildRequires: libusb1-devel gcc gettext-devel systemd xmlto systemd-devel python3-devel
BuildRequires: intltool cups-devel >= 1.2 desktop-file-utils >= 0.2.92 pkgconfig(glib-2.0)
@ -87,6 +92,21 @@ rm -rf /var/cache/foomatic/foomatic.pickle
exit 0
%changelog
* Thu Dec 28 2023 liyuanyuan <liyuanyuan@xfusion.com> - 1.5.11-23
- Fix compatibility with python3 in putFile method
* Tue Dec 12 2023 liyuanyuan <liyuanyuan@xfusion.com> - 1.5.11-22
- Fix writing of advanced settings
* Fri Nov 24 2023 liyuanyuan <liyuanyuan@xfusion.com> - 1.5.11-21
- Fix bad call of cups connection getFile
* Thu Nov 09 2023 liyuanyuan <liyuanyuan@xfusion.com> - 1.5.11-20
- Fix bad use of NamedTemporaryFile
* Thu Nov 02 2023 liyuanyuan <liyuanyuan@xfusion.com> - 1.5.11-19
- Fix TypeError raised by debugprint call
* Thu Oct 26 2023 liyuanyuan <liyuanyuan@xfusion.com> - 1.5.11-18
- Fix typo in debugprint call