@ -197,6 +197,7 @@ if [ "${bool_BUILD_FROM_PATH}" = "y" ]; then
else
else
MOD_NAME = ` basename " ${ MOD_PATH } " `
MOD_NAME = ` basename " ${ MOD_PATH } " `
fi
fi
echo " ${ MOD_NAME } "
if [ " ${ MOD_NAME } " != "" -a " ${ MOD_NAME } " != "tde" -a " ${ MOD_NAME } " != ".git" ] ; then
if [ " ${ MOD_NAME } " != "" -a " ${ MOD_NAME } " != "tde" -a " ${ MOD_NAME } " != ".git" ] ; then
# Valid git module
# Valid git module
if [ [ " ${ MOD_PATH } " = ~ ${ TDE_BUILD_DIR } ] ] ; then
if [ [ " ${ MOD_PATH } " = ~ ${ TDE_BUILD_DIR } ] ] ; then
@ -309,6 +310,31 @@ if [ -d "$MOD_BUILD_PATH" ]; then
$SUDO_CMD rm *.deb *.dsc *.changes *.tar.bz2 *.tar.gz *.tar.xz *.log *.buildinfo & >/dev/null
$SUDO_CMD rm *.deb *.dsc *.changes *.tar.bz2 *.tar.gz *.tar.xz *.log *.buildinfo & >/dev/null
fi
fi
# calculate package version, if needed
if [ " $bool_EXTRADEP_MOD " != "y" ] ; then
cd $MOD_GIT_PATH
branch = ` git symbolic-ref -q HEAD | sed "s|^refs/heads/||" `
if [ [ -z " $branch " ] ] ; then
branch = ` git branch --contains HEAD | egrep -v "no branch|detached" | head -n1 | cut -c 3-`
fi
target_tag = ` git tag | grep -F " $TDE_RELEASE " | head -n1`
tag = ` git tag | \
sed "s|^\([^0-9]\)|\1.|" | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr -k 4,4nr -k 5,5nr | sed "s|^\([^0-9]\)\.|\1|" | \
while read t; do \
git branch --contains $t | cut -c 3- | grep -x " $branch " >/dev/null && \
echo " $t ..HEAD " && break; done `
count = ` git log $tag --pretty= oneline | wc -l`
pkgver = $TDE_RELEASE
if [ [ " $count " -gt 0 ] ] || [ [ -z " $target_tag " ] ] ; then
pkgver = $pkgver ~pre$count +$( git rev-parse HEAD | cut -c 1-8)
fi
MOD_BRANCH = ` git symbolic-ref -q HEAD | sed "s|^refs/heads/||" `
if [ [ -z " $MOD_BRANCH " ] ] ; then
MOD_BRANCH = ` git branch --contains HEAD | egrep -v "no branch|detached" | head -n1 | cut -c 3-`
fi
COMMIT_HASH = ` git rev-parse HEAD`
fi
# copy main repo source files, if needed
# copy main repo source files, if needed
if [ " $bool_COPY_MOD_SRC " = "y" ] ; then
if [ " $bool_COPY_MOD_SRC " = "y" ] ; then
bool_COPY_PKGING_FILES = "y"
bool_COPY_PKGING_FILES = "y"
@ -319,12 +345,7 @@ if [ "$bool_COPY_MOD_SRC" = "y" ]; then
# Add GIT information
# Add GIT information
echo "# TDE SCM module information" > " $MOD_BUILD_PATH /.tdescminfo "
echo "# TDE SCM module information" > " $MOD_BUILD_PATH /.tdescminfo "
echo " Name: $MOD_NAME " >> " $MOD_BUILD_PATH /.tdescminfo "
echo " Name: $MOD_NAME " >> " $MOD_BUILD_PATH /.tdescminfo "
cd " $MOD_GIT_PATH "
echo " Version: R $pkgver " >> " $MOD_BUILD_PATH /.tdescminfo "
MOD_BRANCH = ` git symbolic-ref -q HEAD | sed "s|^refs/heads/||" `
if [ [ -z " $MOD_BRANCH " ] ] ; then
MOD_BRANCH = ` git branch --contains HEAD | egrep -v "no branch|detached" | head -n1 | cut -c 3-`
fi
COMMIT_HASH = ` git rev-parse HEAD`
echo " Revision: $MOD_BRANCH - $COMMIT_HASH " >> " $MOD_BUILD_PATH /.tdescminfo "
echo " Revision: $MOD_BRANCH - $COMMIT_HASH " >> " $MOD_BUILD_PATH /.tdescminfo "
git log -1 --pretty= format:"DateTime: %cd%n" --date= format:"%m/%d/%Y %H:%M" >> " $MOD_BUILD_PATH /.tdescminfo "
git log -1 --pretty= format:"DateTime: %cd%n" --date= format:"%m/%d/%Y %H:%M" >> " $MOD_BUILD_PATH /.tdescminfo "
else
else
@ -355,23 +376,7 @@ if [ "$bool_EXTRADEP_MOD" != "y" -a "$bool_COPY_PKGING_FILES" = "y" ]; then
cp -R " $MOD_GIT_PKGING_PATH " " $MOD_BUILD_PKGING_PATH "
cp -R " $MOD_GIT_PKGING_PATH " " $MOD_BUILD_PKGING_PATH "
# Default package name
# Default package name
# Calculate package version
package = $( basename $PWD ) -trinity-$pkgver
cd $MOD_GIT_PATH
branch = ` git symbolic-ref -q HEAD | sed "s|^refs/heads/||" `
if [ [ -z " $branch " ] ] ; then
branch = ` git branch --contains HEAD | egrep -v "no branch|detached" | head -n1 | cut -c 3-`
fi
target_tag = ` git tag | grep -F " $TDE_RELEASE " | head -n1`
tag = ` git tag | \
sed "s|^\([^0-9]\)|\1.|" | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr -k 4,4nr -k 5,5nr | sed "s|^\([^0-9]\)\.|\1|" | \
while read t; do \
git branch --contains $t | cut -c 3- | grep -x " $branch " >/dev/null && \
echo " $t ..HEAD " && break; done `
count = ` git log $tag --pretty= oneline | wc -l`
package = $( basename $PWD ) -trinity-$TDE_RELEASE
if [ [ " $count " -gt 0 ] ] || [ [ -z " $target_tag " ] ] ; then
package = $package ~pre$count +$( git rev-parse HEAD | cut -c 1-8)
fi
REL = 4:$TDE_RELEASE ${ package #* $TDE_RELEASE }
REL = 4:$TDE_RELEASE ${ package #* $TDE_RELEASE }
REL = ${ REL %+* }
REL = ${ REL %+* }
REL = ${ REL /4 : 14 .0.0/4 : 14 .0.0-s }
REL = ${ REL /4 : 14 .0.0/4 : 14 .0.0-s }