xorg-x11-proto-devel/make-git-snapshot.sh
Troy Dawson aa6f181a75 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/xorg-x11-proto-devel#d90dfa21ca8a2a9d31cf5a6cf6ef9b9df30aed37
2020-10-15 14:11:32 -07:00

32 lines
582 B
Bash
Executable File

#!/bin/sh
proto=$1
branch=$2
if [ -z "$proto" ]; then
echo "Usage: $0 <proto name> [<branch>]"
exit 1
fi
dirname=$proto-$( date +%Y%m%d )
rm -rf $dirname
git clone git://git.freedesktop.org/git/xorg/proto/$proto $dirname
cd $dirname
if [ -z "$branch" ]; then
git log | head -1
else
git checkout $branch
fi
sha=`git rev-list --max-count=1 --abbrev-commit HEAD`
git repack -a -d
cd ..
# append sha to dirname
mv $dirname $dirname-git$sha
dirname=$dirname-git$sha
tarball=$dirname.tar.bz2
tar jcf $tarball $dirname
rm -rf $dirname
echo "$tarball is now available"