From 6ff29384e858d51280e606b5bd3355b7a902498f Mon Sep 17 00:00:00 2001 From: freesource Date: Fri, 28 Sep 2001 04:55:39 +0000 Subject: [PATCH] Added debconf interaction. --- .../pkg/dpkg/make-debian-x11.config | 47 ++++++++++++++ .../pkg/dpkg/make-debian-x11.postinst | 64 +++++++++++++++++++ .../pkg/dpkg/make-debian-x11.postrm | 3 + .../pkg/dpkg/make-debian-x11.prerm | 3 + .../pkg/dpkg/make-debian-x11.templates | 40 ++++++++++++ 5 files changed, 157 insertions(+) create mode 100755 add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.config create mode 100755 add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.postinst create mode 100755 add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.postrm create mode 100755 add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.prerm create mode 100644 add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.templates diff --git a/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.config b/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.config new file mode 100755 index 0000000..54845b7 --- /dev/null +++ b/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 + +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 () { + 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(); + +} + + + + diff --git a/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.postinst b/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.postinst new file mode 100755 index 0000000..d66d3ae --- /dev/null +++ b/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 + +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(); diff --git a/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.postrm b/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.postrm new file mode 100755 index 0000000..a2c66fa --- /dev/null +++ b/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.postrm @@ -0,0 +1,3 @@ +#!/bin/sh + +#DEBHELPER# diff --git a/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.prerm b/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.prerm new file mode 100755 index 0000000..a2c66fa --- /dev/null +++ b/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.prerm @@ -0,0 +1,3 @@ +#!/bin/sh + +#DEBHELPER# diff --git a/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.templates b/add-ons/yard/make-debian-X11/pkg/dpkg/make-debian-x11.templates new file mode 100644 index 0000000..0ff4b79 --- /dev/null +++ b/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. +