Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH 1/5] build-sys: fix empty package release number
@ 2016-11-17  2:09 Ruediger Meier
  2016-11-17  2:09 ` [PATCH 2/5] build-sys: update package release number during development Ruediger Meier
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Ruediger Meier @ 2016-11-17  2:09 UTC (permalink / raw)
  To: util-linux

From: Ruediger Meier <ruediger.meier@ga-group.nl>

Was broken for major releases since b0e6b25e:
  $ blkid -V
  blkid from util-linux 2.28  (libblkid 2.28., 12-Apr-2016)

Now we also set 0 in this case, like:
  $ blkid -V
  blkid from util-linux 2.30  (libblkid 2.30.0, 12-Apr-2016)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 configure.ac | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1bd7d2e..f3521ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,10 +23,8 @@ dnl version details from <major>.<minor>[-<suffix>]
 PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
 PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}' \
 					      | awk -F- '{print $1}')
-
-PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{print $3}' \
-						| sed 's/.*@<:@^@<:@:digit:@:>@@:>@.*/0/')
-
+PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{
+                                       print $3 ~ /^@<:@[0-9]@:>@+$/ ? $3 : 0}')
 
 dnl libblkid version
 LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
-- 
1.8.5.6


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/5] build-sys: update package release number during development
  2016-11-17  2:09 [PATCH 1/5] build-sys: fix empty package release number Ruediger Meier
@ 2016-11-17  2:09 ` Ruediger Meier
  2016-11-17  2:10 ` [PATCH 3/5] build-sys: cosmetics PACKAGE_VERSION_MINOR Ruediger Meier
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Ruediger Meier @ 2016-11-17  2:09 UTC (permalink / raw)
  To: util-linux

From: Ruediger Meier <ruediger.meier@ga-group.nl>

Now we use
   v2.29-5-g8ffab30  -> 2.29.5-8ffa   (libblkid 2.29.5)
instead of
   v2.29-5-g8ffab30  -> 2.29.5-8ffa   (libblkid 2.29.0)

otherwise the bugfix releases (2.29.1) would look newer that latest HEAD.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index f3521ae..5c32511 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,7 +24,7 @@ PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
 PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}' \
 					      | awk -F- '{print $1}')
 PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{
-                                       print $3 ~ /^@<:@[0-9]@:>@+$/ ? $3 : 0}')
+                     sub("-.*","",$3); print $3 ~ /^@<:@[0-9]@:>@+$/ ? $3 : 0}')
 
 dnl libblkid version
 LIBBLKID_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
-- 
1.8.5.6


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/5] build-sys: cosmetics PACKAGE_VERSION_MINOR
  2016-11-17  2:09 [PATCH 1/5] build-sys: fix empty package release number Ruediger Meier
  2016-11-17  2:09 ` [PATCH 2/5] build-sys: update package release number during development Ruediger Meier
@ 2016-11-17  2:10 ` Ruediger Meier
  2016-11-17  2:10 ` [PATCH 4/5] build-sys: remove old git fallback from git-version-gen Ruediger Meier
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Ruediger Meier @ 2016-11-17  2:10 UTC (permalink / raw)
  To: util-linux

From: Ruediger Meier <ruediger.meier@ga-group.nl>

This should changes nothing.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5c32511..680f7f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,8 +21,8 @@ AC_PREFIX_DEFAULT([/usr])
 
 dnl version details from <major>.<minor>[-<suffix>]
 PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
-PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}' \
-					      | awk -F- '{print $1}')
+PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{
+                                                   sub("-.*","",$2); print $2}')
 PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{
                      sub("-.*","",$3); print $3 ~ /^@<:@[0-9]@:>@+$/ ? $3 : 0}')
 
-- 
1.8.5.6


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/5] build-sys: remove old git fallback from git-version-gen
  2016-11-17  2:09 [PATCH 1/5] build-sys: fix empty package release number Ruediger Meier
  2016-11-17  2:09 ` [PATCH 2/5] build-sys: update package release number during development Ruediger Meier
  2016-11-17  2:10 ` [PATCH 3/5] build-sys: cosmetics PACKAGE_VERSION_MINOR Ruediger Meier
@ 2016-11-17  2:10 ` Ruediger Meier
  2016-11-17  7:22   ` Bernhard Voelker
  2016-11-17  2:10 ` [PATCH 5/5] build-sys: fix "remove the g in git describe" Ruediger Meier
  2016-11-29  9:53 ` [PATCH 1/5] build-sys: fix empty package release number Karel Zak
  4 siblings, 1 reply; 8+ messages in thread
From: Ruediger Meier @ 2016-11-17  2:10 UTC (permalink / raw)
  To: util-linux

From: Ruediger Meier <ruediger.meier@ga-group.nl>

Just make the script more readable. Nobody is using 10 years old
git.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 tools/git-version-gen | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/tools/git-version-gen b/tools/git-version-gen
index 1df20c3..3e431ef 100755
--- a/tools/git-version-gen
+++ b/tools/git-version-gen
@@ -111,27 +111,6 @@ elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
          *) (exit 1) ;;
        esac
 then
-    # Is this a new git that lists number of commits since the last
-    # tag or the previous older version that did not?
-    #   Newer: v6.10-77-g0f8faeb
-    #   Older: v6.10-g0f8faeb
-    case $v in
-        *-rc[0-9]) ;; # release candidate
-        *-*-*) : git describe is okay three part flavor ;;
-        *-*)
-            : git describe is older two part flavor
-            # Recreate the number of commits and rewrite such that the
-            # result is the same as if we were using the newer version
-            # of git describe.
-            vtag=`echo "$v" | sed 's/-.*//'`
-            commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \
-                || { commit_list=failed;
-                     echo "$0: WARNING: git rev-list failed" 1>&2; }
-            numcommits=`echo "$commit_list" | wc -l`
-            v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
-            test "$commit_list" = failed && v=UNKNOWN
-            ;;
-    esac
 
     case $v in
         *-rc[0-9])
-- 
1.8.5.6


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/5] build-sys: fix "remove the g in git describe"
  2016-11-17  2:09 [PATCH 1/5] build-sys: fix empty package release number Ruediger Meier
                   ` (2 preceding siblings ...)
  2016-11-17  2:10 ` [PATCH 4/5] build-sys: remove old git fallback from git-version-gen Ruediger Meier
@ 2016-11-17  2:10 ` Ruediger Meier
  2016-11-29  9:53 ` [PATCH 1/5] build-sys: fix empty package release number Karel Zak
  4 siblings, 0 replies; 8+ messages in thread
From: Ruediger Meier @ 2016-11-17  2:10 UTC (permalink / raw)
  To: util-linux

From: Ruediger Meier <ruediger.meier@ga-group.nl>

The "g" was not always removed and "-rc*" follow-ups were handled
incorrectly.

So now after last commits we have these versions:

 git describe            -> blkid -V
 --------------------------------------------------------------
 v2.29-rc4               -> 2.29-rc4          (libblkid 2.29.0)
 v2.29-rc4-3-g4c8928d    -> 2.29-rc4-3-4c89   (libblkid 2.29.0)

 v2.29                   -> 2.29              (libblkid 2.29.0)
 v2.29-78-g4c8928d       -> 2.29.78-4c89      (libblkid 2.29.78)

 v2.29.1                 -> 2.29.1            (libblkid 2.29.1)
 v2.29.1-4-g4c8928d      -> 2.29.1.4-4c89     (libblkid 2.29.1)

 v2.29.1-rc2             -> 2.29.1-rc2        (libblkid 2.29.1)
 v2.29.1-rc2-3-g4c8928d  -> 2.29.1-rc2-3-4c89 (libblkid 2.29.1)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 tools/git-version-gen | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/git-version-gen b/tools/git-version-gen
index 3e431ef..e7249f9 100755
--- a/tools/git-version-gen
+++ b/tools/git-version-gen
@@ -112,16 +112,16 @@ elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
        esac
 then
 
+    # Remove the "g" in git describe's output string, to save a byte.
+    v=${v/-g/-}
+
     case $v in
-        *-rc[0-9])
-	    # Remove the "g" in git describe's output string, to save a byte.
-            v=`echo "$v" | sed 's/\(.*\)-g/\1-/'`;     
-	    ;;
+        *-rc*)
+            ;;
         *)
-	    # Change the first '-' to a '.', so version-comparing tools work properly.
-	    # Remove the "g" in git describe's output string, to save a byte.
-	    v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
-	    ;;
+            # Change the first '-' to a '.', so version-comparing tools work properly.
+            v=`echo "$v" | sed 's/-/./'`;
+            ;;
     esac
     v_from_git=1
 else
-- 
1.8.5.6


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/5] build-sys: remove old git fallback from git-version-gen
  2016-11-17  2:10 ` [PATCH 4/5] build-sys: remove old git fallback from git-version-gen Ruediger Meier
@ 2016-11-17  7:22   ` Bernhard Voelker
  2016-11-17 10:44     ` Ruediger Meier
  0 siblings, 1 reply; 8+ messages in thread
From: Bernhard Voelker @ 2016-11-17  7:22 UTC (permalink / raw)
  To: Ruediger Meier, util-linux

On 11/17/2016 03:10 AM, Ruediger Meier wrote:
> Just make the script more readable. Nobody is using 10 years old
> git.
> 
> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
> ---
>  tools/git-version-gen | 21 ---------------------
>  1 file changed, 21 deletions(-)

Is there any particular reason not to sync from latest
upstream (again)?

http://g.sv.gnu.org/cgit/gnulib.git/tree/build-aux/git-version-gen

Have a nice day,
Berny


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/5] build-sys: remove old git fallback from git-version-gen
  2016-11-17  7:22   ` Bernhard Voelker
@ 2016-11-17 10:44     ` Ruediger Meier
  0 siblings, 0 replies; 8+ messages in thread
From: Ruediger Meier @ 2016-11-17 10:44 UTC (permalink / raw)
  To: Bernhard Voelker; +Cc: util-linux

On Thursday 17 November 2016, Bernhard Voelker wrote:
> On 11/17/2016 03:10 AM, Ruediger Meier wrote:
> > Just make the script more readable. Nobody is using 10 years old
> > git.
> >
> > Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
> > ---
> >  tools/git-version-gen | 21 ---------------------
> >  1 file changed, 21 deletions(-)
>
> Is there any particular reason not to sync from latest
> upstream (again)?
>
> http://g.sv.gnu.org/cgit/gnulib.git/tree/build-aux/git-version-gen

I only want to fix some cosmetical issues regarding our version numbers. 
Don't want to risk making things worse. This particulary removed 
fallback was probably never used in UL and probably broken since we've 
added our special "-rc* handling.

Regarding gnulib upstream, IMO their git-version-gen is overengineered 
and too complicated. We don't need any of the new 
options --prefix, --fallback, --help or --version.

BTW the real upstream would be
https://github.com/git/git/blob/master/GIT-VERSION-GEN
which is simple to understand and easy to add small project-specific 
changes.


cu,
Rudi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/5] build-sys: fix empty package release number
  2016-11-17  2:09 [PATCH 1/5] build-sys: fix empty package release number Ruediger Meier
                   ` (3 preceding siblings ...)
  2016-11-17  2:10 ` [PATCH 5/5] build-sys: fix "remove the g in git describe" Ruediger Meier
@ 2016-11-29  9:53 ` Karel Zak
  4 siblings, 0 replies; 8+ messages in thread
From: Karel Zak @ 2016-11-29  9:53 UTC (permalink / raw)
  To: Ruediger Meier; +Cc: util-linux

On Thu, Nov 17, 2016 at 03:09:58AM +0100, Ruediger Meier wrote:
> diff --git a/configure.ac b/configure.ac
> index 1bd7d2e..f3521ae 100644

 Applied all 5 patches, thanks.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-11-29  9:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-17  2:09 [PATCH 1/5] build-sys: fix empty package release number Ruediger Meier
2016-11-17  2:09 ` [PATCH 2/5] build-sys: update package release number during development Ruediger Meier
2016-11-17  2:10 ` [PATCH 3/5] build-sys: cosmetics PACKAGE_VERSION_MINOR Ruediger Meier
2016-11-17  2:10 ` [PATCH 4/5] build-sys: remove old git fallback from git-version-gen Ruediger Meier
2016-11-17  7:22   ` Bernhard Voelker
2016-11-17 10:44     ` Ruediger Meier
2016-11-17  2:10 ` [PATCH 5/5] build-sys: fix "remove the g in git describe" Ruediger Meier
2016-11-29  9:53 ` [PATCH 1/5] build-sys: fix empty package release number Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox