[debian-edu-commits] debian-edu/ 01/01: Drop bin/debconf-set-selections-edu workaround.

Holger Levsen holger at layer-acht.org
Thu May 19 22:59:03 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository debian-edu-config.

commit 810e49cc2c742583f5bbe1abd9fd7f4ec0cdc728
Author: Holger Levsen <holger at layer-acht.org>
Date:   Fri May 20 00:58:13 2016 +0200

    Drop bin/debconf-set-selections-edu workaround.
    
    Drop bin/debconf-set-selections-edu workaround and use debconf's
    debconf-set-selections as both #636219 and #711693 are fixed since Jessie.
---
 Makefile                               |   1 -
 bin/debconf-set-selections-edu         | 153 ---------------------------------
 debian/changelog                       |   2 +
 share/debian-edu-config/d-i/pre-pkgsel |   4 +-
 4 files changed, 3 insertions(+), 157 deletions(-)

diff --git a/Makefile b/Makefile
index 6fb0d4d..e398d33 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,6 @@ PACKAGE = debian-edu-config
 PROGS = \
 	debian-edu-current-codename \
 	debian-edu-ldapserver \
-	debconf-set-selections-edu \
 	ltsp-arch-debian-edu \
 	update-ini-file
 
diff --git a/bin/debconf-set-selections-edu b/bin/debconf-set-selections-edu
deleted file mode 100755
index cc68d44..0000000
--- a/bin/debconf-set-selections-edu
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/perl
-# This file was copied from debconf version 1.5.36.1 to fix BTS
-# #636219 (fixed in wheezy).  Later bug #711693 was fixed for wheezy.
-# FIXME: This script should be removed when these bugsare fixed in
-# FIXME: Wheezy or we upgrade to Jessie.
-
-
-sub usage {
-	print STDERR <<EOF;
-Usage: debconf-set-selections [-vcu] [file]
-  -v, --verbose     verbose output
-  -c, --checkonly   only check the input file format
-  -u, --unseen      do not set the 'seen' flag when preseeding values
-EOF
-	exit(1);
-}
-
-
-use warnings;
-use strict;
-use Debconf::Db;
-use Debconf::Template;
-use Getopt::Long;
-
-use vars qw(%opts $filename $debug $error $checkonly $unseen);
-
-sub info {
-	my $msg = shift;
-	print STDERR "info: $msg\n" if $debug;
-}
-
-sub warning {
-	my $msg = shift;
-	print STDERR "warning: $msg\n";
-}
-
-sub error {
-	my $msg = shift;
-	print STDERR "error: $msg\n";
-	$error++
-}
-
-sub load_answer {
-	my ($owner, $label, $type, $content) = @_;
-	
-	info "Loading answer for '$label'";
-
-	my $template=Debconf::Template->get($label);
-	if (! $template) {
-		$template=Debconf::Template->new($label, $owner, $type);
-		$template->description("Dummy template");
-		$template->extended_description("This is a fake template used to pre-seed the debconf database. If you are seeing this, something is probably wrong.");
-	}
-	else {
-		if ("password" ne $type) {
-			$template->default($content);
-		}
-	}
-	$template->type($type);
-	
-	my $question=Debconf::Question->get($label);
-	if (! $question) {
-		error("Cannot find a question for $label");
-		return;
-	}
-	$question->addowner($owner, $type);
-	$question->value($content);
-	if (! $unseen) {
-		$question->flag("seen", "true");
-	}
-}
-
-sub set_flag {
-	my ($owner, $label, $flag, $content) = @_;
-
-	info "Setting $flag flag";
-
-	my $question=Debconf::Question->get($label);
-	if (! $question) {
-		error("Cannot find a question for $label");
-		return;
-	}
-	$question->flag($flag, $content);
-}
-
-my @knowntypes = qw(select boolean string multiselect note password text title);
-my @knownflags = qw(seen);
-
-sub ok_format {
-	my ($owner, $label, $type, $content) = @_;
-	if (! defined $owner || ! defined $label || ! defined $content) {
-		error "parse error on line $.: '$_'";
-		return;
-	}
-	elsif (! grep { $_ eq $type } @knowntypes, @knownflags) {
-		warning "Unknown type $type, skipping line $.";
-		return;
-	}
-	else {
-		return 1;
-	}
-}
-
-sub mungeline ($) {
-	my $line=shift;
-	chomp $line;
-	$line=~s/^\#.*$//;
-	$line=~s/\r$//;
-	return $line;
-}
-
-
-GetOptions(
-	"verbose|v" => \$debug,
-	"checkonly|c" => \$checkonly,
-	"unseen|u" => \$unseen,
-) || usage();
-
-Debconf::Db->load;
-
-$error = 0;
-
-while (<>) {
-	$_=mungeline($_);
-	while (/\\$/ && ! eof) {
-		s/\\$//;
-		$_.=mungeline(<>);
-	}
-	next if /^\s*$/;
-	my ($owner, $label, $type, $content) = /^\s*(\S+)\s+(\S+)\s+(\S+)(?:\s(.*))?/;
-	if (! defined $content) {
-		$content='';
-	}
-	if (ok_format($owner, $label, $type, $content)) {
-		if (grep { $_ eq $type } @knownflags) {
-			info "Trying to set '$type' flag to '$content'";
-			set_flag($owner, $label, $type, $content);
-		}
-		else {
-			info "Trying to set '$label' [$type] to '$content'";
-			load_answer($owner, $label, $type, $content);
-		}
-	}
-}
-
-if (! $checkonly) {
-	Debconf::Db->save;
-}
-
-if ($error) {
-	exit 1;
-}
-
diff --git a/debian/changelog b/debian/changelog
index 9dd8802..52c8c5e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ debian-edu-config (1.902) UNRELEASED; urgency=medium
       Andreas Beckmann! (Closes: #824802)
     - remove Breaks on packages versions older than Jessie and on non-existant
       packages. 
+  * Drop bin/debconf-set-selections-edu workaround and use debconf's
+    debconf-set-selections as both #636219 and #711693 are fixed since Jessie.
 
  -- Holger Levsen <holger at debian.org>  Fri, 20 May 2016 00:39:38 +0200
 
diff --git a/share/debian-edu-config/d-i/pre-pkgsel b/share/debian-edu-config/d-i/pre-pkgsel
index 1a810c4..33a5472 100644
--- a/share/debian-edu-config/d-i/pre-pkgsel
+++ b/share/debian-edu-config/d-i/pre-pkgsel
@@ -268,9 +268,7 @@ debian-edu-config debian-edu-config/first-user-fullname string $FIRSTUSERGECOS
 debian-edu-config debian-edu-config/first-user-password password $FIRSTUSERPWD
 EOF
 	# Pass user and password information into the target
-	# Use our own version of debconf-set-selections until #636219 is fixed.
-	# It is not fixed in Squeeze 2012-03-25
-	cat $file | LANG=C chroot /target debconf-set-selections-edu || \
+	cat $file | LANG=C chroot /target debconf-set-selections || \
 	    error "Failed to load preseed values from $file."
 	rm $file
     fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-config.git



More information about the debian-edu-commits mailing list