git status|grep "modified">/dev/null 2>&1 &&echo "Warning: Uncommited local changes found. Sending local changes to build remotely. "
-# Get project name from git url
-git_url=`git config remote.origin.url`
-echo $git_url|grep ^ssh > /dev/null
-if [ $? == 0 ]; then
- prj_name=`basename $git_url`
-else
- prj_name=$(echo $git_url|cut -d ':' -f2)
+# If project name is set in gitbuildsystem.project, use it, else use the default remote.origin.url
+prj_name=$(git config gitbuildsystem.project)
+if [ -z "$prj_name" ]; then
+
+ git_url=`git config remote.origin.url`
+ echo $git_url|grep ^ssh > /dev/null
+ if [ $? == 0 ]; then
+ prj_name=$(echo $git_url|sed 's/ssh\:.*\:[0-9]*\/\(.*\)/\1/')
+ else
+ prj_name=$(echo $git_url|cut -d ':' -f2)
+ fi
+
fi
+[ -z "$prj_name" ] && die "Can't find the project name, you might need 'git config --add gitbuildsystem.project <project-name>' to set it."
+
# tar the local changes
tar jcf package.tar.bz2 `git ls-files`
source_tarball_name=$(basename $source_tarball)
if [ -z "$target_project" ]; then
-# Get project name from git url
- git_url=`git config remote.origin.url`
- echo $git_url|grep ^ssh > /dev/null
- if [ $? == 0 ]; then
- target_project=`basename $git_url`
- else
- target_project=$(echo $git_url|cut -d ':' -f2)
+ # If project name is set in gitbuildsystem.project, use it, else use the default remote.origin.url
+ target_project=$(git config gitbuildsystem.project)
+ if [ -z "$target_project" ]; then
+ git_url=`git config remote.origin.url`
+ echo $git_url|grep ^ssh > /dev/null
+ if [ $? == 0 ]; then
+ target_project=$(echo $git_url|sed 's/ssh\:.*\:[0-9]*\/\(.*\)/\1/')
+ else
+ target_project=$(echo $git_url|cut -d ':' -f2)
+ fi
fi
fi
passwd=$(gbs cfg passwd)
HUDSON_SERVER=$(gbs cfg src_server)
-git_url=`git config remote.origin.url`
-echo $git_url|grep ^ssh > /dev/null
-if [ $? == 0 ]; then
- project=`basename $git_url`
-else
- project=$(echo $git_url|cut -d ':' -f2)
+# If project name is set in gitbuildsystem.project, use it, else use the default remote.origin.url
+project=$(git config gitbuildsystem.project)
+if [ -z "$project" ]; then
+
+ git_url=`git config remote.origin.url`
+ echo $git_url|grep ^ssh > /dev/null
+ if [ $? == 0 ]; then
+ project=$(echo $git_url|sed 's/ssh\:.*\:[0-9]*\/\(.*\)/\1/')
+ else
+ project=$(echo $git_url|cut -d ':' -f2)
+ fi
+
fi
+[ -z "$project" ] && die "Can't find the project name, you might need 'git config --add gitbuildsystem.project <project-name>' to set it."
+
info_msg "Packaging for major release ${tag}"
srctar_md5sum=""
get_srctar_md5sum $version $project $commitid