From: Tomi Ollila Date: Sat, 11 Jan 2014 10:46:03 +0000 (+0200) Subject: test: (gnu) tar(1) portability X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f6ce33b83f5d3df65fc5f66e122cd972c4dee207;p=notmuch-archives.git test: (gnu) tar(1) portability --- diff --git a/a6/700ab09e99472c7be85e24d609d31f98aee0d4 b/a6/700ab09e99472c7be85e24d609d31f98aee0d4 new file mode 100644 index 000000000..9cdf44bb3 --- /dev/null +++ b/a6/700ab09e99472c7be85e24d609d31f98aee0d4 @@ -0,0 +1,90 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id DBF86431FC3 + for ; Sat, 11 Jan 2014 02:46:15 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id DH7rZi3hHMdj for ; + Sat, 11 Jan 2014 02:46:09 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 8FBEF431FC0 + for ; Sat, 11 Jan 2014 02:46:09 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id A754C10005E + for ; Sat, 11 Jan 2014 12:46:03 +0200 (EET) +From: Tomi Ollila +To: +Subject: test: (gnu) tar(1) portability +User-Agent: Notmuch/0.17+23~ga575e35 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 11 Jan 2014 10:46:16 -0000 + +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