Skip to content

Applying a patch from GitHub to a formula when the source archive uses different paths? #2706

Discussion options

You must be logged in to vote

Under the hood, the patch mechanism in Homebrew uses the patch command line tool. Of interest in your case is this command line flag for the patch tool:

-pnum  or  --strip=num
          Strip the smallest prefix containing num leading slashes from
          each file name found in the patch file.  A sequence of one or
          more adjacent slashes is counted as a single slash.  This
          controls how file names found in the patch file are treated,
          in case you keep your files in a different directory than the
          person who sent out the patch.  For example, supposing the
          file name in the patch file was

          /u/howard/src/blurfl/blurfl.c

       settin…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Kreeblah
Comment options

Answer selected by Kreeblah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants