1 |
Michael Cummings wrote:[Tue Jun 07 2005, 12:49:21PM EDT] |
2 |
> HA! Oh man, I needed a good chuckle. cvs log is about the only |
3 |
> nearly reliable thing I have found sometimes - seems folks that |
4 |
> don't like to use metadata.xml when commiting a random package also |
5 |
> avoid using ChangeLogs. Go figure. |
6 |
|
7 |
I guess I haven't run into as much of that as you have. I have |
8 |
a couple of functions that make this easy for me. Here is the usage |
9 |
if anybody is interested: |
10 |
|
11 |
ek - short for ekeyword |
12 |
|
13 |
er - run echangelog, then call rc automatically |
14 |
|
15 |
rc - repoman commit with the most recent message pulled from the |
16 |
ChangeLog |
17 |
|
18 |
So in general I do something like this: |
19 |
|
20 |
$ ek alpha ia64 blah.ebuild |
21 |
$ er "stable on alpha, ia64" |
22 |
|
23 |
If repoman doesn't allow me to commit for one reason or another, I'll |
24 |
fix the problem, then simply run "rc" to retry the commit with the |
25 |
same message. |
26 |
|
27 |
Here are the function definitions: |
28 |
|
29 |
# ek: ekeyword |
30 |
alias ek=ekeyword |
31 |
|
32 |
# echangelog and repoman combined |
33 |
er() { |
34 |
echangelog ${1:+"$*"} || return 1 |
35 |
rc |
36 |
} |
37 |
|
38 |
# repoman commit with the message from the ChangeLog |
39 |
rc() { |
40 |
declare msg out |
41 |
|
42 |
if [[ -n $* ]]; then |
43 |
msg="$*" |
44 |
echo "Using msg from command-line" >&2 |
45 |
else |
46 |
msg=$(perl <ChangeLog -0777 -pe \ |
47 |
's/^.*?\n \d{2} \w{3} \d{4};.*?:\n//s || exit 1; # trim top |
48 |
s/\n(?:\*| \d{2} \w{3} \d{4};).*//s; # trim bottom |
49 |
s/^\s*//; s/\s*$//; s/^(?: |\t)//gm; # fix spacing |
50 |
') |
51 |
if [[ $? != 0 || -z $msg ]]; then |
52 |
echo "couldn't parse message from ChangeLog" >&2 |
53 |
return 1 |
54 |
fi |
55 |
echo "Parsed msg from ChangeLog" >&2 |
56 |
fi |
57 |
|
58 |
echo "----------" >&2 |
59 |
echo "$msg" >&2 |
60 |
echo "----------" >&2 |
61 |
|
62 |
repoman commit -m "$msg" || return 1 |
63 |
|
64 |
if [[ -x /usr/bin/eviewcvs ]]; then |
65 |
local f entry=$(perl -00ne '/^ \d/ and print, last' ChangeLog) |
66 |
entry=${entry%%:*} |
67 |
entry=${entry##*>} |
68 |
entry=${entry//,/ } |
69 |
for f in $entry; do |
70 |
[[ $f == -* ]] && continue |
71 |
echo "${f#+}" |
72 |
done | xargs eviewcvs |
73 |
fi |
74 |
} |
75 |
|
76 |
Regards, |
77 |
Aron |
78 |
|
79 |
-- |
80 |
Aron Griffis |
81 |
Gentoo Linux Developer |