bohoomil / fontconfig-ultimate

freetype2-infinality run-time settings => infinality compatible fontconfig => infinality-bundle
453 stars 38 forks source link

PKGBUILD added the -s #67

Closed JotaRandom closed 9 years ago

JotaRandom commented 9 years ago

As commented in #64 I add to ALL the -sf option. Is ok or you want sclude some archives?

bohoomil commented 9 years ago

Let me explain again.

This is an *.install file:

post_install() {
  fc-cache -f /usr/share/fonts/otf-arsenal-ibx > /dev/null
  echo "Done."
}

post_upgrade() {
  post_install $1
}

post_remove() {
  fc-cache -sf > /dev/null
  echo "Done."
}

op=$1
shift
$op $*

What each section does:

  1. post_install: scans only the given directory, not the entire font collection. Adding the -s option won't affect/improve the performance in any way (it just does what it should). If we replaced -f with -s, we could remove the directory because -s given for the entire cache has exactly the same performance.
  2. post_upgrade: works and performs in the same manner as 1).
  3. post_remove: here we used -fs because we wanted to refresh the entire system-wide cache, which is what -s does (not using it would refresh the user cache, too).

What we can do with the above:

  1. Either leave it as is: the only difference because our packages and the official ones is the post_remove array, which in Arch is now using -s only. Hence when you remove the official package, the operation will last significantly shorter than the removal of the bundle one.
  2. …or change all instances in all arrays to -s only (which also means removing the directory parameter from the post_install array because using it makes no sense then).

Right now if we did what you've suggested, we'd have returned to the pre-#19 state which is what we don't really want. All in all, let's just leave it as is and when I'm free I'll do my job, OK? :-)

Edit

The new file should contain the following:

post_install() {
  echo -n "Updating font cache... "
  fc-cache -s
  echo "Done."
}

post_upgrade() {
  post_install $1
}

post_remove() {
  post_install $1
}
JotaRandom commented 9 years ago

I let the pstremove as -sf as you say that without the -f the thing could give problem. the post install now use only the -s

bohoomil commented 9 years ago

I said it conditionally: it could, which doesn't mean it always does. The -f option should be used for system maintenance, to force rebuilding of the cache (the -r option goes even further: it first removes the entire cache and then rebuilds it). And if you're asking about release numbers: yes, if we're going to update all packages, we have to change the numbers, too. ;-)

Thanks, by the way. :-)

JotaRandom commented 9 years ago

I know that the release number will increment (yay I have all teh fonts installed [using ttf over otf or t1]) So first want to be sure that the .install is ok so it will not be needed to touch them again.

If you are ok with the actual state or want change something tell. otherwise (or whatever the word is) I will proced to start change the pkgrel()s

bohoomil commented 9 years ago

Just make sure that the content of each foo.install file for font packages (leave the libraries intact) is the same as in the snippet at the bottom of this post.

JotaRandom commented 9 years ago

Added all the pkgver, the post_install but I let the post_remove and post_upgrade intact because is better to be safe than sorry.