File: config

package info (click to toggle)
faqomatic 2.721-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,984 kB
  • ctags: 548
  • sloc: perl: 13,356; sh: 69; makefile: 47
file content (28 lines) | stat: -rw-r--r-- 781 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl

use Debconf::Client::ConfModule ':all';
use Digest::MD5 qw(md5_hex);

# Spell the name consistently.
title('Configuring Faq-O-Matic');

if ($ARGV[1] && -f '/var/lib/fom/meta/idfile'
	     && system('dpkg', '--compare-versions',
		       $ARGV[1], 'lt', '2.711') == 0) {
	# Don't nag when upgrading from a pre-Debconf version.
	fset('faqomatic/password', 'seen', 'true');
} elsif ((input('high', 'faqomatic/password'))[0] == 0) {
	go();

	if (my $temppass = get('faqomatic/password')) {
		set('faqomatic/password', '');

		# Taken from fom.PL.
    		my $cryptpass = md5_hex($temppass);

		register('faqomatic/password', 'faqomatic/encrypted-password');
		set('faqomatic/encrypted-password', $cryptpass);
	} else {
		unregister('faqomatic/encrypted-password');
	}
}