1
0
mirror of https://github.com/fspc/gbootroot.git synced 2025-02-23 09:03:23 -05:00
gbootroot/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.postinst

123 lines
3.3 KiB
Plaintext
Raw Normal View History

2001-09-28 04:55:39 +00:00
#!/usr/bin/perl -w
# make-debian-x11.postinst
# Jonathan Rosenbaum <freesource@users.sourceforge.net>
use strict;
use Debconf::Client::ConfModule ':all';
if ($ARGV[0] && $ARGV[0] eq "configure") {
2001-09-29 06:43:00 +00:00
2001-09-28 04:55:39 +00:00
if (-d "/usr/doc" && !-e "/usr/doc/make-debian-x11" &&
-d "/usr/share/doc/make-debian-x11") {
system "ln -sf ../share/doc/make-debian-x11 /usr/doc/make-debian-x11";
}
2001-09-29 06:43:00 +00:00
2001-09-28 04:55:39 +00:00
}
# Before doing anything else, append CVS Entries files with fictional dates
# so replacements can't be edited. This is because make-debian-x11 shares
# a CVS/Entries file in /root with gbootroot. Note: This will be done
# over and over again, but usually a new gbootroot is installed so it isn't
# an issue.
my $Entries = << "ENTRIES";
/README-debian-X11/1.4/Thu Nov 8 06:16:29 2001//
/make_swapfile/1.2/Thu Nov 8 06:16:29 2001//
/setup-debian-X11/1.7/Thu Dec 6 18:36:05 2001//
ENTRIES
my $root_entry = "/usr/share/gbootroot/yard/Replacements/root/CVS/Entries";
if ( -f $root_entry ) {
open(ENTRY, ">>$root_entry") or warn "Couldn't open $root_entry: $!\n";
print ENTRY $Entries;
close(ENTRY) or warn "Couldn't close $root_entry\n";
}
2001-09-29 06:43:00 +00:00
2001-09-28 04:55:39 +00:00
my $answer = get("make-debian-x11/make_debian_x11");
if ($answer eq "true") {
my $swim = get("make-debian-x11/make_debian_x11-swim");
my $doc = get("make-debian-x11/make_debian_x11-doc");
my $zoneinfo = get("make-debian-x11/make_debian_x11-zoneinfo");
if ($doc eq "true") {
$doc = "yes\n";
}
else {
$doc = "no\n";
}
if ($zoneinfo eq "true") {
$zoneinfo = "yes\n";
}
else {
$zoneinfo = "no\n";
}
if ($swim) {
if ($swim eq "true") {
$swim = "yes\n";
2001-09-28 04:55:39 +00:00
}
else {
$swim = "no\n";
2001-09-28 04:55:39 +00:00
}
}
if (!$swim) {
if ($ARGV[0] && $ARGV[0] eq "configure") {
print STDERR
"During make-debian-x11 package installation warnings\n" .
"about make-debian-x11 not being installed on the\n" .
"system are taken into account by the make_debian-x11\n" .
"script and the template properly reflects an installed\n" .
"make-debian-x11 package. This warning won't be issued\n" .
"when reconfiguring make-debian-x11.\n\n";
}
2001-09-28 04:55:39 +00:00
open (SCRIPT, "|make_debian-X11")
or warn "Couldn't open make_debian-X11\n";
print SCRIPT $doc;
print SCRIPT $zoneinfo;
close(SCRIPT);
}
else {
# Will run swim --initdb first rather then trying to interact
# with the make_debian-X11 script.
2001-09-29 06:43:00 +00:00
# Not a perfect approach, but the swim package will be updated
# eventually.
print STDERR "Be patient, building the swim databases will take a little while.\n";
system "swim --initdb 2&> /dev/null";
# Now continue with the script.
#open (SCRIPT, "|make_debian-X11 2&> /dev/null")
if ($ARGV[0] && $ARGV[0] eq "configure") {
print STDERR
"During make-debian-x11 package installation warnings\n" .
"about make-debian-x11 not being installed on the\n" .
"system are taken into account by the make_debian-x11\n" .
"script and the template properly reflects an installed\n" .
"make-debian-x11 package. This warning won't be issued\n" .
"when reconfiguring make-debian-x11.\n\n";
}
open (SCRIPT, "|make_debian-X11")
2001-09-28 04:55:39 +00:00
or warn "Couldn't open make_debian-X11\n";
#print SCRIPT $swim;
2001-09-28 04:55:39 +00:00
print SCRIPT $doc;
print SCRIPT $zoneinfo;
close(SCRIPT);
set("make-debian-x11/make_debian_x11-swim","");
2001-09-28 04:55:39 +00:00
}
}
2001-10-08 17:19:06 +00:00
2001-09-28 04:55:39 +00:00
stop();
2001-10-08 17:19:06 +00:00