[PATCH] D59503: [llvm-ar] Support N [count] modifier

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 12:00:35 PDT 2019


rupprecht created this revision.
rupprecht added reviewers: ruiu, MaskRay.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.

GNU ar supports the 'N' count modifier for the extract (x) and delete (d) operations. When an archive contains multiple members with the same name, this can be used to extract (or delete) them individually. For example:

  $ llvm-ar t archive.a
  foo
  foo
  $ llvm-ar x archive.a
  -> Writes foo twice, overwriting it the second time :( :(
  $ llvm-ar xN 1 archive.a foo && mv foo foo.1
  $ llvm-ar xN 2 archive.a foo && mv foo foo.2
  -> Write foo twice, renaming it in between invocations to preserve all versions


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D59503

Files:
  llvm/test/tools/llvm-ar/count.test
  llvm/tools/llvm-ar/llvm-ar.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59503.191137.patch
Type: text/x-patch
Size: 9178 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190318/4fce9998/attachment.bin>


More information about the llvm-commits mailing list