spec-create: add a "## GITSOURCE" comment when git is used

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2012-04-23 00:18:04 +02:00
parent 36fcfd24d6
commit 4ec7565752
2 changed files with 15 additions and 4 deletions

View File

@ -8,6 +8,10 @@ Wed Apr 18 2012 Davide Madrisan <davide.madrisan(a)gmail.com>
autospec -s git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git \ autospec -s git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git \
-o mcelog.spec -o mcelog.spec
* spec-create - Davide Madrisan:
Add a "## GITSOURCE" comment containing the URL of the git repository.
This information will instruct pck-update on how to update the package.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 1.9.4 Changes in version 1.9.4

View File

@ -234,9 +234,8 @@ function template.expand() {
local OPTIONS=`LC_ALL=C getopt \ local OPTIONS=`LC_ALL=C getopt \
-o t:T:n:v:s:l:S:b: \ -o t:T:n:v:s:l:S:b: \
--long template:,type:,pckname:,pckversion:,setupmacro:,summary:,license:,\ --long template:,type:,pckname:,pckversion:,setupmacro:,summary:,license:,\
source:,standard-docs:,standard-docs-devel:,build-technology:,\ source:,source-comment:,standard-docs:,standard-docs-devel:,\
i18n:,icons-mimetypes:,\ build-technology:,i18n:,icons-mimetypes:,infopages:,manpages:,\
infopages:,manpages:,\
pck-devel:,pck-library:,pck-apidocs:,pck-tools:,\ pck-devel:,pck-library:,pck-apidocs:,pck-tools:,\
shared-libraries:,debug-package:,\ shared-libraries:,debug-package:,\
-n "${0}" -- "$@"` -n "${0}" -- "$@"`
@ -253,6 +252,8 @@ shared-libraries:,debug-package:,\
local spec_setup_macro local spec_setup_macro
local spec_summary="$spec_default_summary" local spec_summary="$spec_default_summary"
local spec_license="$spec_default_license" local spec_license="$spec_default_license"
local spec_source
local spec_source_comment
local standard_docs local standard_docs
local standard_docs_devel local standard_docs_devel
local build_technology local build_technology
@ -287,6 +288,8 @@ shared-libraries:,debug-package:,\
spec_license="$2"; shift ;; spec_license="$2"; shift ;;
-S|--source) -S|--source)
spec_source="$2"; shift ;; spec_source="$2"; shift ;;
--source-comment)
spec_source_comment="$2"; shift ;;
--standard-docs) --standard-docs)
standard_docs="$2"; shift ;; standard_docs="$2"; shift ;;
--standard-docs-devel) --standard-docs-devel)
@ -421,7 +424,8 @@ s,^\(%setup.*\),${spec_setup_macro},
s,\(^[ \t]*Summary[ \t]*:[ \t]*\).*,\1${spec_summary},} s,\(^[ \t]*Summary[ \t]*:[ \t]*\).*,\1${spec_summary},}
/^[ \t]*License[ \t]*:[ \t]*\.\.\.$/{ /^[ \t]*License[ \t]*:[ \t]*\.\.\.$/{
s,\(^[ \t]*License[ \t]*:[ \t]*\).*,\1${spec_license},} s,\(^[ \t]*License[ \t]*:[ \t]*\).*,\1${spec_license},}
s,^\([ \t]*Source[ \t]*:[ \t]*\).*,\1${spec_source}, s,^\([ \t]*Source[ \t]*:[ \t]*\).*,\
${spec_source_comment:+$spec_source_comment\n}\1${spec_source},
s,@make@,$spec_cmd_make, s,@make@,$spec_cmd_make,
s,@makeinstall@,$spec_cmd_makeinstall, s,@makeinstall@,$spec_cmd_makeinstall,
s,@build_tool@,$buildrequires_buildtool, s,@build_tool@,$buildrequires_buildtool,
@ -518,6 +522,7 @@ ${proxy:+--proxy $proxy} ${proxy_user:+--proxy-user $proxy_user} \
an error occurred while creating"": ${pck_tarball}.tar.bz2"; } an error occurred while creating"": ${pck_tarball}.tar.bz2"; }
spec_source="${pck_tarball}.tar.bz2" spec_source="${pck_tarball}.tar.bz2"
spec_source_comment="## GITSOURCE $2"
pck_tarball=$source_dir/${spec_source} pck_tarball=$source_dir/${spec_source}
popd &>/dev/null popd &>/dev/null
@ -531,6 +536,7 @@ an error occurred while creating"": ${pck_tarball}.tar.bz2"; }
esac esac
notify.debug "$FUNCNAME: pck_tarball = $pck_tarball" notify.debug "$FUNCNAME: pck_tarball = $pck_tarball"
notify.debug "$FUNCNAME: spec_source = $spec_source" notify.debug "$FUNCNAME: spec_source = $spec_source"
notify.debug "$FUNCNAME: spec_source_comment = $spec_source_comment"
[ "$pck_tarball" ] || notify.error $"missing tarball name" [ "$pck_tarball" ] || notify.error $"missing tarball name"
@ -879,6 +885,7 @@ $spec_cmd_configure_autotools --enable-gtk-doc"
--summary="$spec_summary" \ --summary="$spec_summary" \
--license "$spec_license" \ --license "$spec_license" \
--source "${spec_preamble_source:-$spec_preamble_tarball}" \ --source "${spec_preamble_source:-$spec_preamble_tarball}" \
--source-comment "$spec_source_comment" \
--standard-docs "$standard_docs" \ --standard-docs "$standard_docs" \
--standard-docs-devel "$standard_docs_devel" \ --standard-docs-devel "$standard_docs_devel" \
--build-technology "$build_techology" \ --build-technology "$build_techology" \