From cc40c54f84558cf16e26af461c06bf86f00df474 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 22 Nov 2017 11:26:18 +0100 Subject: bin/common-functions: expand_version/shrink_version: handle epoch --- bin/common-functions | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bin/common-functions') diff --git a/bin/common-functions b/bin/common-functions index 7cb1f90..060f49b 100755 --- a/bin/common-functions +++ b/bin/common-functions @@ -907,7 +907,8 @@ download_sources_by_hash() { } # expand_version $column_num -# add "+0" to version in $colum_num-th column if no "+" is there +# add "0:" to version in $colum_num-th column if no ":" is there (epoch) +# add "+0" to version in $colum_num-th column if no "+" is there (git count/hash) expand_version() { local column_num @@ -915,11 +916,13 @@ expand_version() { sed ' /^\(\S\+\s\+\)\{'"$((column_num-1))"'\}\S*+/! s/^\(\(\S\+\s\+\)\{'"$((column_num-1))"'\}\S*\)-/\1+0-/ + /^\(\S\+\s\+\)\{'"$((column_num-1))"'\}\S*:/! s/^\(\(\S\+\s\+\)\{'"$((column_num-1))"'\}\)/\10:/ ' } # shrink_version $column_num -# remove "+0" from version in $colum_num-th column +# remove "0:" from version in $colum_num-th column (epoch) +# remove "+0" from version in $colum_num-th column (git count/hash) shrink_version() { local column_num @@ -927,6 +930,7 @@ shrink_version() { sed ' s/^\(\(\S\+\s\+\)\{'"$((column_num-1))"'\}\S*\)+0-/\1-/ + s/^\(\(\S\+\s\+\)\{'"$((column_num-1))"'\}\)0:/\1/ ' } -- cgit v1.2.3-70-g09d2