Skip to content

Commit

Permalink
build: allow for being consumed in a (non-endorsed) form of snapshots
Browse files Browse the repository at this point in the history
This is meant as a lean, customized policy driven alternative
to the original proposal by Jan Friesse <jfriesse@redhat.com> that
balances the inherent trade-off in the opposite direction, so that the
configure.ac script is practically untouched and more weight and policy
is hardcoded in git-version-gen.  Problem with that approach stems from
(avoidable) effective fork of the respective gnulib's module and imposed
maintenance burden.

Speaking for libqb in particular, we should nonetheless make it
absolutely clear such in-development snapshots are nothing more,
nothing binding (not to think of viral injection of these bits
into circle of dependent packages upon their rebuilds), since the
changes accumulated since the last official release should only be
assumed firmly committed at the point the new release is cut (may
happen 99% of time with snapshots but no accountability from our
side for the complementary inter-release twists...), which is exactly
when many possibly unanticipated variables like correct SONAME
versions get to reflect what's appropriate.
Also, OpenPGP signature constitutes something more eligible for
one's trust than (provably) bit/content unstable archives without
the possibility of an independent authenticity/integrity verification.

  Therefore, the only thinkable and upstream-endorsed use cases
  for such snapshots are development-only purposes (CI et al.)!

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
  • Loading branch information
jnpkrn committed Sep 6, 2018
1 parent 3af6104 commit bcd65f0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/configure.ac export-subst
18 changes: 13 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,32 @@ autom4te.cache/
config.status
configure
conftest.*
.libs

# since we use subdir-objects as automake option
.dirstamp

# dotfiles

.*
# - subsumed:
# .dirstamp (since we use subdir-objects as automake option)
# .libs
# .{,snapshot-,tarball-}version
# - sans:
!.git*
!/.tito
!/.travis.yml


# ignore "libtoolized" m4 files, but keep our (custom-prefixed) ones
/m4/*
!/m4/ax_*.m4

# build-aux/release.mk related litter
/.tarball-version
/tag-*

/lib/qblog_script.ld
# already captured with wildcard: /lib/qblog_script.la

libtool
.version
libqb.spec
libqb-*
cov
Expand Down
7 changes: 6 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ doxygen:
$(MAKE) -C docs doxygen

dist-clean-local:
rm -f autoconf automake autoheader
rm -f .snapshot-version autoconf automake autoheader

# this will also get rid of "libtoolized" m4 files
maintainer-clean-local:
Expand Down Expand Up @@ -128,8 +128,13 @@ BUILT_SOURCES = .version
.version:
echo $(VERSION) > $@-t && mv $@-t $@

# also untaint configure.ac when modified upon obtaining the snapshot form
dist-hook: gen-ChangeLog
echo $(VERSION) > $(distdir)/.tarball-version
sed "s/\(.*git-version-gen[^']*[']\)[^']*/\1\$$Format:%h!%D\$$/" \
$(distdir)/configure.ac > $(distdir)/configure.ac-t
touch -r $(distdir)/configure.ac $(distdir)/configure.ac-t
mv $(distdir)/configure.ac-t $(distdir)/configure.ac

gen_start_date = 2000-01-01
.PHONY: gen-ChangeLog
Expand Down
6 changes: 5 additions & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
autoreconf -i -v && echo Now run ./configure and make
autoreconf -i -v \
&& { test -s .snapshot-version \
&& echo 'USE SNAPSHOT ONLY AT YOUR RISK (official release recommended)' \
|| :; } \
&& echo Now run ./configure and make
12 changes: 9 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@

AC_PREREQ([2.61])

dnl inject zero as a "patch" component of the version if missing in tag
dnl inject zero as a "patch" component of the version if missing in tag;
dnl care to bump X.Y.Z-g* version below with each point release very desirable
AC_INIT([libqb],
m4_esyscmd([build-aux/git-version-gen .tarball-version \
's|^\(v[0-9][0-9]*\.[0-9][0-9]*\)\([^.].*\)\?$|\1.0\2|']),
m4_esyscmd([build-aux/git-version-gen $(echo '$Format:%h!%D$' \
| sed -ne 's/[$]Format:%h!%D[$]/.tarball-version/p;tend' \
-e 's/.*tag: v\([^, ][^, ]*\).*/\1/;tv' \
-e 's/^\([[:xdigit:]][[:xdigit:]]*\).*/1.0.3-g\1/' \
-e ':v;w .snapshot-version' -e 'i .snapshot-version' \
-e ':end;q') \
's/^\(v[0-9][0-9]*\.[0-9][0-9]*\)\([^.].*\)\?$/\1.0\2/']),
[developers@clusterlabs.org])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([lib/ringbuffer.c])
Expand Down

0 comments on commit bcd65f0

Please sign in to comment.