diff --git a/lib/libnetwork.lib.in b/lib/libnetwork.lib.in index f1794f9..332da6b 100644 --- a/lib/libnetwork.lib.in +++ b/lib/libnetwork.lib.in @@ -947,6 +947,7 @@ function git.create_tarball() { # see: http://bardofschool.blogspot.fr/2008/11/use-git-behind-proxy.html local proxy proxy_user local git_branch + local git_commit local preserve_dot_git=0 local pck_version @@ -963,7 +964,14 @@ function git.create_tarball() { ;; --git-branch) git_branch="$2"; shift + if [ "${git_branch/@*}" != "${git_branch}" ]; then + git_commit="${git_branch/*@}" + git_branch="${git_branch/@*}" + fi notify.debug "$FUNCNAME: git_branch = \"$git_branch\"" + if [ "${git_commit}" ]; then + notify.debug "$FUNCNAME: git_commit = \"$git_commit\"" + fi ;; --preserve-dot-git) preserve_dot_git="$2"; shift @@ -1016,7 +1024,7 @@ not the expected package version"" (${NOTE}${today}git${NORM})..." notify.note \ "${NOTE}"$"cloning git repository""\ <$git_repository> ${git_branch:+($git_branch)}${NORM}""..." - if [ "$preserve_dot_git" = "0" -a "${git_repository:0:4}" != "http" ]; then + if [ "$preserve_dot_git" = "0" -a "${git_repository:0:4}" != "http" -a ! "${git_commit}" ]; then notify.debug "$FUNCNAME: git clone --recursive --depth=1 ${git_branch:+-b $git_branch} \"$git_repository\"" git clone --recursive --depth=1 ${git_branch:+-b $git_branch} "$git_repository" else @@ -1030,6 +1038,12 @@ not the expected package version"" (${NOTE}${today}git${NORM})..." pck_tarball="$(find -mindepth 1 -maxdepth 1 -type d -printf "%f")" + if [ "${git_commit}" ]; then + cd ${pck_tarball} + git checkout ${git_commit} + cd .. + fi + if [ "$preserve_dot_git" = "0" ]; then # remove git files rm -fr $pck_tarball/.git diff --git a/plugins/spec-create.in b/plugins/spec-create.in index 91ac813..d84a521 100644 --- a/plugins/spec-create.in +++ b/plugins/spec-create.in @@ -124,7 +124,7 @@ function usage() { "$"Override packager full name"" --packager-email "$"Override packager email"" - --git-branch "$"Specify a git branch"" + --git-branch "$"Specify a git branch or tag and (optionally) a commit by appending @commit_id"" --preserve-dot-git "$"Do not remove git files"" --colors "$"Select the theme to be used for the colorized output"" -C, --config "$"Use an alternate user configuration file"" "" diff --git a/po/it/autospec.po b/po/it/autospec.po index f4bfe9b..6474ee3 100644 --- a/po/it/autospec.po +++ b/po/it/autospec.po @@ -862,8 +862,8 @@ msgstr "specfile per applicazioni web" msgid "Redirect the output to the file " msgstr "Redirige lo standard output sul file " -msgid "Specify a git branch" -msgstr "Specifica un branch git" +msgid "Specify a git branch or tag and (optionally) a commit by appending @commit_id" +msgstr "Specifica un branch o un tag git e (opzionalmente) un commit aggiungendo @commit_id" msgid "Do not remove git files" msgstr "Non rimuove i file git"