diff options
author | Chris Mayo <aklhfex@gmail.com> | 2020-11-03 18:51:40 +0000 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2020-11-10 12:46:36 +0100 |
commit | 5c5650ab0671c8e4800c8ac3adfe2380059d4a61 (patch) | |
tree | 8045cdfa0421ecaac0619ae132fc0fc3a49fff5d /sysui | |
parent | b53fa6344d033f8b8f03b9274dbdd811251c2c1a (diff) |
tdf#132787: Don't duplicate hicolor icon theme as gnome
GNOME will use the hicolor theme.
Change-Id: I612c6b076544227bf9adf546ad385c6a5ac20ca1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105200
Tested-by: Jenkins
Reviewed-by: Chris Mayo <aklhfex@gmail.com>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'sysui')
-rwxr-xr-x | sysui/desktop/debian/postinst | 18 | ||||
-rwxr-xr-x | sysui/desktop/debian/postrm | 18 | ||||
-rw-r--r-- | sysui/desktop/freedesktop/freedesktop-menus.spec | 114 | ||||
-rwxr-xr-x | sysui/desktop/share/create_tree.sh | 10 |
4 files changed, 65 insertions, 95 deletions
diff --git a/sysui/desktop/debian/postinst b/sysui/desktop/debian/postinst index 604e67605297..dcb91680cb4e 100755 --- a/sysui/desktop/debian/postinst +++ b/sysui/desktop/debian/postinst @@ -31,17 +31,15 @@ if [ "$1" = "configure" ] ; then # first install update-menus fi # update icon-cache if already present - for theme in gnome hicolor; do - if [ -e /usr/share/icons/$theme/icon-theme.cache ] ; then - # touch it, just in case we cannot find the binary... - touch /usr/share/icons/$theme - if (which gtk-update-icon-cache); then - gtk-update-icon-cache /usr/share/icons/$theme - fi - # ignore errors (e.g. when there is a cache, but no index.theme) - true + if [ -e /usr/share/icons/hicolor/icon-theme.cache ] ; then + # touch it, just in case we cannot find the binary... + touch /usr/share/icons/hicolor + if (which gtk-update-icon-cache); then + gtk-update-icon-cache /usr/share/icons/hicolor fi - done + # ignore errors (e.g. when there is a cache, but no index.theme) + true + fi fi # update /etc/mime.types diff --git a/sysui/desktop/debian/postrm b/sysui/desktop/debian/postrm index 1cb32d37b3c3..0e6099ea5b43 100755 --- a/sysui/desktop/debian/postrm +++ b/sysui/desktop/debian/postrm @@ -11,16 +11,14 @@ if [ "$1" != "purge" ]; then if [ -x /usr/bin/update-menus ]; then update-menus fi - for theme in gnome hicolor; do - if [ -e /usr/share/icons/$theme/icon-theme.cache ] ; then - # touch it, just in case we cannot find the binary... - touch /usr/share/icons/$theme - if (which gtk-update-icon-cache); then - gtk-update-icon-cache /usr/share/icons/$theme - fi - # ignore errors (e.g. when there is a cache, but no index.theme) - true + if [ -e /usr/share/icons/hicolor/icon-theme.cache ] ; then + # touch it, just in case we cannot find the binary... + touch /usr/share/icons/hicolor + if (which gtk-update-icon-cache); then + gtk-update-icon-cache /usr/share/icons/hicolor fi - done + # ignore errors (e.g. when there is a cache, but no index.theme) + true + fi fi exit 0 diff --git a/sysui/desktop/freedesktop/freedesktop-menus.spec b/sysui/desktop/freedesktop/freedesktop-menus.spec index 8f2f0ce91901..9375f00b902a 100644 --- a/sysui/desktop/freedesktop/freedesktop-menus.spec +++ b/sysui/desktop/freedesktop/freedesktop-menus.spec @@ -35,7 +35,6 @@ AutoReqProv: no %define _binary_payload w9.gzdio %define gnome_dir /usr -%define gnome_mime_theme hicolor # only symlinks in the package that at the time of building point to non-existing files %global dont_check_desktop_files 1 @@ -128,62 +127,53 @@ fi # not strictly freedesktop-stuff but there is no common naming scheme yet. # One proposal is "mime-application:vnd.oasis.opendocument.spreadsheet.png" # for e.g. application/vnd.oasis.opendocument.spreadsheet -link_target_root="%{gnome_dir}/share/icons/%{gnome_mime_theme}" +link_root="%{gnome_dir}/share/icons/hicolor" -if [ ! -d "${link_target_root}" ] -then - link_target_root="%{gnome_dir}/share/icons/gnome" -fi - -for subdir in `cd ${link_target_root}; ls -d *` +for subdir in `cd ${link_root}; ls --ignore="*theme*"` do - link_dir="%{gnome_dir}/share/icons/%{gnome_mime_theme}/$subdir/mimetypes" - link_target_dir="../../../gnome/$subdir/mimetypes/" + link_dir="${link_root}/$subdir/mimetypes" test -d "${link_dir}" || mkdir -p "${link_dir}" - test -d ${link_dir}/${link_target_dir} || continue - - icon=${link_target_dir}%iconprefix-drawing.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.png - icon=${link_target_dir}%iconprefix-drawing-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.template.png - icon=${link_target_dir}%iconprefix-formula.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.math.png - icon=${link_target_dir}%iconprefix-master-document.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.global.png - icon=${link_target_dir}%iconprefix-oasis-database.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.base.png - icon=${link_target_dir}%iconprefix-oasis-database.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.database.png - icon=${link_target_dir}%iconprefix-oasis-drawing.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics.png - icon=${link_target_dir}%iconprefix-oasis-drawing-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png - icon=${link_target_dir}%iconprefix-oasis-formula.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png - icon=${link_target_dir}%iconprefix-oasis-master-document.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png - icon=${link_target_dir}%iconprefix-oasis-master-document-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master-template.png - icon=${link_target_dir}%iconprefix-oasis-presentation.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png - icon=${link_target_dir}%iconprefix-oasis-presentation-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png - icon=${link_target_dir}%iconprefix-oasis-spreadsheet.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png - icon=${link_target_dir}%iconprefix-oasis-spreadsheet-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template.png - icon=${link_target_dir}%iconprefix-oasis-text.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text.png - icon=${link_target_dir}%iconprefix-oasis-text-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-template.png - icon=${link_target_dir}%iconprefix-oasis-web-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-web.png - icon=${link_target_dir}%iconprefix-presentation.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.png - icon=${link_target_dir}%iconprefix-presentation-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.template.png - icon=${link_target_dir}%iconprefix-spreadsheet.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.png - icon=${link_target_dir}%iconprefix-spreadsheet-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.template.png - icon=${link_target_dir}%iconprefix-text.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.png - icon=${link_target_dir}%iconprefix-text-template.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.template.png - icon=${link_target_dir}%iconprefix-extension.png; test -f ${link_dir}/$icon && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.openofficeorg.extension.png + + icon=${link_dir}/%iconprefix-drawing.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.png + icon=${link_dir}/%iconprefix-drawing-template.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.draw.template.png + icon=${link_dir}/%iconprefix-formula.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.math.png + icon=${link_dir}/%iconprefix-master-document.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.global.png + icon=${link_dir}/%iconprefix-oasis-database.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.base.png + icon=${link_dir}/%iconprefix-oasis-database.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.database.png + icon=${link_dir}/%iconprefix-oasis-drawing.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics.png + icon=${link_dir}/%iconprefix-oasis-drawing-template.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.graphics-template.png + icon=${link_dir}/%iconprefix-oasis-formula.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.formula.png + icon=${link_dir}/%iconprefix-oasis-master-document.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master.png + icon=${link_dir}/%iconprefix-oasis-master-document-template.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-master-template.png + icon=${link_dir}/%iconprefix-oasis-presentation.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation.png + icon=${link_dir}/%iconprefix-oasis-presentation-template.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.presentation-template.png + icon=${link_dir}/%iconprefix-oasis-spreadsheet.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet.png + icon=${link_dir}/%iconprefix-oasis-spreadsheet-template.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.spreadsheet-template.png + icon=${link_dir}/%iconprefix-oasis-text.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text.png + icon=${link_dir}/%iconprefix-oasis-text-template.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-template.png + icon=${link_dir}/%iconprefix-oasis-web-template.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.oasis.opendocument.text-web.png + icon=${link_dir}/%iconprefix-presentation.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.png + icon=${link_dir}/%iconprefix-presentation-template.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.impress.template.png + icon=${link_dir}/%iconprefix-spreadsheet.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.png + icon=${link_dir}/%iconprefix-spreadsheet-template.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.calc.template.png + icon=${link_dir}/%iconprefix-text.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.png + icon=${link_dir}/%iconprefix-text-template.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.sun.xml.writer.template.png + icon=${link_dir}/%iconprefix-extension.png; test -f ${icon} && ln -sf ${icon} ${link_dir}/gnome-mime-application-vnd.openofficeorg.extension.png done #run always -for theme in gnome hicolor; do - if [ -e /usr/share/icons/$theme/icon-theme.cache ] ; then - # touch it, just in case we cannot find the binary... - touch /usr/share/icons/$theme - if [ -x /opt/gnome/bin/gtk-update-icon-cache ]; then - /opt/gnome/bin/gtk-update-icon-cache -q /usr/share/icons/$theme - elif (which gtk-update-icon-cache); then - gtk-update-icon-cache -q /usr/share/icons/$theme - fi - # ignore errors (e.g. when there is a cache, but no index.theme) - true +if [ -e /usr/share/icons/hicolor/icon-theme.cache ] ; then + # touch it, just in case we cannot find the binary... + touch /usr/share/icons/hicolor + if [ -x /opt/gnome/bin/gtk-update-icon-cache ]; then + /opt/gnome/bin/gtk-update-icon-cache -q /usr/share/icons/hicolor + elif (which gtk-update-icon-cache); then + gtk-update-icon-cache -q /usr/share/icons/hicolor fi -done + # ignore errors (e.g. when there is a cache, but no index.theme) + true +fi # update /etc/mime.types @@ -371,19 +361,17 @@ if [ "$1" = 0 ] ; then # only run when erasing the package - other cases handled fi #run always -for theme in gnome hicolor; do - if [ -e /usr/share/icons/$theme/icon-theme.cache ] ; then - # touch it, just in case we cannot find the binary... - touch /usr/share/icons/$theme - if [ -x /opt/gnome/bin/gtk-update-icon-cache ]; then - /opt/gnome/bin/gtk-update-icon-cache -q /usr/share/icons/$theme - elif (which gtk-update-icon-cache); then - gtk-update-icon-cache -q /usr/share/icons/$theme - fi - # ignore errors (e.g. when there is a cache, but no index.theme) - true +if [ -e /usr/share/icons/hicolor/icon-theme.cache ] ; then + # touch it, just in case we cannot find the binary... + touch /usr/share/icons/hicolor + if [ -x /opt/gnome/bin/gtk-update-icon-cache ]; then + /opt/gnome/bin/gtk-update-icon-cache -q /usr/share/icons/hicolor + elif (which gtk-update-icon-cache); then + gtk-update-icon-cache -q /usr/share/icons/hicolor fi -done + # ignore errors (e.g. when there is a cache, but no index.theme) + true +fi %files # specify stale symlinks verbatim, not as glob - a change in recent versions of @@ -403,10 +391,6 @@ done /usr/share/applications/%unixfilename-writer.desktop /usr/share/applications/%unixfilename-startcenter.desktop /usr/share/applications/%unixfilename-xsltfilter.desktop -/usr/share/icons/gnome/*/apps/*png -/usr/share/icons/gnome/*/apps/*svg -/usr/share/icons/gnome/*/mimetypes/*png -/usr/share/icons/gnome/*/mimetypes/*svg /usr/share/icons/hicolor/*/apps/*png /usr/share/icons/hicolor/*/apps/*svg /usr/share/icons/hicolor/*/mimetypes/*png diff --git a/sysui/desktop/share/create_tree.sh b/sysui/desktop/share/create_tree.sh index 0de21a57fa15..68fc38c4a716 100755 --- a/sysui/desktop/share/create_tree.sh +++ b/sysui/desktop/share/create_tree.sh @@ -32,16 +32,6 @@ if [ "${KDEMAINDIR}" ]; then fi if [ "${GNOMEDIR}" ]; then - for i in `cd "${ICON_SOURCE_DIR}/hicolor"; find ??x?? ???x??? scalable -name "*.png" -o -name "*.svg"` - do - targetdir=${DESTDIR}/${GNOMEDIR}/share/icons/gnome/`dirname ${i}` - mkdir -p "${targetdir}" - destfile=$targetdir/${ICON_PREFIX:-}${ICON_PREFIX:+-}`basename ${i}` - cp "${ICON_SOURCE_DIR}/hicolor/${i}" "${destfile}" - chmod 0644 "${destfile}" - done - unset targetdir destfile - mkdir -p "${DESTDIR}/${GNOMEDIR}/share/mime-info" cp openoffice.mime "${DESTDIR}/${GNOMEDIR}/share/mime-info/${PREFIX}.mime" cp openoffice.keys "${DESTDIR}/${GNOMEDIR}/share/mime-info/${PREFIX}.keys" |