bzr export should have excludes options

Bug #174153 reported by Barry Warsaw
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Wishlist
Unassigned

Bug Description

We use bzr export --format=tgz to build our Mailman source distro files, however there are some files in our source tree that we want to exclude from the tarball. IWBNI bzr export could take a list of exclude files, or a file containing exclude file names, analogous to tar's --exclude -X and --exclude-from switches.

Revision history for this message
Vincent Ladeuil (vila) wrote :

IWB even more NI options can be passed to the used utility (be it tar, gzip, unzip, etc).

Revision history for this message
Barry Warsaw (barry) wrote :

I haven't looked at the code, but I suspect its using Python's tarfile module to create the tarballs, and not an external program. +1 if it's using tar(1) though!

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 174153] Re: bzr export --format=tar should have excludes options

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

vila wrote:
> IWB even more NI options can be passed to the used utility (be it tar,
> gzip, unzip, etc).

I *think* this means "It Would Be even more Nice If options could be
passed to the utility being used (be it tar, gzip, unzip, or something
else)" IWBNI isn't an abbreviation I'm familiar with. When in
doubt, spell it out.

Assuming I parsed correctly, your comment assumes that we are invoking a
utility, but we're not invoking a utility. We're using Python's
built-in support for zip, tar, gzip, etc. So there's no utility to pass
options to.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHVr4G0F+nu1YWqI0RAr4tAJ4p4f7T/ct9TMK/O6BCX9FMtj6NgQCdFKGl
EQdI1if1sKrRMP85iyXf+eU=
=XWFU
-----END PGP SIGNATURE-----

Vincent Ladeuil (vila)
Changed in bzr:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Vincent Ladeuil (vila) wrote : Re: bzr export --format=tar should have excludes options

Yes, it uses tarfile, but I wanted to provide -9 to zip myself not so long ago.

Another way to address our needs will be a --names-only option that can then be fetched to the real tar(1)...

Strange impression of deja-vu on that option...

Wait, a work-around is to use:

bzr export /tmp/<nice-directory-name-without-suffix>

Then you can use the directory name as a base for tar(1) or zip(1)

So may be a --cmd option may more appropriate:

bzr export --cmd 'tar --exclude-from ~/unwanted cf ~/deliver/project-1.0.tar %(dir)%

will be executed with dir replaced with a temp directory containing the exported tree.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Replying to Aaron:

Yes IWBNI is the acronym for If Would Be Nice If, Barry used it first though, so I just joked on top of it and that should the first time I am the one not getting the meaning of an acronym :)

Revision history for this message
Barry Warsaw (barry) wrote :

Sorry about the acronym use (SATAU :).

vila, i'm not sure how useful --cmd would be. Our old release script just invoked svn export, then tar(1) manually. I was hoping to do it all in 'bzr export' now, but if I had to use --cmd to get the just right invocation of tar, I'd just do it as a separate command after the 'bzr export'.

Revision history for this message
Vincent Ladeuil (vila) wrote : Re: [Bug 174153] Re: bzr export --format=tar should have excludes options

>>>>> "barry" == Barry Warsaw <email address hidden> writes:

    barry> Sorry about the acronym use (SATAU :).

;)

    barry> vila, i'm not sure how useful --cmd would be. Our old
    barry> release script just invoked svn export, then tar(1)
    barry> manually. I was hoping to do it all in 'bzr export'
    barry> now, but if I had to use --cmd to get the just right
    barry> invocation of tar, I'd just do it as a separate
    barry> command after the 'bzr export'.

For script use, the raw export is enough then.

Otherwise where will *you* draw the line ?

tar options only, zip options, gzip options ?

Revision history for this message
John A Meinel (jameinel) wrote : Re: bzr export --format=tar should have excludes options

And don't forget the other request (bug #173274) for "pre-export" hooks. So that you can run autoconf and export that as part of your exported tarball.

Filtering out stuff that you don't want is a bit easier than adding in more stuff that you do.

Revision history for this message
David Gómez (dabisu) wrote :

Although the "--exclude" functionality should be implemented in Python tar support and it's not strictly a bazaar bug, current situation after one year is that "bzr export" stills creates a package with all the files and i think it's pretty common when you create a tar file to exclude some files from the repository.

Work-around (exporting to /tmp, and creating a tar file), is just that, a work-around.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I could use this functionality too.

I'd like:

bzr export --exclude doc/presentation.odp foo.orig.tar.gz

Thanks,
:-Dustin

Martin Pool (mbp)
Changed in bzr:
status: Triaged → Confirmed
Parth Malwankar (parthm)
tags: added: export
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

All exporters now use a common function to select the inventory entries to export and there already is a hardcoded exclude pattern (".bzr*") so this should be reasonably easy to implement now.

summary: - bzr export --format=tar should have excludes options
+ bzr export should have excludes options
Revision history for this message
David Gómez (dabisu) wrote :

Will this feature be implemented before 2020? ;)

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.