Bug 53857 - Unconditionally use --strip-components for bsdtar
Summary: Unconditionally use --strip-components for bsdtar
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All FreeBSD
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:3.7.0
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-20 19:39 UTC by Jung-uk Kim
Modified: 2012-08-27 13:28 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Assume --strip-components is always available for bsdtar. (438 bytes, patch)
2012-08-20 19:39 UTC, Jung-uk Kim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jung-uk Kim 2012-08-20 19:39:41 UTC
Created attachment 65847 [details]
Assume --strip-components is always available for bsdtar.

bsdtar has --strip-components option.  However, it is not properly detected by configure scripts because it does not display the option with --help:

% tar --help
tar(bsdtar): manipulate archive files
First option must be a mode specifier:
  -c Create  -r Add/Replace  -t List  -u Update  -x Extract
Common Options:
  -b #  Use # 512-byte records per I/O block
  -f <filename>  Location of archive (default /dev/sa0)
  -v    Verbose
  -w    Interactive
Create: tar -c [options] [<file> | <dir> | @<archive> | -C <dir> ]
  <file>, <dir>  add these items to archive
  -z, -j, -J, --lzma  Compress archive with gzip/bzip2/xz/lzma
  --format {ustar|pax|cpio|shar}  Select archive format
  --exclude <pattern>  Skip files that match pattern
  -C <dir>  Change to <dir> before processing remaining files
  @<archive>  Add entries from <archive> to output
List: tar -t [options] [<patterns>]
  <patterns>  If specified, list only entries that match
Extract: tar -x [options] [<patterns>]
  <patterns>  If specified, extract only entries that match
  -k    Keep (don't overwrite) existing files
  -m    Don't restore modification times
  -O    Write entries to stdout, don't restore to disk
  -p    Restore permissions (including ACLs, owner, file flags)
bsdtar 3.0.4 - libarchive 3.0.4
% ls -Rl a
total 2
drwxr-xr-x  3 jkim  wheel  512  8 20 15:33 b

a/b:
total 2
drwxr-xr-x  3 jkim  wheel  512  8 20 15:33 c

a/b/c:
total 2
drwxr-xr-x  2 jkim  wheel  512  8 20 15:33 d

a/b/c/d:
total 0
% tar -c -f a.tar a
% tar -t -f a.tar
a/
a/b/
a/b/c/
a/b/c/d/
% tar -c -f a.tar --strip-components=1 a
% tar -t -f a.tar
b/
b/c/
b/c/d/

It seems the option is always available for bsdtar according to FreeBSD commit logs.
Comment 1 Not Assigned 2012-08-27 12:10:40 UTC
Jung-uk Kim committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=38e0a58ce11125d20ef1f8aed7996518d7ddbb38

fdo#53857: Assume --strip-components is always available for bsdtar