zayronxio / Zafiro-icons

icon pack flat with light colors
GNU General Public License v3.0
438 stars 34 forks source link

gtk-update-icon-cache failing on filename with non-ascii chars #111

Closed tonylambiris closed 1 year ago

tonylambiris commented 2 years ago

I am the maintainer for the zafiro-icon-theme-git and am running into the following issue:

❯ pacman -U zafiro-icon-theme-git-1.2.r37.gf60cede-1-any.pkg.tar.zst
loading packages...
warning: zafiro-icon-theme-git-1.2.r37.gf60cede-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) zafiro-icon-theme-git-1.2.r37.gf60cede-1

[...INSTALL PROGRESS SNIPPED FOR BREVITY...]

:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating icon theme caches...
gtk-update-icon-cache: The generated cache was invalid.
error: command failed to execute correctly

I ran the following command to find any offending files:

❯ find src/zafiro-icon-theme-git | grep -P "[^\x00-\x7F|\x80-\xFF]"
src/zafiro-icon-theme-git/apps/scalable/βTORRENT.svg

I then added this snippet to the package() function in the PKGBUILD:

+       msg "Checking filenames for any non-ascii characters..."
+       while read file; do
+               msg2 "$(mv -vf "$file" "$(tr -cd '\000-\177' <<<$file)")"
+       done < <( find . -type f | grep -P "[^\x00-\x7F|\x80-\xFF]" )

File was detected and renamed during the pkgbuild process:

==> Starting package()...
==> Checking filenames for any non-ascii characters...
  -> renamed './apps/scalable/βTORRENT.svg' -> './apps/scalable/TORRENT.svg'

Package now installs without any issues:

❯ pacman -U zafiro-icon-theme-git-1.2.r37.gf60cede-1-any.pkg.tar.zst
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) zafiro-icon-theme-git-1.2.r37.gf60cede-1

[...INSTALL PROGRESS SNIPPED FOR BREVITY...]

:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating icon theme caches...
zayronxio commented 2 years ago

I'm sorry, I do not keep updated the aur repository

romildo commented 2 years ago

This issue is still present in the recent released 1.3 version.

zayronxio commented 1 year ago

solved