X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=ci;h=a90fc60c74b9cca68f3eadb11cd2834ac4b4eb45;hb=ab517c2dbad11b5bc0a9604761f2165e94a71b50;hp=03b8d7389289e461586a0f7e7835187dd42ead40;hpb=e55f7969b4ca40a9284c228d2824b60a1c200176;p=packages%2Frpm-build-tools.git diff --git a/ci b/ci old mode 100644 new mode 100755 index 03b8d73..a90fc60 --- a/ci +++ b/ci @@ -1,17 +1,19 @@ #!/bin/sh -SPECFILE="$1" -SPECFILE="${SPECFILE%%/*}" -SPECFILE="$(basename $SPECFILE .spec)" -SPEC="$SPECFILE/$SPECFILE.spec" +SPEC=$(basename "$1" .spec).spec +PACKAGE=$(basename "$SPEC" .spec) +TOPDIR=$(rpm -E %_topdir) +PACKAGEDIR=$TOPDIR/$PACKAGE +SPECFILE="$TOPDIR/$PACKAGE/$SPEC" CLEANBUILDDIR="$HOME/PLD" +CIVIM=$PWD/civim -if [ $# -ne 1 -o ! -d "$SPECFILE" -o ! -f "$SPEC" ]; then +if [ $# -ne 1 -o ! -d "$PACKAGEDIR" -o ! -f "$SPECFILE" ]; then echo "spec file missing" exit 1 fi -if [ ! -x "$PWD/civim" ]; then +if [ ! -x "$CIVIM" ]; then echo "civim missing" exit 1 fi @@ -55,18 +57,19 @@ pause() read ans } -cvs -z9 diff -u $SPECFILE | diffcol +cd $PACKAGEDIR -pause "Proceed ?" +git diff --color=auto $SPEC -sed '/^# AUTO: /d' -i "$SPEC" -SIMPLE_DIFF="$(cvs -z9 diff "$SPEC")" +pause "Proceed ?" -./adapter "$SPEC" +sed '/^# AUTO: /d' -i "$SPECFILE" +SIMPLE_DIFF="$(cd $PACKAGEDIR && git diff "$SPEC")" -diff="$(cvs -z9 diff -u $SPEC)" +./adapter "$SPECFILE" -echo "$diff" | diffcol +diff=$(git diff $SPEC) +git diff --color=auto $SPEC ver=$(echo "$diff" | awk ' /^\+Version/ { ver = $2 } @@ -98,8 +101,8 @@ del=$(echo "$diff" | awk ' n="$(echo -e '\nn')" n="${n%%n}" msg="" -[ -n "$ver" ] && msg="$msg- updated to: $ver$n" -[ -n "$rel" ] && msg="$msg- release: $rel$n" +[ -n "$ver" ] && msg="$msg- up to $ver$n" +[ -n "$rel" -a "$rel" != "1" ] && msg="$msg- release $rel$n" [ -n "$add" ] && msg="$msg- BR: $add$n" [ -n "$del" ] && msg="$msg- dropped BR: $del$n" @@ -110,7 +113,7 @@ pause "Commit ?" export COMMIT_MESSAGE="$msg" export COMMIT_PACKAGES="$SPECFILE" -export VISUAL="$PWD/civim" -cvs -z9 ci "$SPECFILE" +export VISUAL="$CIVIM" +git ci "$SPECFILE" -[ -n "$CLEANBUILDDIR" ] && rm -f $CLEANBUILDDIR/installed/$SPECFILE +[ -n "$CLEANBUILDDIR" ] && rm -f $CLEANBUILDDIR/installed/$SPEC