Skip to content

Commit 3643748

Browse files
committed
incorporate summary creation in runtime calc
1 parent 9f40c62 commit 3643748

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

void-updates.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,9 @@ parallel_check() {
102102
}
103103

104104
create_summary() {
105-
local d=$(($end - $start))
106-
local t="Void Updates for $(date +%Y-%m-%d\ %H:%M\ %Z) (took: ${d}s)"
107105
local f m
108106

109107
{
110-
printf '%s\n%s\n\n' "$t" $(printf %${#t}s |tr ' ' =)
111-
112108
for f in $dest/updates_*.txt; do
113109
if [ -s $f ]; then
114110
m=$(basename ${f%%.txt} | sed 's/updates_//')
@@ -123,6 +119,15 @@ create_summary() {
123119
} > $dest.txt
124120
}
125121

122+
create_heading() {
123+
local d=$(($end - $start))
124+
local t="Void Updates for $(date +%Y-%m-%d\ %H:%M\ %Z) (took: ${d}s)"
125+
local s
126+
s=$(printf %${#t}s |tr ' ' =)
127+
128+
sed -e "1s/^/$s\n\n/" -e "1s/^/$t\n/" -i $dest.txt
129+
}
130+
126131
make_current() {
127132
ln -sf $dest.txt $out/$name.txt
128133
ln -sfn $dest $out/$name
@@ -161,7 +166,8 @@ mkdir -p $dest
161166
init_src
162167
update_src
163168
find_pkgs | add_maintainer | parallel_check
164-
end=$(date +%s)
165169
create_summary
170+
end=$(date +%s)
171+
create_heading
166172
make_current
167173
} 2> $dest/_log.txt

0 commit comments

Comments
 (0)