Hello community,
here is the log from the commit of package fonts-config for openSUSE:Factory checked in at 2015-05-02 21:25:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fonts-config (Old)
and /work/SRC/openSUSE:Factory/.fonts-config.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fonts-config"
Changes:
--------
--- /work/SRC/openSUSE:Factory/fonts-config/fonts-config.changes 2015-01-15 16:00:46.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.fonts-config.new/fonts-config.changes 2015-05-02 21:25:50.000000000 +0200
@@ -1,0 +2,28 @@
+Fri Apr 24 08:20:24 UTC 2015 - pgajdos@suse.com
+
+- updated to 20150424:
+ * introduce --remove-user-setting option
+
+-------------------------------------------------------------------
+Thu Apr 23 12:02:33 UTC 2015 - pgajdos@suse.com
+
+- updated to 20150423:
+ * hide local system family preference list when user's one is
+ in action
+
+-------------------------------------------------------------------
+Tue Apr 21 13:34:43 UTC 2015 - pgajdos@suse.com
+
+- updated to 20150421:
+ * use mkpath instead of make_path [bnc#927968]
+ * behave better when
+ /usr/share/fontconfig/conf.avail/30-metric-aliases.conf
+ not found
+
+-------------------------------------------------------------------
+Fri Apr 17 11:55:10 UTC 2015 - pgajdos@suse.com
+
+- updated to 20150417:
+ * added --user option
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ fonts-config.spec ++++++
--- /var/tmp/diff_new_pack.rjYLfS/_old 2015-05-02 21:25:51.000000000 +0200
+++ /var/tmp/diff_new_pack.rjYLfS/_new 2015-05-02 21:25:51.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package fonts-config
#
-# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%define infinality_srcver 1-20130104_1
%define infinality_name fontconfig-infinality
Name: fonts-config
-Version: 20141207
+Version: 20150424
Release: 0
Summary: Configures Fonts for X Windows and other applications
License: GPL-2.0+ and MIT
++++++ 10-rendering-options.conf.template ++++++
--- /var/tmp/diff_new_pack.rjYLfS/_old 2015-05-02 21:25:51.000000000 +0200
+++ /var/tmp/diff_new_pack.rjYLfS/_new 2015-05-02 21:25:51.000000000 +0200
@@ -2,7 +2,7 @@
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<!-- DO NOT EDIT; this is a generated file -->
-<!-- modify /etc/sysconfig/fonts-config && run fonts-config instead -->
+<!-- modify _SYSCONFIG_FILE_PLACEHOLDER_ && run _FONTSCONFIG_RUN_PLACEHOLDER_ instead -->
<!-- using target="pattern", because we want to change pattern in 60-family-prefer.conf
regarding to this setting -->
@@ -58,5 +58,13 @@
_USE_EMBEDDED_BITMAPS_PLACEHOLDER_
+ <!-- Search for metric compatible families? -->
+ <match target="pattern" >
+ <edit name="search_metric_aliases" mode="assign">
+ <bool>_METRIC_ALIASES_PLACEHOLDER_</bool>
+ </edit>
+ </match>
+
+ _INCLUDE_USER_RENDERING_PLACEHOLDER_
</fontconfig>
++++++ 31-metric-aliases-bw.conf ++++++
--- /var/tmp/diff_new_pack.rjYLfS/_old 2015-05-02 21:25:51.000000000 +0200
+++ /var/tmp/diff_new_pack.rjYLfS/_new 2015-05-02 21:25:51.000000000 +0200
@@ -5,6 +5,9 @@
are not well hinted. Fall back to Liberation Sans instead, when
black and white rendering was chosen. -->
<match target="pattern">
+ <test name="search_metric_aliases">
+ <bool>true</bool>
+ </test>
<test name="force_bw">
<bool>true</bool>
</test>
@@ -18,12 +21,15 @@
</edit>
</match>
<match target="pattern">
+ <test name="search_metric_aliases">
+ <bool>true</bool>
+ </test>
<test name="force_bw">
<bool>true</bool>
</test>
<!-- Times represents group here as defined in
30-metric-aliases.conf -->
- <test name="family">
+ <test name="family">
<string>Times</string>
</test>
<edit name="family" mode="append" binding="same">
@@ -31,6 +37,9 @@
</edit>
</match>
<match target="pattern">
+ <test name="search_metric_aliases">
+ <bool>true</bool>
+ </test>
<test name="force_bw">
<bool>true</bool>
</test>
++++++ fonts-config ++++++
--- /var/tmp/diff_new_pack.rjYLfS/_old 2015-05-02 21:25:51.000000000 +0200
+++ /var/tmp/diff_new_pack.rjYLfS/_new 2015-05-02 21:25:51.000000000 +0200
@@ -129,6 +129,15 @@
Generate (or don't generate) font setup for Java.
+=item B<-u>, B<--user>
+
+run fontconfig setup for user. it reads ~/.config/fontconfig/fonts-config,
+which is user analogy of /etc/sysconfig/fonts-config.
+
+=item B<-U>, B<--remove-user-setting>
+
+remove user setting created by by B<--user>.
+
=item B<-f>, B<--force>
Force the update of all generated files even if it appears to be
@@ -316,16 +325,20 @@
use utf8;
use English;
use Getopt::Long;
+use File::Basename;
+use File::Path qw(mkpath);
use Env;
use strict;
my $script_start_time = time();
-my $version = 20141207;
+my $version = 20150424;
#
# OPTIONS
#
+my $OPT_USER = 0;
+my $OPT_REMOVE_USER_SETTING = 0;
my $OPT_FORCE = 0;
my $OPT_QUIET = 0;
my $OPT_VERBOSE = 0;
@@ -375,26 +388,36 @@
"GENERATE_JAVA_FONT_SETUP" , "OPT_JAVA",
);
-my %in_files = (
- "sysconfig file", "/etc/sysconfig/fonts-config",
- "rendering config template", "/usr/share/fonts-config/10-rendering-options.conf.template",
- "metric compatibility config", "/usr/share/fontconfig/conf.avail/30-metric-aliases.conf",
- "metric compatibility bw config", "/usr/share/fonts-config/conf.avail/31-metric-aliases-bw.conf",
+my $xdg_prefix = "$HOME/.config/";
+my %files = (
+ "sysconfig file", "/etc/sysconfig/fonts-config",
+ "user sysconfig file", "fontconfig/fonts-config",
+ "rendering config template", "/usr/share/fonts-config/10-rendering-options.conf.template",
+ "rendering config", "/etc/fonts/conf.d/10-rendering-options.conf",
+ "user rendering config", "fontconfig/rendering-options.conf",
+ "metric compatibility symlink", "/etc/fonts/conf.d/30-metric-aliases.conf",
+ "metric compatibility config", "/etc/fonts/conf.d/30-metric-aliases.conf",
+ "metric compatibility avail", "/usr/share/fontconfig/conf.avail/30-metric-aliases.conf",
+ "metric compatibility bw symlink", "/etc/fonts/conf.d/31-metric-aliases-bw.conf",
+ "local family list", "/etc/fonts/conf.d/58-family-prefer-local.conf",
+ "user family list", "fontconfig/family-prefer.conf",
"java fontconfig properties template", "/usr/share/fonts-config/fontconfig.SuSE.properties.template",
- );
-my %out_files = (
- "rendering config", "/etc/fonts/conf.d/10-rendering-options.conf",
- "local family list", "/etc/fonts/conf.d/58-family-prefer-local.conf",
- "metric compatibility symlink", "/etc/fonts/conf.d/30-metric-aliases.conf",
- "metric compatibility bw symlink", "/etc/fonts/conf.d/31-metric-aliases-bw.conf",
- "java fontconfig properties", "/usr/lib*/jvm/jre/lib/fontconfig.SuSE.properties",
- );
+ "java fontconfig properties", "/usr/lib*/jvm/jre/lib/fontconfig.SuSE.properties",
+ );
-get_option_defaults_from_sysconfig($in_files{"sysconfig file"});
+
+# read sysconfig and userconfig if --user was given
+get_option_defaults_from_sysconfig($files{'sysconfig file'});
+if (grep(/^--user$/, @ARGV)) {
+ # read variables on the top on the system ones
+ get_option_defaults_from_sysconfig($xdg_prefix.$files{'user sysconfig file'});
+}
# process command line options
my %opt;
unless (GetOptions(\%opt,
+ 'user|u', \$OPT_USER,
+ 'remove-user-setting|r', \$OPT_REMOVE_USER_SETTING,
'force|f', \$OPT_FORCE,
'quiet|q', \$OPT_QUIET,
'verbose|v', \$OPT_VERBOSE,
@@ -447,13 +470,9 @@
if ($OPT_INFO) {
# this is read by yast-fonts, so may be that
# change should be reflected in this yast module
- print "Input Files\n";
- for my $f (keys %in_files) {
- print " $f: $in_files{$f}\n"
- }
- print "Output Files\n";
- for my $f (keys %out_files) {
- print " $f: $out_files{$f}\n"
+ print "Involved Files\n";
+ for my $f (keys %files) {
+ print " $f: $files{$f}\n"
}
exit 0;
}
@@ -473,13 +492,30 @@
}
#
+# REMOVE USER SETTING
+#
+
+if ($OPT_REMOVE_USER_SETTING) {
+ my_remove_file($xdg_prefix.$files{'user sysconfig file'});
+ my_remove_file($xdg_prefix.$files{'user rendering config'});
+ my_remove_file($xdg_prefix.$files{'user family list'});
+ exit 0;
+}
+
+if ($VERBOSITY >= $VERBOSITY_DEBUG) {
+ print $OPT_USER ? "USER mode ($USER)\n" : "SYSTEM mode\n";
+}
+
+#
# SYSCONFIG VARS -- debug output
#
no strict "vars";
no warnings;
if ($VERBOSITY >= $VERBOSITY_DEBUG) {
- print "--- sysconfig options (read from $in_files{'sysconfig file'}):\n";
+ print "--- sysconfig options (read from $files{'sysconfig file'}".
+ ($OPT_USER ? ", $xdg_prefix$files{'user sysconfig file'}" : "").
+ "):\n";
for my $i (keys %sysconfig_options) {
if (defined eval ("\$$i")) {
printf "$i=%s\n", eval("\$$i");
@@ -494,8 +530,8 @@
# UID 0 CHECK
#
-if ($UID != 0 && $ENV{USER} !~ /root/) {
- print "*** error: you must be root to start $0\n";
+if (!$OPT_USER && $UID != 0 && $ENV{USER} !~ /root/) {
+ print "*** error: no root permissions; rerun with --user for user fontconfig setting\n";
exit 1;
}
@@ -503,7 +539,9 @@
# MKFONTSCALE, MKFONTSDIR
#
-mkfont_scale_dir();
+if (!$OPT_USER) {
+ mkfont_scale_dir();
+}
# The following two calls may change files in /etc/fonts, therefore
# they have to be called *before* fc-cache. If anything is
@@ -514,31 +552,37 @@
# FONTCONFIG RENDERING SETUP
#
-rendering_options();
-family_preference_config();
+rendering_options($OPT_USER);
+family_preference_config($OPT_USER);
#
# FONTCONFIG CACHE
#
-run_fccache ("");
-run_fccache ("32");
-run_fccache ("64");
+if (!$OPT_USER) {
+ run_fccache ("");
+ run_fccache ("32");
+ run_fccache ("64");
+}
#
# FONT DATABASE
#
-run_fp_rehash ();
+if (!$OPT_USER) {
+ run_fp_rehash ();
+}
# generate_java_font_setup uses fontconfig,
# therefore it has to be called *after* fc-cache
-if ($OPT_JAVA) {
+if (!$OPT_USER && $OPT_JAVA) {
generate_java_font_setup ();
}
-reload_xfs_config ();
+if (!$OPT_USER) {
+ reload_xfs_config ();
+}
exit 0;
@@ -549,6 +593,7 @@
sub usage {
print "Usage: fonts-config [option] ...\n";
+ print "-u, --user Run fontconfig setup for user.\n";
print "-f, --force Force the update of all generated files even\n";
print " if it appears unnecessary according to the time stamps\n";
print "-q, --quiet Work silently, unless an error occurs.\n";
@@ -616,11 +661,10 @@
eval("\$$sysconfig_options{$i}=0");
}
}
- return (0);
}
else {
- print "--- NOTE: $sysconfig_file doesn't exist, using builtin defaults.\n";
- return (1);
+ # VERBOSITY still not defined!
+ print "NOTE: $sysconfig_file doesn't exist, using builtin defaults.\n";
}
}
@@ -950,7 +994,6 @@
if ($VERBOSITY >= $VERBOSITY_DEBUG) {
print "mkfontscale is not available or it failed ";
print "-> creating an empty fonts.scale file.\n";
- exit 1
}
$try_again = 1;
my_system ("echo 0 > $dir/fonts.scale");
@@ -1074,13 +1117,22 @@
#
sub rendering_options {
- my $suse_rendering_file = $out_files{"rendering config"};
- my $suse_rendering_template_file = $in_files{"rendering config template"};
+ my ($user) = @_;
+ my $suse_rendering_file;
+ my $suse_rendering_template_file = $files{'rendering config template'};
my $suse_rendering = "";
my $suse_rendering_template = "";
+ if (!$user) {
+ $suse_rendering_file = $files{'rendering config'};
+ }
+ else {
+ $suse_rendering_file = $xdg_prefix . $files{'user rendering config'};
+ my_make_path(dirname($suse_rendering_file));
+ }
+
if ($VERBOSITY >= $VERBOSITY_DEBUG) {
- printf "--- Generating $suse_rendering_file ---\n";
+ printf "--- generating $suse_rendering_file ---\n";
}
if (-f "$suse_rendering_template_file") {
@@ -1169,6 +1221,27 @@
}
}
}
+ elsif ($ARG =~ /_SYSCONFIG_FILE_PLACEHOLDER_/) {
+ my $arg = ($user ? " -\\-user" : "");
+ $ARG =~ s/_SYSCONFIG_FILE_PLACEHOLDER_/$files{'sysconfig file'}/;
+ $ARG =~ s/_FONTSCONFIG_RUN_PLACEHOLDER_/$0$arg/;
+ $suse_rendering_template .= $ARG;
+ }
+ elsif ($ARG =~ /_METRIC_ALIASES_PLACEHOLDER_/) {
+ if ($OPT_SEARCH_METRIC_COMPATIBLE) {
+ $ARG =~ s/_METRIC_ALIASES_PLACEHOLDER_/true/;
+ } else {
+ $ARG =~ s/_METRIC_ALIASES_PLACEHOLDER_/false/;
+ }
+ $suse_rendering_template .= $ARG;
+ }
+ elsif ($ARG =~ /_INCLUDE_USER_RENDERING_PLACEHOLDER_/) {
+ if (!$user) {
+ # let user have a possibility to override system settings
+ $ARG =~ s@_INCLUDE_USER_RENDERING_PLACEHOLDER_@<include ignore_missing="yes" prefix="xdg">$files{'user rendering config'}</include>@;
+ $suse_rendering_template .= $ARG;
+ }
+ }
else {
$suse_rendering_template .= $ARG;
}
@@ -1213,7 +1286,7 @@
#
sub family_preference_list {
- my ($family, $prefered_families) = @_;
+ my ($family, $prefered_families, $user) = @_;
my $cfg;
my @families = split(/:/, $prefered_families);
@@ -1233,9 +1306,12 @@
$family =~ s/&/&/g;
if (! $OPT_FORCE_FPL) {
- $cfg .= " <alias>\n";
- $cfg .= " <family>$family</family>\n";
- $cfg .= " <prefer>\n";
+ $cfg .= "\t<alias>\n";
+ if (!$user) {
+ $cfg .= "\t\t