3 # scripts/setversion VERSION [DESCRIPTION [DISTRIBUTION]]
5 # Sets a new version number, including a debian/changelog entry (albeit
6 # a rather terse and informal one).
9 use POSIX qw(strftime uname);
17 $description = "DisOrder $version";
20 $distribution = shift;
22 $distribution = "unstable";
25 my $hostname = (uname)[1];
26 $hostname = (gethostbyname($hostname))[0];
27 my $logname = (getpwuid($<))[0];
28 my $name = (getpwuid($<))[6];
30 my $email = "$logname\@$hostname";
31 if(exists $ENV{"EMAIL"}) {
32 $email = $ENV{"EMAIL"};
34 my $date = strftime("%a, %d %b %Y %H:%M:%S %z", localtime);
38 open(C, "<$path") or die "$path: $!\n";
47 my $new = "$path.new";
49 and (print O @$contents)
53 or die "$new -> $path: $!\n";
56 my @c = input("configure.ac");
58 if(/^AC_INIT|AM_INIT/) {
59 s/\[[0-9\.\+]+\]/[$version]/g;
62 output("configure.ac", \@c);
64 @c = input("debian/changelog");
66 "disorder ($version) $distribution; urgency=low\n",
70 " -- $name <$email> $date\n",
72 output("debian/changelog", \@c);