HomePhabricator

[contrib] fix extract-secp256k1.sh to support spaces in filenames

Description

[contrib] fix extract-secp256k1.sh to support spaces in filenames

Summary:
This makes xargs work with filenames that include blanck spaces.

From the args man page:

-I replace-str
      Replace occurrences of replace-str in the initial-
      arguments with names read from standard input.  Also,
      unquoted blanks do not terminate input items; instead the
      separator is the newline character.  Implies -x and -L 1.
-L max-lines
      Use at most max-lines nonblank input lines per command
      line.  Trailing blanks cause an input line to be logically
      continued on the next input line.  Implies -x.

-x, --exit
      Exit if the size (see the -s option) is exceeded.

Test Plan:
Clone the monorepo and run:

git ls-files \
  | grep -v "^cmake\|^src/secp256k1" \
  | xargs -I{} git rm -q --cached {};

Check that it no longer errors on "electrum/electrumabc_plugins/fusion/Cash Fusion Logo - No Text.svg"

Check with git status and a file explorer that all files are deleted except for cmake/* and src/secp256k1/*.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14143

Details

Provenance
PiRKAuthored on Jun 28 2023, 11:08
PiRKPushed on Jun 30 2023, 04:57
Reviewer
Restricted Project
Differential Revision
D14143: [contrib] fix extract-secp256k1.sh to support spaces in filenames
Parents
rABC7f88b3b3d3e8: [e.cash] Add blog page
Branches
Unknown
Tags
Unknown