-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
store_rpt
executable file
·50 lines (47 loc) · 1.02 KB
/
store_rpt
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
#!/bin/bash
# ./store_rpt mv -v 1.34
function do_cp {
for r in $r
do
for f in $(grep -l "$grep$r" $m)
do
mkdir -p t/reports/$v/$r
if test "$move" = "1"
then
mv $f t/reports/$v/$r/
else
cp -p $f t/reports/$v/$r/
fi
done
done
}
if test "$1" = "mv"; then move=1; shift; fi
if test "$1" = "-v"; then
v=$2
else
v=`perl -ane'print $F[2] if /^VERSION =/' Makefile`
fi
m=$(ls log.modules-5.*|egrep -v ".(orig|err)")
if [ -n "$m" ]; then
r=$(perl -lane "print substr(\$F[4],1) if /VERSION = $v r/" $m)
if [ -n "$r" ]; then
grep="VERSION = $v r"
else
r=$(perl -lane "print \$F[4] if /^# B::C::VERSION = 1.\\d\\w+ \\w+ /" $m)
grep="VERSION = $v "
fi
do_cp
fi
m=$(ls log.test-*-5.*|egrep -v ".(orig|err)")
if [ -n "$m" ]; then
r=$(perl -lane "print \$F[1] if /^Revision: \\d+\$/" $m)
if [ -n "$r" ]; then
# svn
grep="Revision: "
else
# git
r=$(perl -lane "print \$F[4] if /^# B::C::VERSION = 1.\\d\\w+ \\w+ /" $m)
grep=" "
fi
do_cp
fi