Bug Hunting Session
Bug 48873 - clean out obsolete icons ...
Summary: clean out obsolete icons ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:3.7.0
Keywords: difficultyBeginner, easyHack, skillScript, topicCleanup
Depends on:
Blocks:
 
Reported: 2012-04-18 06:35 UTC by Michael Meeks
Modified: 2015-12-16 00:20 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Python Script to compare the contents of zip files, regular files or directories. (4.11 KB, text/x-python)
2012-04-25 06:51 UTC, Ángel Luis García García
Details
list of icons to remove ... (24.38 KB, text/plain)
2012-04-25 08:51 UTC, Michael Meeks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2012-04-18 06:35:36 UTC
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 !
Comment 1 Ángel Luis García García 2012-04-25 06:51:03 UTC
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.
Comment 2 Michael Meeks 2012-04-25 08:51:58 UTC
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.
Comment 3 Florian Reisinger 2012-05-18 09:30:12 UTC
Deleted "Easyhack" from summary.
Comment 4 Michael Meeks 2012-10-10 11:14:01 UTC
Thanks to Jack Leigh :-)
Comment 5 Not Assigned 2012-10-10 11:16:38 UTC
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 6 Joel Madero 2013-12-17 23:30:09 UTC
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)
Comment 7 Robinson Tryon (qubit) 2015-12-16 00:20:29 UTC
Migrating Whiteboard tags to Keywords: (EasyHack,DifficultyBeginner,SkillScript,TopicCleanup )
[NinjaEdit]