diff --git a/fonts-config b/fonts-config index f4bc515..3396681 100644 --- a/fonts-config +++ b/fonts-config @@ -131,9 +131,13 @@ 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, +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 @@ -327,13 +331,14 @@ use Env; use strict; my $script_start_time = time(); -my $version = 20150423; +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; @@ -412,6 +417,7 @@ if (grep(/^--user$/, @ARGV)) { 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, @@ -486,8 +492,15 @@ elsif ($OPT_VERBOSE) { } # +# 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"; @@ -1972,4 +1985,23 @@ sub search_executable { return ""; } - +sub my_remove_file { + my ($file) = @_; + if (-e $file) { + if(unlink $file) { + if ($VERBOSITY >= $VERBOSITY_DEBUG) { + print "--- $file deleted "; + } + } + else { + if ($VERBOSITY >= $VERBOSITY_DEBUG) { + print "--- WARNING: can not delete $file "; + } + } + } + else { + if ($VERBOSITY >= $VERBOSITY_DEBUG) { + print "--- WARNING: $file does not exist, can not delete"; + } + } +} diff --git a/fonts-config.changes b/fonts-config.changes index 9f0271d..dfe8c72 100644 --- a/fonts-config.changes +++ b/fonts-config.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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 diff --git a/fonts-config.spec b/fonts-config.spec index a1e29b9..74db991 100644 --- a/fonts-config.spec +++ b/fonts-config.spec @@ -19,7 +19,7 @@ %define infinality_srcver 1-20130104_1 %define infinality_name fontconfig-infinality Name: fonts-config -Version: 20150421 +Version: 20150424 Release: 0 Summary: Configures Fonts for X Windows and other applications License: GPL-2.0+ and MIT