We should write a script to compare the contents of: install/share/config/images.zip and icon-themes/galaxy to identify all of the artwork that is no longer used. It would be great to have a list of those icons. Then we'll need to go through those checking that they are not used on some other platform. Some icons despite having a .png suffix are referred to as .bmp in the .src or .hrc files, so grep for: git grep '"foo' # for foo.png to find the hits. If we can cleanup our icon-theme we can make the artists happier and make their life easier finding / completely theming the suite :-) Thanks !
Created attachment 60569 [details] Python Script to compare the contents of zip files, regular files or directories. This is a Python Script to compare the contents of zip files, regular files or directories in Linux and Windows. In order to run this script you only need: python filecomp.py Source Target This script returns files in Source but not in Target, where Source and Target could be a directory, file or zip file. If you don't need CASE SENSITIVE, you need to change CASE_SENSITIVE to False in the script. This script runs with Python 2.6/2.7 in Linux and Windows, and it's under GNU GPL v3.
Created attachment 60581 [details] list of icons to remove ... Lovely - thanks for that ! :-) I attach the output vs. master. We should do some git greps for these icons eg. for: File: checkunx.png (/opt/libreoffice/master/icon-themes/galaxy/vcl/res) git grep '"checkunx' just to double check they are in fact not used; and then git remove them & try a from clean build.
Deleted "Easyhack" from summary.
Thanks to Jack Leigh :-)
Jack Leigh committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=fef9d3090f7abd4371e7b7da61a5f959c208f0c1 fdo#48873 clean unused icons The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Comment on attachment 60569 [details] Python Script to compare the contents of zip files, regular files or directories. >#! /usr/bin/env python ># -*- coding: utf-8 -*- > >## filecomp.py, comparing files >## Copyright (C) 2012 Angel Luis Garcia Garcia >## >## This program is free software: you can redistribute it and/or modify >## it under the terms of the GNU General Public License as published by >## the Free Software Foundation, either version 3 of the License, or >## (at your option) any later version. >## >## This program is distributed in the hope that it will be useful, >## but WITHOUT ANY WARRANTY; without even the implied warranty of >## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >## GNU General Public License for more details. >## >## You should have received a copy of the GNU General Public License >## along with this program. If not, see <http://www.gnu.org/licenses/>. > ># Constants. > >CASE_SENSITIVE = True >VERSION = '0.0.1' >SCRIPTNAME = 'filecomp.py' > ># Modules. > >import os >import zipfile >import sys > ># Classes. > >class Container(object): > ''' > Class container. > A container should be a directory, zip file or a regular file. > ''' > def __init__(self, path): > '''Constructor code''' > # Attributes. > self.__path = path > self.__type = None > # Detect the container. > self.__detectContainer() > > def __detectContainer(self): > '''Detect container''' > # Directory? > if os.path.isdir(self.__path): > self.__type = 'd' > # File? > if os.path.isfile(self.__path): > # Is zip file? > if zipfile.is_zipfile(self.__path): > self.__type = 'z' > else: self.__type = 'f' > > def containerExists(self): > return False if self.__type is None else True > > def getFiles(self): > '''Return list of files''' > if self.__type in ['f']: > a = os.path.split(self.__path) > return [(a[1], a[0])] > if self.__type in ['d']: > # Walking directory. > a = os.walk(self.__path) # Returns a generator. > aux = list() > while True: > try: > b = a.next() > dirpath = b[0] > filenames = b[2:] > for i in filenames: > for j in i: aux.append((j, dirpath)) > except: > break > return aux > if self.__type in ['z']: > a = zipfile.ZipFile(self.__path,"r") > aux = list() > for i in a.namelist(): > a = os.path.split(i) > if len(a[1]) == 0: continue # It's a directory. > aux.append((a[1], a[0])) > return aux > > def compareFiles(self, A, B, case_sensitive = True): > '''Returns files in A but not in B with options''' > for i in A: > nfileA = i[0] > pathA = i[1] > drWatson = True > for j in B: > nfileB = j[0] > if not case_sensitive: aux = nfileA.lower().strip() == nfileB.lower().strip() > else: aux = nfileA.strip() == nfileB.strip() > if aux: > drWatson = False > break > if drWatson: print "File: %s (%s)" % (nfileA, pathA) > ># Functions. > >def f_help(): > text = ''' > %s %s > > Execute: filecomp.py Source Target > > This program returns files in Source but not in Target, > where Source and Target could be a directory, file or > zip file. > > This script runs with Python 2.6/2.7 in Linux and Windows. > Written by Angel Luis Garcia Garcia (angelluis78@gmail.com). > License: GNU GPL v3. > ''' % (SCRIPTNAME, VERSION) > print text > ># Script. > >if len(sys.argv[1:]) == 2: > fileA = sys.argv[1] > fileB = sys.argv[2] >else: > f_help() > sys.exit(0) > >source = Container(fileA) >target = Container(fileB) > >if not source.containerExists(): > print "Source %s not exists" % (fileA) > sys.exit(0) > >if not target.containerExists(): > print "Target %s not exists" % (fileB) > sys.exit(0) > >print "Searching files that are in %s but not in %s ..." % (fileA, fileB) >source.compareFiles(source.getFiles(), target.getFiles(), CASE_SENSITIVE)
Migrating Whiteboard tags to Keywords: (EasyHack,DifficultyBeginner,SkillScript,TopicCleanup ) [NinjaEdit]