Formatting & comments
This commit is contained in:
parent
93a43e09b7
commit
40dabffacc
1 changed files with 62 additions and 60 deletions
|
|
@ -1,15 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
#Usage: See function usage() at bottom.
|
||||
#
|
||||
#
|
||||
# Create a diaspora distribution
|
||||
#
|
||||
# Builds a diaspora distribution containing the application and bundled
|
||||
# libraries. Normally checks out latest version of the master branch.
|
||||
# Usage: See function usage() at bottom.
|
||||
#
|
||||
GIT_REPO='http://github.com/diaspora/diaspora.git'
|
||||
RELEASE='HEAD'
|
||||
VERSION='0.0'
|
||||
|
||||
function git_id
|
||||
|
|
@ -52,8 +47,9 @@ function git_id
|
|||
|
||||
function fix_alphatag()
|
||||
# Patch version on top comment first id line:
|
||||
# Usage: fix_alphatag <file> <version> <commi_id>
|
||||
#* Fri Sep 24 2010 name surname <email@com> 1.20100925_faf234320
|
||||
# Usage: fix_alphatag <file> <version> <commit_id>
|
||||
# Patches:\
|
||||
# * Fri Sep 24 2010 name surname <email@com> 1.20100925_faf23207
|
||||
{
|
||||
dist=$(rpm --eval %dist)
|
||||
awk -v dist="$dist" -v version="$2" -v release="$3" \
|
||||
|
|
@ -74,8 +70,8 @@ function fix_alphatag()
|
|||
}
|
||||
|
||||
function fix_bundle_deps
|
||||
# usage: fix_bundle_deps <specfile> <version> release
|
||||
# Patches Requires: diaspora-bundle = 0.0-20101021-aefsf323148
|
||||
# usage: fix_bundle_deps <specfile> <version> <release>
|
||||
# Patches: Requires: diaspora-bundle = 0.0-20101021-aefsf323148
|
||||
{
|
||||
awk -v vers="$2-$3" \
|
||||
' /Requires:/ { if ($2 == "diaspora-bundle")
|
||||
|
|
@ -89,7 +85,7 @@ function fix_bundle_deps
|
|||
}
|
||||
|
||||
function patch()
|
||||
# Patch git_release, Requires: diaspora-bundle and top comment version.
|
||||
# Patch spec-files with current version-release
|
||||
# Usage: patch VERSION RELEASE
|
||||
{
|
||||
sed -e "/^%define/s|HEAD|$2|" \
|
||||
|
|
@ -137,6 +133,7 @@ function checkout()
|
|||
|
||||
function make_dist
|
||||
# Create a distribution tarball
|
||||
# Usage: make dist [ commit, defaults to HEAD]
|
||||
{
|
||||
commit=$(checkout ${1:-'HEAD'})
|
||||
echo "Creating source tarball for $commit"
|
||||
|
|
@ -160,6 +157,9 @@ function make_dist
|
|||
}
|
||||
|
||||
function make_bundle()
|
||||
# Create the bundle tarball
|
||||
# Usage: make_bundle [ commit, defaults to HEAD]
|
||||
#
|
||||
{
|
||||
checkout ${1:-'HEAD'} >/dev/null
|
||||
bundle_id=$(git_id dist/diaspora/Gemfile)
|
||||
|
|
@ -176,9 +176,11 @@ function make_bundle()
|
|||
--path="../$bundle_name/bundle" \
|
||||
--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
|
||||
tar czf $bundle_name.tar.gz $bundle_name
|
||||
cd ..
|
||||
}
|
||||
echo
|
||||
echo "Bundle: dist/$bundle_name.tar.gz"
|
||||
|
|
@ -242,7 +244,7 @@ test "$1" = "-c" && {
|
|||
}
|
||||
|
||||
|
||||
case $1 in
|
||||
case $1 in
|
||||
|
||||
"bundle") make_bundle $commit
|
||||
;;
|
||||
|
|
@ -260,7 +262,7 @@ test "$1" = "-c" && {
|
|||
*) usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue