2007-06-05 16:32:52 +00:00
|
|
|
#!/bin/sh
|
2009-07-27 05:17:15 +00:00
|
|
|
|
2007-10-31 17:31:16 +00:00
|
|
|
DATE=$( date +%Y%m%d )
|
|
|
|
DIRNAME=libpciaccess
|
|
|
|
REV=${1:-master}
|
2007-06-05 16:32:52 +00:00
|
|
|
|
2007-10-31 17:31:16 +00:00
|
|
|
if test -e $DIRNAME.git; then
|
|
|
|
GIT_DIR=$DIRNAME.git git fetch git://git.freedesktop.org/git/xorg/lib/libpciaccess
|
2007-07-12 21:28:39 +00:00
|
|
|
else
|
2007-10-31 17:31:16 +00:00
|
|
|
git clone --bare git://git.freedesktop.org/git/xorg/lib/libpciaccess $DIRNAME.git
|
|
|
|
GIT_DIR=$DIRNAME.git git archive --prefix=$DIRNAME-$DATE/ --format=tar $REV | \
|
|
|
|
bzip2 -c > $DIRNAME-$DATE.tar.bz2
|
2007-07-12 21:28:39 +00:00
|
|
|
fi
|
2007-10-31 17:31:16 +00:00
|
|
|
|
2009-12-09 20:39:37 +00:00
|
|
|
HASH=$(GIT_DIR=$DIRNAME.git git show-ref -s $REV)
|
|
|
|
|
|
|
|
echo $HASH
|
|
|
|
|
|
|
|
exit
|
|
|
|
|
|
|
|
# the rest of this is supposed to work? i guess.
|
2007-10-31 17:31:16 +00:00
|
|
|
|
|
|
|
version=$(sed -n -e "s/^Version: *\(.*\)/\1/p" < libpciaccess.spec)
|
|
|
|
release=$(sed -n -e "s/^Release: *\([^.]*\).*/\1/p" < libpciaccess.spec)
|
|
|
|
release=$(($release + 1))
|
|
|
|
|
|
|
|
user=$(id -un)
|
|
|
|
IFS=: info=($(grep ^$user: /etc/passwd))
|
|
|
|
|
|
|
|
msg="* $(date +'%a %b %d %Y') ${info[4]} <$user@redhat.com> $version-$release.$DATE\\
|
|
|
|
- New snapshot, git revision $HASH.\\
|
|
|
|
"
|
|
|
|
|
2007-10-31 17:34:22 +00:00
|
|
|
sed -i -e "s/^%define gitdate.*/%define gitdate $DATE/" \
|
2007-10-31 17:31:16 +00:00
|
|
|
-e "s/^%define gitrev.*/%define gitrev $HASH/" \
|
|
|
|
-e "s/^Source0:.*/Source0: $DIRNAME-$DATE.tar.bz2/" \
|
|
|
|
-e "s/^Release:.*/Release: $release.%{gitdate}%{?dist}/" \
|
|
|
|
-e "/%changelog/ a $msg" \
|
|
|
|
libpciaccess.spec
|
2007-10-31 18:08:17 +00:00
|
|
|
|
2009-07-27 05:17:15 +00:00
|
|
|
make new-sources FILES=$DIRNAME-$DATE.tar.bz2
|