summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-08-11 09:57:51 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-08-11 09:57:51 +0000
commit9d631250e90767c5a3cc86078d45a511f17165ba (patch)
treeda4e7c5067e1a3e52d51b2d6e7ff25ef2c5e9fb8 /usr.sbin/pkg_add/OpenBSD
parent9b849de6166a625ea0f0614ed9e1a5e3edbcd667 (diff)
allow for a fonts.dir.dist, for cases where mkfontdir doesn't know what to do.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-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); };
}
}