[bug#70380,v4,2/6] maint: Support `make doc-po-update' from tarball.
Commit Message
* build-aux/xgettext.scm: Move setting of environment variables to shell
header.
(main): Use SOURCE_DATE_EPOCH as fallback for timestamp. This fixes running
from a tarball.
* Makefile.am (EXTRA_DIST): Add it.
Change-Id: Ic487587b22495868fd2a21545a13dc9e3458299c
---
Makefile.am | 1 +
build-aux/xgettext.scm | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
Comments
Hi Jan. There is a typo in the 2/6 top commit message, where `make
doc-po-update' must be `make doc-pot-update' with a t. Which I believe
is also what you meant when in your non-patch V4 0/6 response, you spoke
of update-po.
Also yet one more problem (perhaps) I’ve discovered that “info
doc/guix.info” now says:
This document describes GNU Guix version , a functional package
The version number is missing, but the official 1.4.0 tarball’s
doc/guix.info says:
This document describes GNU Guix version 1.4.0, a functional package
Could you fix this, too? Or do I make a mistake and would a real
release display properly?
Otherwise, all LGTM now and again, thank you!
Regards,
Florian
pelzflorian (Florian Pelz) writes:
Hi Florian,
> Hi Jan. There is a typo in the 2/6 top commit message, where `make
> doc-po-update' must be `make doc-pot-update' with a t.
Thanks, fixed.
> Which I believe is also what you meant when in your non-patch V4 0/6
> response, you spoke of update-po.
In V4 0/6 I was thinking about make -C po/{guix,packages} update-po,
but yeah. Same difference I guess ;)
> Also yet one more problem (perhaps) I’ve discovered that “info
> doc/guix.info” now says:
>
> This document describes GNU Guix version , a functional package
[..]
> Could you fix this, too? Or do I make a mistake and would a real
> release display properly?
If you can help me reproduce this problem, sure. I tried several things
but haven't been able to reproduce it yet. Every time I get
--8<---------------cut here---------------start------------->8---
This document describes GNU Guix version 1.3.0.58022-1d8520, a
functional package management tool written for the GNU system.
--8<---------------cut here---------------end--------------->8---
What recipe did you use? I'm probably doing the same thing to test and
might well be missing something.
> Otherwise, all LGTM now and again, thank you!
Yay!
Greetings,
Janneke
Hi,
Janneke Nieuwenhuizen <janneke@gnu.org> writes:
> pelzflorian (Florian Pelz) writes:
>> Also yet one more problem (perhaps) I’ve discovered that “info
>> doc/guix.info” now says:
>>
>> This document describes GNU Guix version , a functional package
> [..]
>> Could you fix this, too? Or do I make a mistake and would a real
>> release display properly?
>
> If you can help me reproduce this problem, sure. I tried several things
> but haven't been able to reproduce it yet. Every time I get
>
> This document describes GNU Guix version 1.3.0.58022-1d8520, a
> functional package management tool written for the GNU system.
>
> What recipe did you use? I'm probably doing the same thing to test and
> might well be missing something.
From a “make dist”-generated tarball, I ran “./bootstrap”, “./configure
--sysconfdir=/etc --localstatedir=/var” and “make”.
From the 1.4.0 source tarball, this leads to “info doc/guix.info”
displaying 1.4.0, but not from a “make dist”-generated tarball.
Thank you for trying reproducing the error.
Regards,
Florian
pelzflorian (Florian Pelz) writes:
Hi Florian,
> Janneke Nieuwenhuizen <janneke@gnu.org> writes:
>> pelzflorian (Florian Pelz) writes:
>>> Also yet one more problem (perhaps) I’ve discovered that “info
>>> doc/guix.info” now says:
[..]
>> What recipe did you use? I'm probably doing the same thing to test and
>> might well be missing something.
>
> From a “make dist”-generated tarball, I ran “./bootstrap”, “./configure
> --sysconfdir=/etc --localstatedir=/var” and “make”.
Ah! I said before that `git-version-gen' was broken when not run from a
tarball...but it turns out to work fine...as long as you distribute it ;)
I've added a patch to distribute it and that also fixes all the
--8<---------------cut here---------------start------------->8---
sh: line 1: build-aux/git-version-gen: No such file or directory
--8<---------------cut here---------------end--------------->8---
noise.
> From the 1.4.0 source tarball, this leads to “info doc/guix.info”
> displaying 1.4.0, but not from a “make dist”-generated tarball.
Yeah, I can see that now. AFAICS that was more of a "happy
coincidence". We didn't distribute git-version-gen, so after running
./bootstrap, also in the 1.4.0 tarball, ./configure has
--8<---------------cut here---------------start------------->8---
# Define the identity of the package.
PACKAGE='guix'
VERSION=''
--8<---------------cut here---------------end--------------->8---
I cannot say that I completely understand why in 1.4.0 guix.info still
has a non-empty version after running make. It must have something to
do with timestamp or dependency magic causing doc/version.texi not to be
regerenated, even after running ./bootstrap (although it depends on
configure
--8<---------------cut here---------------start------------->8---
$(srcdir)/doc/version.texi: $(srcdir)/doc/stamp-vti
$(srcdir)/doc/stamp-vti: doc/guix.texi $(top_srcdir)/configure
--8<---------------cut here---------------end--------------->8---
which we just regenerated. Oh well, we have a proper fix now.
Thanks a lot for your reviews!
Pushed to master as ba52975ea91af49e8e6a436438a578589a209ecc
Greetings,
Janneke
@@ -727,6 +727,7 @@ EXTRA_DIST += \
build-aux/test-driver.scm \
build-aux/update-NEWS.scm \
build-aux/update-guix-package.scm \
+ build-aux/xgettext.scm \
doc/build.scm \
etc/disarchive-manifest.scm \
etc/guix-install.sh \
@@ -2,6 +2,8 @@
# -*-scheme-*-
build_aux=$(dirname $0)
srcdir=$build_aux/..
+export LC_ALL=en_US.UTF-8
+export TZ=UTC0
exec guile --no-auto-compile -L $srcdir -C $srcdir -e main -s "$0" "$@"
!#
@@ -59,9 +61,6 @@ (define (pipe-command command)
;;; Entry point.
;;;
(define (main args)
- ;; Cater for being run in a container.
- (setenv "LC_ALL" "en_US.UTF-8")
- (setenv "TZ" "UTC0")
(fluid-set! %default-port-encoding #f)
(let* ((files-from (get-option args "--files-from="))
(default-domain (get-option args "--default-domain="))
@@ -82,9 +81,10 @@ (define (main args)
(files (map (cute string-append directory "/" <>) files))
(git-command `("git" "log" "--pretty=format:%ci" "-n1" ,@files))
(timestamp (pipe-command git-command))
+ (source-date-epoch (or (getenv "SOURCE_DATE_EPOCH") "1"))
+ (timestamp (if (string-null? timestamp) source-date-epoch
+ timestamp))
(po-file (string-append default-domain ".po")))
- (when (string-null? timestamp)
- (exit 1))
(substitute* po-file
(("(\"POT-Creation-Date: )[^\\]*" all header)
(string-append header timestamp)))))))