File: postinst

package info (click to toggle)
popularity-contest 0.1-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 92 kB
  • ctags: 46
  • sloc: python: 195; sh: 105; makefile: 39
file content (62 lines) | stat: -rwxr-xr-x 1,658 bytes parent folder | download
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash

set -e

if [ "$1" = "configure" ]; then
    if grep -q MAILTO /etc/popularity-contest.conf; then
        exit 0;
    fi
    
    cat <<-EOF

	PACKAGE POPULARITY CONTEST
        
	You can have your system anonymously e-mail the Debian developers
	with statistics about your most used Debian packages.
	
	This information helps us make decisions such as which packages
	should go on the first Debian CD.  Also, we can improve future
	versions of Debian so that the most popular packages are the ones
	which are installed automatically for new users.
	
	If you choose to participate, the automatic submission script will
	run once every night automatically.
	
	EOF
    
    yesno=""
    
    while [ "$yesno" != 'y' -a "$yesno" != 'n' ]; do
    	echo -e "Do you want to participate (y/n)? "\\c
    	read yesno
    done
    
    echo
    
    if [ "$yesno" = "y" ]; then
    	echo "Great!  We appreciate your contribution."
    	cat <<-EOF >/etc/popularity-contest.conf
		# Config file for Debian's popularity-contest package.
		#
		# MAILTO specifies the address to e-mail statistics to each
		# night.  If you comment it out, the cron job will be disabled.
		#
		MAILTO="apenwarr-survey@debian.org"
		
		EOF
    else
    	echo "Okay.  No statistics will be sent."
    
    	cat <<-EOF >/etc/popularity-contest.conf
		# Config file for Debian's popularity-contest package.
		#
		# MAILTO specifies the address to e-mail statistics to each
		# night.  If you comment it out, the cron job will be disabled.
		#
		#MAILTO="apenwarr-survey@debian.org"
		
		EOF
    fi
    
    echo "If you change your mind, just edit /etc/popularity-contest.conf."
fi