forked from pflanze/chj-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildpackage-setup
executable file
·79 lines (58 loc) · 1.41 KB
/
buildpackage-setup
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/perl -w
# Fre Dez 13 14:57:56 CET 2002
use strict;
$0=~ /([^\/]+)$/s or die "?";
my $myname=$1;
sub usage {
print "$myname
Setzt den usernamen und email und so ins debian/changelog rein.
";
exit @_;
}
my @files;
for (my $i=0; $i<=$#ARGV; $i++) {
local $_=$ARGV[$i];
if (/^--?h(elp)?$/) {
usage
} elsif ($_ eq '--') {
push @files, @ARGV[$i+1..$#ARGV];
last;
} elsif (/^-/) {
warn "Unknown option '$_'\n";
usage(1)
} else {
push @files, $_
}
}
usage if @files;
use lib "/opt/chj/perllib";
use Chj::fileutils qw(fetchfile writebackfile);
use Chj::Mailfrom 'mailfromaddress';
use Chj::userfullname;
use Chj::username;
our $userfullname= userfullname;
our $initials= do {
if ($userfullname eq "Christian Jaeger") {
"cj"
} else {
username
}
};
our $email= mailfromaddress;
my $a= fetchfile "debian/changelog";
$$a=~ /^(.*)(?:\n\S|$)/s or die "Strange format in changelog";
my $first=$1;
$first=~ /\n -- ([^\n]*)/ or die "invalid format";
my $firstuser=$1;
if ($firstuser=~ /$userfullname/) {
die "Scheint bereits angepasst worden zu sein. Breche ab.\n";
}
$$a=~ /^([^\n]+)/s or die "invalid format";
my $firstline= $1;
$firstline=~ s/^([^()]*\([^()]*)\)/$1.$initials\)/ or die "invalid format: vermisse versionsangabe in klammern";
my $date= `date -R`;
$$a= "$firstline
* recompiled from testing
-- $userfullname <$email> $date
$$a";
writebackfile("debian/changelog",$a);