unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* test: (gnu) tar(1) portability
@ 2014-01-11 10:46 Tomi Ollila
  2014-01-11 16:04 ` David Bremner
  0 siblings, 1 reply; 3+ messages in thread
From: Tomi Ollila @ 2014-01-11 10:46 UTC (permalink / raw)
  To: notmuch

Hi

Currently performance-test requires GNU tar and the uprgrade test
in progress will (in it's current form) require it too.

From portability point of view these tests will work only on Linux
by default -- BSD/Mac OS X have libarchive based tar(1) and other
systems something less capable (no -z option, for example).

From the test point of view we can expect people to install GNU tar
(somewhere) in for their systems but should we provide less "intrusive"
way for having the GNU tar available.

Options:

1) Do nothing, and expect testers to have GNU tar in PATH available
   before any other tar. For example /usr/local/bin/tar could be GNU tar
   and that is put before /bin:/usr/bin in path.

2) Change calls to 'tar' to format ${GNU_TAR:-tar} so testers can set 
   environment variable GNU_TAR to the name/path of gnu tar when running
   tests (like GNU_TAR=/usr/local/bin/gtar make test or GNU_TAR=gtar ...)

3) Check whether 'gtar' is in system and use that. if not use tar:

   # opportunistically check whether 'gtar' is in system and use that if it is
   if hash gtar >/dev/null
   then TAR=gtar
   else TAR=tar
   fi

   and then replate tar with ${TAR} ($ & {} to emphasize the variable usage)
   in the test code.

   Interestingly Fedora 20 installs both /usr/bin/gtar & /usr/bin/tar.
   In one wheezy system I saw only tar. I tried to JFGI 'gnu tar installation'
   but I could not find references to 'gtar' there.

If installing gtar is widespread I'd use option 3. If not, option 2.
It may be that we end up using option 1 ;/

Tomi

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

* Re: test: (gnu) tar(1) portability
  2014-01-11 10:46 test: (gnu) tar(1) portability Tomi Ollila
@ 2014-01-11 16:04 ` David Bremner
  2014-01-19 13:58   ` Tomi Ollila
  0 siblings, 1 reply; 3+ messages in thread
From: David Bremner @ 2014-01-11 16:04 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:
>
> 2) Change calls to 'tar' to format ${GNU_TAR:-tar} so testers can set 
>    environment variable GNU_TAR to the name/path of gnu tar when running
>    tests (like GNU_TAR=/usr/local/bin/gtar make test or GNU_TAR=gtar ...)

I don't really see any downside to this option; there's only a few calls
to tar to replace.  Of course we could bikeshed about whether to write 

TAR=${GNU_TAR:-tar}
...

${TAR} --frub --blah 

instead of testing GNU_TAR everywhere.

But, shrug...

d

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

* Re: test: (gnu) tar(1) portability
  2014-01-11 16:04 ` David Bremner
@ 2014-01-19 13:58   ` Tomi Ollila
  0 siblings, 0 replies; 3+ messages in thread
From: Tomi Ollila @ 2014-01-19 13:58 UTC (permalink / raw)
  To: David Bremner, notmuch

On Sat, Jan 11 2014, David Bremner <david@tethera.net> wrote:

> Tomi Ollila <tomi.ollila@iki.fi> writes:
>>
>> 2) Change calls to 'tar' to format ${GNU_TAR:-tar} so testers can set 
>>    environment variable GNU_TAR to the name/path of gnu tar when running
>>    tests (like GNU_TAR=/usr/local/bin/gtar make test or GNU_TAR=gtar ...)
>
> I don't really see any downside to this option; there's only a few calls
> to tar to replace.  Of course we could bikeshed about whether to write 
>
> TAR=${GNU_TAR:-tar}
> ...
>
> ${TAR} --frub --blah 
>
> instead of testing GNU_TAR everywhere.

I also thought of this option, exactly in the same format, too.. 

>
> But, shrug...

Yes... 

and this leads to probably more problematic issue: Mac OS X has
bash version 3 -- which cannot be used to run test scripts. For
that we'd also need a variabe (and some test script trickiness).

This bash issue is easier to solve by tuning the PATH instead of
introducing another variable (or check for 'bash4' existence (ehhe;))
There for we could (that's probably me, then ;/) just document that
in test/README Prerequisites section..

>
> d

Tomi

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

end of thread, other threads:[~2014-01-19 13:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-11 10:46 test: (gnu) tar(1) portability Tomi Ollila
2014-01-11 16:04 ` David Bremner
2014-01-19 13:58   ` Tomi Ollila

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).