From e8d005452ce3971fa0f0a09048d23ea2c2f431cf Mon Sep 17 00:00:00 2001 From: Celeste <20312-Celeste@users.gitlab.alpinelinux.org> Date: Mon, 5 Feb 2024 07:22:19 +0000 Subject: [PATCH] testing/perl-git-repository: new aport https://metacpan.org/release/Git-Repository/ Perl interface to Git repositories --- testing/perl-git-repository/APKBUILD | 54 +++++++++++++++++++ .../git-2.38.1-tests.patch | 33 ++++++++++++ .../git-2.40.0-tests.patch | 24 +++++++++ 3 files changed, 111 insertions(+) create mode 100644 testing/perl-git-repository/APKBUILD create mode 100644 testing/perl-git-repository/git-2.38.1-tests.patch create mode 100644 testing/perl-git-repository/git-2.40.0-tests.patch diff --git a/testing/perl-git-repository/APKBUILD b/testing/perl-git-repository/APKBUILD new file mode 100644 index 00000000000..430fd0ea35c --- /dev/null +++ b/testing/perl-git-repository/APKBUILD @@ -0,0 +1,54 @@ +# Automatically generated by apkbuild-cpan, template 4 +# Contributor: Celeste +# Maintainer: Celeste +pkgname=perl-git-repository +pkgver=1.325 +pkgrel=0 +#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan +_pkgreal=Git-Repository +pkgdesc="Perl interface to Git repositories" +url="https://metacpan.org/release/Git-Repository/" +arch="noarch" +license="GPL-1.0-or-later OR Artistic-1.0-Perl" +depends=" + git perl perl-git-version-compare + perl-namespace-clean perl-system-command + " +checkdepends="perl-test-requires-git" +subpackages="$pkgname-doc" +source="https://cpan.metacpan.org/authors/id/B/BO/BOOK/Git-Repository-$pkgver.tar.gz + git-2.38.1-tests.patch + git-2.40.0-tests.patch + " +builddir="$srcdir/$_pkgreal-$pkgver" + +build() { + export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') + PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL \ + INSTALLDIRS=vendor \ + NO_PACKLIST=1 \ + NO_PERLLOCAL=1 + make +} + +check() { + export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') + make test +} + +package() { + make DESTDIR="$pkgdir" install +} + +doc() { + local file; find "$pkgdir" -name "*.pod" | while read -r file; do + amove "${file#"$pkgdir"}" + done + default_doc +} + +sha512sums=" +eeaf7b975d6f6f7461ec4dbefb00bcd127badc5b7978910b6bd2493a13ccc4ff818e68ee22c4c23244af9446304122aee16544537bd1170c41dd6aabbba9b56c Git-Repository-1.325.tar.gz +58516be4cde0b9bc0ceaa18600a316fc78886adf17965ab6aecebcc8949e0e4d92f75b63083634848aaf1a752b2cccf79cc85db4e51b290bab6c2acda95b0468 git-2.38.1-tests.patch +019d44ef924dd2dc45cc3ad17b9eaf00d8ab84003c7c84d4962bf0654dbc4232373a6d67d2903d70bd4512331e201335286028e0ec63a79d1367695f954b4a60 git-2.40.0-tests.patch +" diff --git a/testing/perl-git-repository/git-2.38.1-tests.patch b/testing/perl-git-repository/git-2.38.1-tests.patch new file mode 100644 index 00000000000..13ffc2f47b2 --- /dev/null +++ b/testing/perl-git-repository/git-2.38.1-tests.patch @@ -0,0 +1,33 @@ +Patch-Source: https://sources.debian.org/data/main/libg/libgit-repository-perl/1.325-3/debian/patches/gh-22.patch +-- +From 4dc8dedb97891f37b9da2220e5740c65685b0906 Mon Sep 17 00:00:00 2001 +From: Jan Pazdziora +Date: Mon, 31 Oct 2022 17:26:00 +0100 +Subject: [PATCH] Workaround change of behaviour in git 2.38.1 for + CVE-2022-39253. + +By default, protocol.file.allow now defaults to user, preventing +clones with symlinks. + +https://github.blog/2022-10-18-git-security-vulnerabilities-announced/#cve-2022-39253 + + +Bug: https://rt.cpan.org/Public/Bug/Display.html?id=144889 +Bug-Debian: https://bugs.debian.org/1023597 + +--- + t/21-submodule.t | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/t/21-submodule.t b/t/21-submodule.t +index 444029c..97374f8 100644 +--- a/t/21-submodule.t ++++ b/t/21-submodule.t +@@ -44,6 +44,7 @@ $s->run( checkout => 'master', { quiet => 1 } ); + # now test adding a submodule + my $r = test_repository(@init); + $r->run( ++ ( Git::Repository->version_ge('2.38.1') ? ('-c', 'protocol.file.allow=always') : ()), + submodule => add => $s->work_tree => 'sub', + { env => { GIT_WORK_TREE => undef } } + ); diff --git a/testing/perl-git-repository/git-2.40.0-tests.patch b/testing/perl-git-repository/git-2.40.0-tests.patch new file mode 100644 index 00000000000..510c7999e2b --- /dev/null +++ b/testing/perl-git-repository/git-2.40.0-tests.patch @@ -0,0 +1,24 @@ +Patch-Source: https://sources.debian.org/data/main/libg/libgit-repository-perl/1.325-3/debian/patches/git-2.40.0.patch +-- +Description: Skip subtest when git version >= 2.40.0 + 'git var GIT_EDITOR' behaviour was changed in git 2.40.0: + https://github.com/git/git/commit/2ad150e35e52705a97f18bee08f34e00a6557d6f + so skip the test which expect the old error messages if git is new enough. +Origin: vendor +Bug: https://github.com/book/Git-Repository/pull/23 +Forwarded: https://github.com/book/Git-Repository/pull/23 +Author: gregor herrmann +Last-Update: 2023-03-22 + +--- a/t/20-simple.t ++++ b/t/20-simple.t +@@ -85,6 +85,9 @@ + skip "this test does not work with msysgit on Win32", 2 + if $^O eq 'MSWin32'; + ++ skip "'git var GIT_EDITOR' behaviour was changed in git 2.40.0, and we have $version", 2 ++ if Git::Repository->version_ge('2.40.0'); ++ + ok( !eval { $r->run( var => 'GIT_EDITOR' ); 1; }, 'git var GIT_EDITOR' ); + like( + $@,