| # Copyright 2022 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| # Maintainers: Steven Rostedt <rostedt@google.com> |
| # Ross Zwisler <zwisler@google.com> |
| # repo-patch: Apply a repo-level patch which can span multiple git |
| # Example - stash local changes at the repo level, then restore them: |
| # repo diff > /tmp/r.diff |
| # repo-patch -R < /tmp/r.diff |
| # repo-patch < /tmp/r.diff |
| my $srcroot = abs_path(dirname($0) . "/../../../.."); |
| chdir $srcroot or die "Cannot chdir to $srcroot\n"; |
| chdir $1 or die "Cannot chdir to $1\n"; |
| open(PATCH, "|patch -p1 @ARGV") or die "Cannot patch $1\n"; |