!58 backport Fix writing of advanced settings

From: @liyy9 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
This commit is contained in:
openeuler-ci-bot 2023-12-25 06:53:28 +00:00 committed by Gitee
commit b59e031c2e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 33 additions and 1 deletions

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

@ -3,7 +3,7 @@
Name: system-config-printer
Summary: a graphical tool for CUPS administration
Version: 1.5.11
Release: 21
Release: 22
License: GPLv2+
URL: https://github.com/zdohnal/system-config-printer
Source0: https://github.com/zdohnal/system-config-printer/archive/%{version}.tar.gz
@ -15,6 +15,7 @@ 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
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)
@ -90,6 +91,9 @@ rm -rf /var/cache/foomatic/foomatic.pickle
exit 0
%changelog
* 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