142f7da250be3172ab544daf0ca7d866b7a91dc8
3 # scripts/setversion VERSION
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
);
13 my $hostname = (uname
)[1];
14 $hostname = (gethostbyname($hostname))[0];
15 my $logname = (getpwuid($<))[0];
16 my $name = (getpwuid($<))[6];
18 my $email = "$logname\@$hostname";
19 my $date = strftime
("%a, %d %b %Y %H:%M:%S %z", localtime);
23 open(C
, "<$path") or die "$path: $!\n";
32 my $new = "$path.new";
34 and (print O @
$contents)
38 or die "$new -> $path: $!\n";
41 my @c = input
("configure.ac");
43 if(/^AC_INIT|AM_INIT/) {
44 s/\[[0-9\.\+]+\]/[$version]/g;
47 output
("configure.ac", \
@c);
49 @c = input
("debian/changelog");
51 "disorder ($version) unstable; urgency=low\n",
53 " * Disorder $version\n",
55 " -- $name <$email> $date\n",
57 output
("debian/changelog", \
@c);