1
0

Accepting request 853070 from home:dimstar:Factory

- Use python3 to perform installation:
  + Replace python BuildRequires with python3-base.
  + Change syntax of faenza-install to be python3 compatible.

OBS-URL: https://build.opensuse.org/request/show/853070
OBS-URL: https://build.opensuse.org/package/show/GNOME:Apps/faenza-icon-theme?expand=0&rev=11
This commit is contained in:
Dominique Leuenberger 2020-12-05 13:51:08 +00:00 committed by Git OBS Bridge
parent c6e0063de4
commit d69088876b
3 changed files with 34 additions and 27 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Dec 4 09:25:53 UTC 2020 - Dominique Leuenberger <dimstar@opensuse.org>
- Use python3 to perform installation:
+ Replace python BuildRequires with python3-base.
+ Change syntax of faenza-install to be python3 compatible.
------------------------------------------------------------------- -------------------------------------------------------------------
Fri May 10 09:45:06 UTC 2013 - rmilasan@suse.com Fri May 10 09:45:06 UTC 2013 - rmilasan@suse.com

View File

@ -2,7 +2,7 @@
# #
# spec file for package faenza-icon-theme # spec file for package faenza-icon-theme
# #
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2020 SUSE LLC
# Copyright (c) 2011 PAscal Bleser # Copyright (c) 2011 PAscal Bleser
# Copyright (c) 2010 Nelson Marques # Copyright (c) 2010 Nelson Marques
# #
@ -15,7 +15,7 @@
# license that conforms to the Open Source Definition (Version 1.9) # license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative. # published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via https://bugs.opensuse.org/
# #
@ -23,16 +23,16 @@ Name: faenza-icon-theme
Version: 1.3 Version: 1.3
Release: 0 Release: 0
Summary: Faenza Icon Theme Summary: Faenza Icon Theme
License: GPL-3.0+ License: GPL-3.0-or-later
Group: System/GUI/GNOME Group: System/GUI/GNOME
Url: http://tiheum.deviantart.com/art/Faenza-Icons-173323228 URL: http://tiheum.deviantart.com/art/Faenza-Icons-173323228
## http://www.deviantart.com/download/173323228/faenza_icons_by_tiheum-d2v6x24.zip ## http://www.deviantart.com/download/173323228/faenza_icons_by_tiheum-d2v6x24.zip
Source0: https://faenza-icon-theme.googlecode.com/files/%{name}_%{version}.zip Source0: https://faenza-icon-theme.googlecode.com/files/%{name}_%{version}.zip
Source1: http://gnome-look.org/CONTENT/content-files/132681-Faenza-Mint.tar.gz Source1: http://gnome-look.org/CONTENT/content-files/132681-Faenza-Mint.tar.gz
# script to rebrand and install stuff... # script to rebrand and install stuff...
Source2: faenza-install Source2: faenza-install
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python BuildRequires: python3-base
%if 0%{?suse_version} %if 0%{?suse_version}
# For all the icon themes macros # For all the icon themes macros
BuildRequires: hicolor-icon-theme BuildRequires: hicolor-icon-theme
@ -122,7 +122,7 @@ done
%build %build
%install %install
python %{S:2} --install %{buildroot}%{_datadir}/icons/ python3 %{S:2} --install %{buildroot}%{_datadir}/icons/
%fdupes %{buildroot}%{_datadir}/icons %fdupes %{buildroot}%{_datadir}/icons
find %{buildroot}%{_datadir}/icons -type f -exec chmod 0644 {} \; find %{buildroot}%{_datadir}/icons -type f -exec chmod 0644 {} \;

View File

@ -28,10 +28,10 @@ class Faenza():
print header print header
''' '''
def header(self): def header(self):
print '\n faenza-install -- version %s \n' % VERSION print('\n faenza-install -- version %s \n' % VERSION)
print ' This script performs minimum rebranding and installs the' print(' This script performs minimum rebranding and installs the')
print ' faenza-icon-theme in INSTALL_DIR (sys.argv[1]). For help' print(' faenza-icon-theme in INSTALL_DIR (sys.argv[1]). For help')
print ' run the following this script with "-h" or "--help". \n' print(' run the following this script with "-h" or "--help". \n')
''' '''
@ -54,9 +54,9 @@ class Faenza():
if os.path.exists(target): if os.path.exists(target):
os.unlink(target) os.unlink(target)
else: else:
print ' - file not found: %s' % target print(' - file not found: %s' % target)
except Exception, errno: except Exception as errno:
print errno print(errno)
sys.exit(1) sys.exit(1)
return 0 return 0
@ -69,22 +69,22 @@ class Faenza():
self.scan('start-here') self.scan('start-here')
self.scan('distributor-logo') self.scan('distributor-logo')
if not icons: if not icons:
print '\n - NO icons found.. Exiting!\n' print('\n - NO icons found.. Exiting!\n')
sys.exit(1) sys.exit(1)
else: else:
for icon in icons: for icon in icons:
dirname, myfile = os.path.split(icon) dirname, myfile = os.path.split(icon)
filename, myext = os.path.splitext(myfile) filename, myext = os.path.splitext(myfile)
print ' - %s' % icon print(' - %s' % icon)
try: try:
self.delete(icon) self.delete(icon)
print ' + delete file: %s' % icon print(' + delete file: %s' % icon)
except Exception, errno: except Exception as errno:
print errno print(errno)
sys.exit(1) sys.exit(1)
os.chdir(dirname) os.chdir(dirname)
os.system('ln -s %s %s' % ( filename + '-' + dist + myext, myfile)) os.system('ln -s %s %s' % ( filename + '-' + dist + myext, myfile))
print ' + file rebranded to: %s' % ( filename + '-' + distribution + myext ) print(' + file rebranded to: %s' % ( filename + '-' + distribution + myext ))
os.chdir(base) os.chdir(base)
return 0 return 0
@ -94,15 +94,15 @@ class Faenza():
install Faenza themes on sys.argv[1] install Faenza themes on sys.argv[1]
''' '''
def install(self, target): def install(self, target):
print ' - Installation \n' print(' - Installation \n')
for variant in variants: for variant in variants:
fs_dir = os.path.join(target, variant) fs_dir = os.path.join(target, variant)
if not os.path.isdir(fs_dir): if not os.path.isdir(fs_dir):
try: try:
shutil.copytree(variant, fs_dir) shutil.copytree(variant, fs_dir)
print ' + file installed: %s' % fs_dir print(' + file installed: %s' % fs_dir)
except Exception, err: except Exception as err:
print err print(err)
return 1 return 1
return 0 return 0
@ -143,10 +143,10 @@ def main():
if option.version: if option.version:
print '\n faenza-install -- version %s \n' % VERSION print('\n faenza-install -- version %s \n' % VERSION)
print ' This script performs minimum rebranding and installs the' print(' This script performs minimum rebranding and installs the')
print ' faenza-icon-theme in INSTALL_DIR (sys.argv[1]). For help' print(' faenza-icon-theme in INSTALL_DIR (sys.argv[1]). For help')
print ' run the following this script with "-h" or "--help". \n' print(' run the following this script with "-h" or "--help". \n')
sys.exit(0) sys.exit(0)
global dist global dist