bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rules, rules, and more (code policy) rules


From: Jim Meyering
Subject: Re: rules, rules, and more (code policy) rules
Date: Fri, 10 Feb 2006 18:48:07 +0100

Simon Josefsson <address@hidden> wrote:
> I'm going through Coreutils GNUmakefile and Makefile.maint to identify
> useful rules.  Some question pop up:
>
> 1)
>
> Is this rule generally safe?  Does it assume GNU tar?  Is there a real
> problem solved by this, or is it just "nice"?
>
> # Make tar archive easier to reproduce.
> export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner

Those options help minimize unnecessary differences between tar archives.

> Further, shouldn't automake set this, if it is safe?

They're all gnu-tar-specific.
In Makefile.maint, I've tried to keep things simple, and
independent of automake/autoconf/etc.  However, I do assume
that you (the developer) have GNU tools like tar, grep, and make.

> 2)
>
> The following is not safe, --rsyncable is a new feature.
>
> # Do not save the original name or timestamp in the .tar.gz file.
> GZIP_ENV = '--no-name --best --rsyncable'
>
> Perhaps this, and the previous case, should be moved to a m4 macro, to
> find out whether the parameters are supported or not.  Thoughts?

Rather, how about keeping the tests stand-alone?
For example, here's the change I've just made so that the rule
works even when gzip doesn't support the --rsyncable option:

Index: Makefile.maint
===================================================================
RCS file: /fetish/cu/Makefile.maint,v
retrieving revision 1.226
diff -u -p -r1.226 Makefile.maint
--- Makefile.maint      8 Feb 2006 12:44:36 -0000       1.226
+++ Makefile.maint      10 Feb 2006 17:43:20 -0000
@@ -24,7 +24,9 @@
 ME := Makefile.maint
 
 # Do not save the original name or timestamp in the .tar.gz file.
-GZIP_ENV = '--no-name --best --rsyncable'
+gzip_rsyncable := \
+  $(shell gzip --help|grep rsyncable >/dev/null && echo --rsyncable)
+GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
 
 CVS = cvs
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]