Index | Thread | Search

From:
Caspar Schutijser <caspar@schutijser.com>
Subject:
Re: Change pax(1) default write format
To:
Jeremie Courreges-Anglas <jca@wxcvbn.org>
Cc:
tech@openbsd.org, millert@openbsd.org
Date:
Mon, 15 Apr 2024 19:34:16 +0200

Download raw body.

Thread
  • Todd C. Miller:

    Change pax(1) default write format

  • Caspar Schutijser:

    Change pax(1) default write format

  • On Mon, Apr 15, 2024 at 06:19:05PM +0200, Jeremie Courreges-Anglas wrote:
    > From 'ustar' to 'pax'.
    > 
    > Since by default most files get an extended header for atime and
    > mtime, the size of archives increases with lots of small files.  But
    > it gets much better after compression:
    > 
    > pbuild /tmp$ ls -lh /tmp/ports.*
    > -rw-r--r--  1 jca  wheel   988M Apr 15 17:46 /tmp/ports.pax
    > -rw-r--r--  1 jca  wheel   806M Apr 15 17:46 /tmp/ports.tar
    > pbuild /tmp$ gzip -9 ports.pax ports.tar
    > pbuild /tmp$ ls -lh /tmp/ports.*
    > -rw-r--r--  1 jca  wheel   355M Apr 15 17:46 /tmp/ports.pax.gz
    > -rw-r--r--  1 jca  wheel   350M Apr 15 17:46 /tmp/ports.tar.gz
    > 
    > install sets for amd64 grow by 1.8MB which isn't much either.
    > 
    > I suspect we'll end up doing the same for tar(1), but for that tool
    > I'd like to give people options to opt out first.
    > 
    > ok?
    > 
    > 
    > Index: options.c
    > ===================================================================
    > RCS file: /cvs/src/bin/pax/options.c,v
    > diff -u -p -r1.107 options.c
    > --- options.c	9 Dec 2023 23:00:11 -0000	1.107
    > +++ options.c	15 Apr 2024 11:51:24 -0000
    > @@ -238,7 +238,11 @@ FSUB fsub[] = {
    >  #define	F_CPIO	3	/* format when called as cpio */
    >  #define F_OTAR	4	/* format when called as tar -o */
    >  #define F_TAR	5	/* format when called as tar */
    > -#define DEFLT	5	/* default write format from list above */
    > +#ifdef SMALL
    > +# define DEFLT	5	/* format when called as pax: ustar */
                                       ^^^
    I would write "default write format when called as pax: ustar" like
    what it was previously.
    
    > +#else
    > +# define DEFLT	10	/* format when called as pax: pax */
    
    And similar here.
    
    
    Either way, I like this idea.
    
    Caspar
    
    > +#endif
    >  
    >  /*
    >   * ford is the archive search order used by get_arc() to determine what kind
    > Index: pax.1
    > ===================================================================
    > RCS file: /cvs/src/bin/pax/pax.1,v
    > diff -u -p -r1.77 pax.1
    > --- pax.1	9 Dec 2023 23:00:11 -0000	1.77
    > +++ pax.1	15 Apr 2024 11:56:52 -0000
    > @@ -810,7 +810,7 @@ field as described in
    >  for more information about device IDs.
    >  .It Fl x Ar format
    >  Specify the output archive format, with the default format being
    > -.Cm ustar .
    > +.Cm pax .
    >  .Nm
    >  currently supports the following formats:
    >  .Bl -tag -width "sv4cpio"
    > 
    > -- 
    > jca
    > 
    
    
    
  • Todd C. Miller:

    Change pax(1) default write format

  • Caspar Schutijser:

    Change pax(1) default write format