Minor syntax cleanups

This commit is contained in:
Andrey Bondrov 2017-01-27 00:27:54 +10:00
parent e4f7edf53d
commit 2fa58786e8
2 changed files with 32 additions and 15 deletions

View file

@ -77,6 +77,7 @@ Patch301: hplip-3.16.8-cups-2.2.patch
Patch302: hplip-CVE-2013-4325.patch
Patch303: hplip-3.13.10-fix-systray-x.patch
Patch304: hplip-3.15.6-hpipp_linkage.patch
Patch305: hpps-3.16.11-fix-syntax.patch
BuildRequires: desktop-file-utils
BuildRequires: imagemagick
@ -205,7 +206,7 @@ Group: System/Printing
Requires(post): sane-backends
Provides: sane-backends-hpaio = %{version}-%{release}
# (cjw) for system-config-printer
Provides: libsane-hpaio
Provides: libsane-hpaio = %{version}-%{release}
%description -n %{libsane}
SANE driver for scanners in HP's multi-function devices (from HPLIP)
@ -311,7 +312,7 @@ flash memory cards.
# Color LaserJet CM4730 MFP (bug #658831)
# Color LaserJet CM3530 MFP (bug #659381)
# LaserJet 4050 Series/4100 Series/2100 Series/4350/5100 Series/8000 Series
# P3005/P3010 Series/P4014/P4515 (bug #659039)
# P3005/P3010 Series/P4014/P4515 (bug #659039)
# LaserJet Professional P1606dn (bug #708472)
# LaserJet Professional M1212nf MFP (bug #742490)
# LaserJet M1536dnf MFP (bug #743915)
@ -449,6 +450,8 @@ sed -i.duplex-constraints \
%patch304 -p1
%patch305 -p1
sed -i.duplex-constraints \
-e 's,\(UIConstraints.* \*Duplex\),//\1,' \
prnt/drv/hpcups.drv.in
@ -458,7 +461,6 @@ find -name '*.py' -print0 | xargs -0 \
sed -i.env-python -e 's,^#!/usr/bin/env python,#!/usr/bin/python3,'
sed -i.env-python -e 's,^#!/usr/bin/env python,#!/usr/bin/python3,' \
prnt/filters/hpps \
fax/filters/pstotiff
@ -630,14 +632,6 @@ mv -f %{buildroot}/usr/lib/systemd/system/hplip-printer@.service %{buildroot}%{_
# Images in docdir should not be executable (bug #440552).
find doc/images -type f -exec chmod 644 {} \;
#sed -e 's/0664/0666/' -i %{buildroot}/lib/udev/rules.d/56-hpmud.rules
#sed -e 's/ATTR/#ATTR/' -i %{buildroot}/lib/udev/rules.d/56-hpmud.rules
#sed -e 's/ATTR/SYSFS/' -i %{buildroot}/lib/udev/rules.d/56-hpmud.rules
# The systray applet doesn't work properly (displays icon as a
# window), so don't ship the launcher yet.
# rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
#We do not need hal
rm -f %{buildroot}%{_datadir}/hal/fdi/preprobe/10osvendor/20-hplip-devices.fdi
@ -766,7 +760,7 @@ fi
%{_libdir}/python3*/*/*.so*
# CUPS backends (0755 permissions, so that CUPS 1.2 runs these backends
# as lp user)
# Note: this must be /usr/lib not %{_libdir}, since that's the
# Note: this must be /usr/lib not _{_libdir}, since that's the
# CUPS serverbin directory.
%attr(0755,root,root) %{_prefix}/lib/cups/backend/hp*
%{_prefix}/lib/cups/filter/hpcups
@ -810,9 +804,7 @@ fi
%{_datadir}/hplip/setup.py*
%{_datadir}/hplip/testpage.py*
%{_datadir}/hplip/timedate.py*
#%{_datadir}/hplip/uninstall.py*
%{_datadir}/hplip/unload.py*
#%{_datadir}/hplip/upgrade.py*
%{_datadir}/hplip/wificonfig.py*
# Directories
%{_datadir}/hplip/base
@ -831,7 +823,6 @@ fi
#{_datadir}/dbus-1/system-services/com.hp.hplip.service
%{_localstatedir}/lib/hp/hplip.state
%{_docdir}/%{name}/README.urpmi
#config(noreplace) %{_sysconfdir}/dbus-1/system.d/com.hp.hplip.conf
%dir %attr(0775,root,lp) /run/hplip
%{_tmpfilesdir}/hplip.conf
%{_unitdir}/hplip-printer@.service

View file

@ -0,0 +1,26 @@
diff -Nuar hplip-3.16.11.orig/prnt/filters/hpps hplip-3.16.11/prnt/filters/hpps
--- hplip-3.16.11.orig/prnt/filters/hpps 2016-11-23 09:02:55.000000000 +0300
+++ hplip-3.16.11/prnt/filters/hpps 2017-01-25 11:34:18.354540838 +0300
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# (c) Copyright 2003-2015 HP Development Company, L.P.
@@ -190,12 +190,12 @@
except KeyError as e:
msg("Setting Pin to default")
else:
- szKeyInitials = ['HPFIDigit', 'HPSEDigit', 'HPTHDigit', 'HPFTDigit']
- for x in szKeyInitials:
+ szKeyInitials = ['HPFIDigit', 'HPSEDigit', 'HPTHDigit', 'HPFTDigit']
+ for x in szKeyInitials:
try:
- secpin += opts[x]
+ secpin += opts[x]
except KeyError:
- secpin += '0'
+ secpin += '0'
os.write(output_fd, to_bytes_utf8('@PJL SET HOLDKEY="%s"\x0a' % secpin))