Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/system-config-printer/files/, app-admin/system-config-printer/
Date: Sun, 25 Oct 2020 00:28:04
Message-Id: 1603585660.b94cda060272b6fe1db3c1d8b3a9a10e9c6b5d89.asturm@gentoo
1 commit: b94cda060272b6fe1db3c1d8b3a9a10e9c6b5d89
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 24 16:50:26 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 25 00:27:40 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b94cda06
7
8 app-admin/system-config-printer: EAPI-7 bump, gnome2--
9
10 Package-Manager: Portage-3.0.8, Repoman-3.0.2
11 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
12
13 ...stem-config-printer-1.5.12-check-for-null.patch | 102 +++++++++------------
14 .../system-config-printer-1.5.12-r2.ebuild | 22 ++---
15 2 files changed, 55 insertions(+), 69 deletions(-)
16
17 diff --git a/app-admin/system-config-printer/files/system-config-printer-1.5.12-check-for-null.patch b/app-admin/system-config-printer/files/system-config-printer-1.5.12-check-for-null.patch
18 index 1c03bbd193f..b0df809c939 100644
19 --- a/app-admin/system-config-printer/files/system-config-printer-1.5.12-check-for-null.patch
20 +++ b/app-admin/system-config-printer/files/system-config-printer-1.5.12-check-for-null.patch
21 @@ -1,58 +1,46 @@
22 -From cf9903466c1a2d18a701f3b5e8c7e03483e1244d Mon Sep 17 00:00:00 2001
23 -From: Zdenek Dohnal <zdohnal@××××××.com>
24 -Date: Mon, 14 Oct 2019 16:39:28 +0200
25 -Subject: [PATCH] udev-configure-printer: Add checks for NULL
26 -
27 ----
28 - NEWS | 1 +
29 - udev/udev-configure-printer.c | 12 +++++++++---
30 - 2 files changed, 10 insertions(+), 3 deletions(-)
31 -
32 -diff --git a/NEWS b/NEWS
33 -index f4b774e5c..0b53aa8ef 100644
34 ---- a/NEWS
35 -+++ b/NEWS
36 -@@ -1,5 +1,6 @@
37 - 1.5.13 changes
38 - --------------
39 -+- add checks for NULL in udev-configure-printer (Fedora #1761097)
40 +From cf9903466c1a2d18a701f3b5e8c7e03483e1244d Mon Sep 17 00:00:00 2001
41 +From: Zdenek Dohnal <zdohnal@××××××.com>
42 +Date: Mon, 14 Oct 2019 16:39:28 +0200
43 +Subject: [PATCH] udev-configure-printer: Add checks for NULL
44 +
45 +---
46 + udev/udev-configure-printer.c | 12 +++++++++---
47 + 1 file changed, 9 insertions(+), 3 deletions(-)
48 +
49 +diff --git a/udev/udev-configure-printer.c b/udev/udev-configure-printer.c
50 +index 83092fc21..d753bbeaf 100644
51 +--- a/udev/udev-configure-printer.c
52 ++++ b/udev/udev-configure-printer.c
53 +@@ -1411,7 +1411,7 @@ for_each_matching_queue (struct device_uris *device_uris,
54 + const char *printer_state_message = NULL;
55 + int state = 0;
56 + size_t i, l;
57 +- char *this_device_uri_n, *device_uri_n;
58 ++ char *this_device_uri_n = NULL, *device_uri_n = NULL;
59 + const char *ps1, *ps2, *pi1, *pi2;
60
61 - 1.5.12 changes
62 - --------------
63 -diff --git a/udev/udev-configure-printer.c b/udev/udev-configure-printer.c
64 -index 83092fc21..d753bbeaf 100644
65 ---- a/udev/udev-configure-printer.c
66 -+++ b/udev/udev-configure-printer.c
67 -@@ -1411,7 +1411,7 @@ for_each_matching_queue (struct device_uris *device_uris,
68 - const char *printer_state_message = NULL;
69 - int state = 0;
70 - size_t i, l;
71 -- char *this_device_uri_n, *device_uri_n;
72 -+ char *this_device_uri_n = NULL, *device_uri_n = NULL;
73 - const char *ps1, *ps2, *pi1, *pi2;
74 -
75 - while (attr && ippGetGroupTag (attr) != IPP_TAG_PRINTER)
76 -@@ -1448,6 +1448,8 @@ for_each_matching_queue (struct device_uris *device_uris,
77 - for (i = 0; i < device_uris->n_uris; i++)
78 - {
79 - device_uri_n = normalize_device_uri(device_uris->uri[i]);
80 -+ if (this_device_uri_n == NULL || device_uri_n == NULL)
81 -+ goto skip;
82 - /* As for the same device different URIs can come out when the
83 - device is accessed via the usblp kernel module or via low-
84 - level USB (libusb) we cannot simply compare URIs, must
85 -@@ -1512,8 +1514,12 @@ for_each_matching_queue (struct device_uris *device_uris,
86 - firstqueue = 0;
87 -
88 - skip:
89 -- free(device_uri_n);
90 -- free(this_device_uri_n);
91 -+ if (device_uri_n != NULL)
92 -+ free(device_uri_n);
93 -+ device_uri_n = NULL;
94 -+ if (this_device_uri_n != NULL)
95 -+ free(this_device_uri_n);
96 -+ this_device_uri_n = NULL;
97 - if (!attr)
98 - break;
99 - }
100 + while (attr && ippGetGroupTag (attr) != IPP_TAG_PRINTER)
101 +@@ -1448,6 +1448,8 @@ for_each_matching_queue (struct device_uris *device_uris,
102 + for (i = 0; i < device_uris->n_uris; i++)
103 + {
104 + device_uri_n = normalize_device_uri(device_uris->uri[i]);
105 ++ if (this_device_uri_n == NULL || device_uri_n == NULL)
106 ++ goto skip;
107 + /* As for the same device different URIs can come out when the
108 + device is accessed via the usblp kernel module or via low-
109 + level USB (libusb) we cannot simply compare URIs, must
110 +@@ -1512,8 +1514,12 @@ for_each_matching_queue (struct device_uris *device_uris,
111 + firstqueue = 0;
112 +
113 + skip:
114 +- free(device_uri_n);
115 +- free(this_device_uri_n);
116 ++ if (device_uri_n != NULL)
117 ++ free(device_uri_n);
118 ++ device_uri_n = NULL;
119 ++ if (this_device_uri_n != NULL)
120 ++ free(this_device_uri_n);
121 ++ this_device_uri_n = NULL;
122 + if (!attr)
123 + break;
124 + }
125
126 diff --git a/app-admin/system-config-printer/system-config-printer-1.5.12-r2.ebuild b/app-admin/system-config-printer/system-config-printer-1.5.12-r2.ebuild
127 index c97eaf9b4f2..c0544a091b8 100644
128 --- a/app-admin/system-config-printer/system-config-printer-1.5.12-r2.ebuild
129 +++ b/app-admin/system-config-printer/system-config-printer-1.5.12-r2.ebuild
130 @@ -1,19 +1,19 @@
131 # Copyright 1999-2020 Gentoo Authors
132 # Distributed under the terms of the GNU General Public License v2
133
134 -EAPI=6
135 +EAPI=7
136
137 PYTHON_COMPAT=( python3_{7,8,9} )
138 PYTHON_REQ_USE="xml"
139 -inherit gnome2 python-single-r1 systemd
140 +inherit python-single-r1 systemd xdg
141
142 DESCRIPTION="Graphical user interface for CUPS administration"
143 HOMEPAGE="https://github.com/OpenPrinting/system-config-printer"
144 SRC_URI="https://github.com/OpenPrinting/${PN}/releases/download/${PV}/${P}.tar.xz"
145
146 LICENSE="GPL-2+"
147 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
148 SLOT="0"
149 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
150 IUSE="gnome-keyring policykit"
151 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
152
153 @@ -68,19 +68,17 @@ pkg_setup() {
154 }
155
156 src_configure() {
157 - gnome2_src_configure \
158 - --enable-nls \
159 - --with-desktop-vendor=Gentoo \
160 - --with-udev-rules \
161 + local myeconfargs=(
162 + --enable-nls
163 + --with-desktop-vendor=Gentoo
164 + --with-udev-rules
165 --with-systemdsystemunitdir=$(systemd_get_systemunitdir)
166 -}
167 -
168 -src_compile() {
169 - gnome2_src_compile
170 + )
171 + econf "${myeconfargs[@]}"
172 }
173
174 src_install() {
175 - gnome2_src_install
176 + default
177 python_fix_shebang "${ED}"
178 python_optimize
179 }