Page MenuHomePhabricator

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

Authored by PiRK on Jun 28 2023, 11:17.

Details

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/*.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
fix_extract_secp256k1
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24228
Build 48066: Build Diff
Build 48065: arc lint + arc unit