How to merge new /etc/fonts/fonts.conf.pacnew?

I have a new /etc/fonts/fonts.conf.pacnew:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
	<description>Default configuration file</description>
...

compared to existing /etc/fonts/fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
	<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
		<its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
	</its:rules>

	<description>Default configuration file</description>
...

Any suggestion how to merge?

1 Like

All I see is its:rules section removed from the middle, and urn:fontconfig added under SYSTEM. Seems straightforward enough :thinking:

Use a diff program, like diffuse for example. It’s much easier. You just have to call it with pacdiff:

DIFFPROG=diffuse pacdiff

Kompare is a diff GUI wrapper that allows users to view differences between files and also merge them.

Some of its features include:

  1. Supports multiple diff formats
  2. Supports comparison of directories
  3. Supports reading diff files
  4. Customizable interface
  5. Creating and applying patches to source files
1 Like

I like and mostly use Kompare, but kdiff3 is also nice.

meld is another alternative for comparing and merging files.

1 Like

The question is not “which program should I use for comparing and merging” but “if I’ll do any damage if I delete/change those lines”.

I personally stick to this:

DO NOT EDIT THIS FILE.
IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
LOCAL CHANGES BELONG IN ‘local.conf’.

And mine looks like the 1st box already, don’t remember if I had to merge it though :man_shrugging:

5 Likes

Exactly, @tuxmanjarino, I know how to do it but was not sure if the block

<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
		<its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
	</its:rules>

from old config should be kept or not. I will then keep the new pacnew version and store the old one as backup just in case needed…

Edit: After using the pacnew version as new config I did not see any issue. Thanks, everybody!

4 Likes

If you are not sure about this one code block you could comment out the deprecated bit in the .conf file instead of removing it

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
<!-- 	<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
		<its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
	</its:rules> -->

	<description>Default configuration file</description>

I use a BASH script that creates a backup copy of the .conf file before loading it in meld to merge with the .pacnew

for i in $(/usr/bin/pacdiff --output); do
/usr/bin/cp "${i/.pacnew/}" "${i/.pacnew/}.old"
done
2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.