From 4a6f4bc92fbf447c2aea52df78814514e7e3d60b Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 20 Jun 2023 01:06:13 +0100 Subject: [PATCH] Pull in the upstream changes from InspIRCd's vendoring tool. --- vendor/update | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vendor/update b/vendor/update index 5d2cbedb6..df7056d23 100755 --- a/vendor/update +++ b/vendor/update @@ -56,10 +56,18 @@ while (my ($name, $info) = each %{$data}) { my $vendordir = catdir $RealDir, $name; my $success = 0; if (defined $info->{git}) { - $success ||= execute 'git', 'clone', $info->{git}, $unpackdir; + my @extra_args; + push @extra_args, '--branch', $info->{branch} if defined $info->{branch}; + $success ||= execute 'git', 'clone', @extra_args, $info->{git}, $unpackdir; chomp(my $tag = `git -C $unpackdir describe --abbrev=0 --tags HEAD 2>/dev/null`) unless $success; $success ||= execute 'git', '-C', $unpackdir, 'checkout', $tag if $tag; chomp($info->{version} = `git -C $unpackdir describe --always --tags HEAD 2>/dev/null`); + if (defined $info->{patches}) { + my $patches = catfile($unpackdir, $info->{patches}); + for my $patch (glob $patches) { + $success |= execute 'git', '-C', $unpackdir, 'apply', $patch; + } + } } elsif (defined $info->{tarball}) { my $tarball = catfile $unpackdir, basename $info->{tarball}; $success ||= execute 'wget', '--output-document', $tarball, $info->{tarball};