summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2004-08-11 09:57:50 +0000
committerespie <espie@openbsd.org>2004-08-11 09:57:50 +0000
commitf4a98e45374fa37e8c0010a7252ed93ca0a4f537 (patch)
tree215e04c47623b9f13ae91f151b0ec5b591a9409e
parentand this, heh (diff)
downloadwireguard-openbsd-f4a98e45374fa37e8c0010a7252ed93ca0a4f537.tar.xz
wireguard-openbsd-f4a98e45374fa37e8c0010a7252ed93ca0a4f537.zip
allow for a fonts.dir.dist, for cases where mkfontdir doesn't know what to do.
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 7360affc6ac..5405852a9de 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.21 2004/08/10 11:53:27 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.22 2004/08/11 09:57:50 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -834,6 +834,17 @@ sub update_fontalias
close $f;
}
+sub restore_fontdir
+{
+ my $dirname = shift;
+ if (-f "$dirname/fonts.dir.dist") {
+ require File::Copy;
+
+ unlink("$dirname/fonts.dir");
+ File::Copy::copy("$dirname/fonts.dir.dist", "$dirname/fonts.dir");
+ }
+}
+
sub finish_fontdirs
{
my @l = keys %fonts_todo;
@@ -841,6 +852,7 @@ sub finish_fontdirs
map { update_fontalias($_) } @l;
print "You may wish to update your font path for ", join(' ', @l), "\n";
eval { system("/usr/X11R6/bin/mkfontdir", @l); };
+ map { restore_fontdir($_) } @l;
eval { system("/usr/X11R6/bin/fc-cache", @l); };
}
}