Formatting & comments

This commit is contained in:
Alec Leamas 2010-10-08 12:15:30 +02:00
parent 93a43e09b7
commit 40dabffacc

View file

@ -1,15 +1,10 @@
#!/bin/bash #!/bin/bash
#Usage: See function usage() at bottom.
#
#
# Create a diaspora distribution # Create a diaspora distribution
# #
# Builds a diaspora distribution containing the application and bundled # Usage: See function usage() at bottom.
# libraries. Normally checks out latest version of the master branch.
# #
GIT_REPO='http://github.com/diaspora/diaspora.git' GIT_REPO='http://github.com/diaspora/diaspora.git'
RELEASE='HEAD'
VERSION='0.0' VERSION='0.0'
function git_id function git_id
@ -52,8 +47,9 @@ function git_id
function fix_alphatag() function fix_alphatag()
# Patch version on top comment first id line: # Patch version on top comment first id line:
# Usage: fix_alphatag <file> <version> <commi_id> # Usage: fix_alphatag <file> <version> <commit_id>
#* Fri Sep 24 2010 name surname <email@com> 1.20100925_faf234320 # Patches:\
# * Fri Sep 24 2010 name surname <email@com> 1.20100925_faf23207
{ {
dist=$(rpm --eval %dist) dist=$(rpm --eval %dist)
awk -v dist="$dist" -v version="$2" -v release="$3" \ awk -v dist="$dist" -v version="$2" -v release="$3" \
@ -74,8 +70,8 @@ function fix_alphatag()
} }
function fix_bundle_deps function fix_bundle_deps
# usage: fix_bundle_deps <specfile> <version> release # usage: fix_bundle_deps <specfile> <version> <release>
# Patches Requires: diaspora-bundle = 0.0-20101021-aefsf323148 # Patches: Requires: diaspora-bundle = 0.0-20101021-aefsf323148
{ {
awk -v vers="$2-$3" \ awk -v vers="$2-$3" \
' /Requires:/ { if ($2 == "diaspora-bundle") ' /Requires:/ { if ($2 == "diaspora-bundle")
@ -89,7 +85,7 @@ function fix_bundle_deps
} }
function patch() function patch()
# Patch git_release, Requires: diaspora-bundle and top comment version. # Patch spec-files with current version-release
# Usage: patch VERSION RELEASE # Usage: patch VERSION RELEASE
{ {
sed -e "/^%define/s|HEAD|$2|" \ sed -e "/^%define/s|HEAD|$2|" \
@ -137,6 +133,7 @@ function checkout()
function make_dist function make_dist
# Create a distribution tarball # Create a distribution tarball
# Usage: make dist [ commit, defaults to HEAD]
{ {
commit=$(checkout ${1:-'HEAD'}) commit=$(checkout ${1:-'HEAD'})
echo "Creating source tarball for $commit" echo "Creating source tarball for $commit"
@ -160,6 +157,9 @@ function make_dist
} }
function make_bundle() function make_bundle()
# Create the bundle tarball
# Usage: make_bundle [ commit, defaults to HEAD]
#
{ {
checkout ${1:-'HEAD'} >/dev/null checkout ${1:-'HEAD'} >/dev/null
bundle_id=$(git_id dist/diaspora/Gemfile) bundle_id=$(git_id dist/diaspora/Gemfile)
@ -176,9 +176,11 @@ function make_bundle()
--path="../$bundle_name/bundle" \ --path="../$bundle_name/bundle" \
--without=test rdoc --without=test rdoc
cp -ar AUTHORS Gemfile GNU-AGPL-3.0 COPYRIGHT "../$bundle_name" cp -ar AUTHORS Gemfile GNU-AGPL-3.0 COPYRIGHT \
"../$bundle_name"
popd popd
tar czf $bundle_name.tar.gz $bundle_name tar czf $bundle_name.tar.gz $bundle_name
cd ..
} }
echo echo
echo "Bundle: dist/$bundle_name.tar.gz" echo "Bundle: dist/$bundle_name.tar.gz"