Skip to content

Commit

Permalink
add some helper files to create tar and changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bugfinder committed Jan 13, 2011
1 parent fc534f8 commit 8704c9d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Makefile
@@ -0,0 +1,15 @@
PRJ=openSUSE:Tools
PKG=osc-source_validator

all:

package:
@if test -d $(PKG); then cd $(PKG) && osc up && cd -; else osc co -c $(PRJ) $(PKG); fi
@./mkchanges | tee $(PKG)/.changes
@test ! -s $(PKG)/.changes || git push
@test -z "`git rev-list remotes/origin/master..master`" || { echo "unpushed changes"; exit 1; }
@f=(*bz2); test -z "$f" || /bin/rm -vi *.bz2
@./mktar
@mv *bz2 $(PKG)

.PHONY: all package
7 changes: 7 additions & 0 deletions mkchanges
@@ -0,0 +1,7 @@
#!/bin/sh
# create log suitable for c&p into rpm changes file
if [ -z "$1" ]; then
set -- remotes/origin/master..master
fi
# no idea why it always prints those commit lines
git rev-list --pretty=format:" - %s" "$@" |grep -v ^commit
13 changes: 13 additions & 0 deletions mktar
@@ -0,0 +1,13 @@
#!/bin/sh
set -e
NAME=osc-source_validator
VERSION=0.1
datefmt="%Y.%m.%d.%H%M"
LAST_COMMIT=(`git rev-list --timestamp HEAD^..HEAD`)
DATE=`date +$datefmt -d "1970-01-01 00:00 UTC $LAST_COMMIT seconds"`
#scmver="$DATE"
fullver="$VERSION${scmver:+_}$scmver"
pfx="$NAME${fullver:+-$fullver}"
fn="$pfx".tar.bz2
git archive --prefix="$pfx"/ HEAD | bzip2 > $fn
echo "version $fullver -> $fn"

0 comments on commit 8704c9d

Please sign in to comment.