Browse Source

Added debconf interaction.

master
freesource 24 years ago
parent
commit
6ff29384e8
  1. 47
      add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.config
  2. 64
      add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.postinst
  3. 3
      add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.postrm
  4. 3
      add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.prerm
  5. 40
      add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.templates

47
add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.config

@ -0,0 +1,47 @@
#!/usr/bin/perl -w
# make-debian-x11.config
# Jonathan Rosenbaum <freesource@users.sourceforge.net>
use strict;
use Debconf::Client::ConfModule ':all';
fset("make-debian-x11/close_gbootroot_down","seen","false");
input("medium","make-debian-x11/close_gbootroot_down");
go();
fset("make-debian-x11/make_debian_x11","seen","false");
input("medium","make-debian-x11/make_debian_x11");
go();
my $answer = get("make-debian-x11/make_debian_x11");
if ($answer eq "true") {
# Check to see if the swim databases have ever been made before
my $swim = "swim -qf /sbin/init|";
my $swim_reply;
open(SWIM,$swim) or warn "Had trouble using swim: $!\n";
while (<SWIM>) {
if ($_ eq "file init is not owned by any package\n") {
fset("make-debian-x11/make_debian_x11-swim","seen","false");
input("medium","make-debian-x11/make_debian_x11-swim");
go();
}
}
close(SWIM);
fset("make-debian-x11/make_debian_x11-doc","seen","false");
input("medium","make-debian-x11/make_debian_x11-doc");
go();
fset("make-debian-x11/make_debian_x11-zoneinfo","seen","false");
input("medium","make-debian-x11/make_debian_x11-zoneinfo");
go();
}

64
add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.postinst

@ -0,0 +1,64 @@
#!/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") {
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";
}
}
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";
}
else {
$swim = "no";
}
}
if (!$swim) {
open (SCRIPT, "|make_debian-X11")
or warn "Couldn't open make_debian-X11\n";
print SCRIPT $doc;
print SCRIPT $zoneinfo;
close(SCRIPT);
}
else {
open (SCRIPT, "|make_debian-X11")
or warn "Couldn't open make_debian-X11\n";
print SCRIPT $swim;
print SCRIPT $doc;
print SCRIPT $zoneinfo;
close(SCRIPT);
}
}
stop();

3
add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.postrm

@ -0,0 +1,3 @@
#!/bin/sh
#DEBHELPER#

3
add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.prerm

@ -0,0 +1,3 @@
#!/bin/sh
#DEBHELPER#

40
add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.templates

@ -0,0 +1,40 @@
Template: make-debian-x11/close_gbootroot_down
Type: note
Description: gBootRoot needs to be restarted to initiate replacements changes.
This package adds new replacements to gBootRoot. In order for a user's local
replacements directory to reflect the changes, gbootroot needs to be restarted
for each user. If these replacement files already exist in a user's directory
they will not be updated unless you choose to delete them first in the local
directory, this is up to your own digression. Here is the list of the
replacement files:
.
/usr/share/gbootroot/yard/Replacements/root/make_swapfile
/usr/share/gbootroot/yard/Replacements/root/README-debian-X11
/usr/share/gbootroot/yard/Replacements/root/setup-debian-X11
/usr/share/gbootroot/yard/Replacements/usr/X11R6/bin/startx-debian-X11
Template: make-debian-x11/make_debian_x11
Type: boolean
Description: Make the Debian-X11.yard template?
I can now make the Debian-X11.yard template, or you can do it latter yourself.
I will just create one for the administrator: root
Template: make-debian-x11/make_debian_x11-swim
Type: boolean
Description: Generate swim databases to allow template creation?
In order for the template to be properly created swim databases first
have to exist. Do you want me to proceed with this? Otherwise, the template
will not be created.
Template: make-debian-x11/make_debian_x11-doc
Type: boolean
Description: Remove /usr/share/{doc,man,info}?
All documentation, manuals and info can be removed to create a more
streamline root filesystem.
Template: make-debian-x11/make_debian_x11-zoneinfo
Type: boolean
Description: Only use your locale settings?
The default is to remove everything in /usr/share/zoneinfo except for your
local settings found in /etc/locatime.
Loading…
Cancel
Save