Commit 61a0b678 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmcs: move split spec function to the appropriate module

parent 502917c6
......@@ -126,8 +126,7 @@ do
# Prepare for fix only before changelog part
i=$SPEC.tmpspecbeforechangelog
cat $SPEC | awk 'BEGIN{desk=0}{if (desk==0) {print}; if(/^%changelog/&&desk==0){desk++}}' > $i
cat $SPEC | awk 'BEGIN{desk=0}{if (desk==1) {print}; if(/^%changelog/&&desk==0){desk++}}' > $SPEC.tmpspecchangelog
separate_changelog $SPEC $i $SPEC.tmpspecchangelog
# Unneeded on ALT
subst "s|^Prefix:.*$||" $i
......
......@@ -224,3 +224,12 @@ get_gear_spec()
echo $trySpec
test -f "$trySpec"
}
separate_changelog()
{
local SPEC="$1"
[ "$SPEC" != "$2" ] && [ "$SPEC" != "$3" ] || fatal "separate_changelog: cannot write to itself"
cat $SPEC | awk 'BEGIN{desk=0}{if (desk==0) {print}; if(/^%changelog/&&desk==0){desk++}}' > "$2"
cat $SPEC | awk 'BEGIN{desk=0}{if (desk==1) {print}; if(/^%changelog/&&desk==0){desk++}}' > "$3"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment