From fd2bb2f751c13b3c0c002b8e012810902b9da364 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 8 Jun 2018 02:02:24 -0500 Subject: harmony -> system --- .../0001-gc-use-s-type-character-for-fscanf.patch | 33 +++ system/git/APKBUILD | 255 +++++++++++++++++++++ system/git/bb-tar.patch | 8 + system/git/dont-test-other-encodings.patch | 193 ++++++++++++++++ system/git/git-daemon.confd | 19 ++ system/git/git-daemon.initd | 13 ++ 6 files changed, 521 insertions(+) create mode 100644 system/git/0001-gc-use-s-type-character-for-fscanf.patch create mode 100644 system/git/APKBUILD create mode 100644 system/git/bb-tar.patch create mode 100644 system/git/dont-test-other-encodings.patch create mode 100644 system/git/git-daemon.confd create mode 100644 system/git/git-daemon.initd (limited to 'system/git') diff --git a/system/git/0001-gc-use-s-type-character-for-fscanf.patch b/system/git/0001-gc-use-s-type-character-for-fscanf.patch new file mode 100644 index 000000000..e3fe78cf6 --- /dev/null +++ b/system/git/0001-gc-use-s-type-character-for-fscanf.patch @@ -0,0 +1,33 @@ +From afceb0f7755a87d0dd2194e95f26c9dc8f4bc688 Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Fri, 15 Sep 2017 23:55:57 -0500 +Subject: [PATCH] gc: use 's' type character for fscanf + +The ISO C standard states that using a field width together with the 'c' +type character will read the exact amount specified; if that amount of +bytes is not available, a match error occurs. + +This patch allows the t6500 test to pass on the musl libc, and `git gc` +to behave correctly on systems utilising musl. + +Signed-off-by: A. Wilcox +--- + builtin/gc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/builtin/gc.c b/builtin/gc.c +index 3c78fcb..bb2d6c1 100644 +--- a/builtin/gc.c ++++ b/builtin/gc.c +@@ -258,7 +258,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid) + int should_exit; + + if (!scan_fmt) +- scan_fmt = xstrfmt("%s %%%dc", "%"SCNuMAX, HOST_NAME_MAX); ++ scan_fmt = xstrfmt("%s %%%ds", "%"SCNuMAX, HOST_NAME_MAX); + fp = fopen(pidfile_path, "r"); + memset(locking_host, 0, sizeof(locking_host)); + should_exit = +-- +2.10.0 + diff --git a/system/git/APKBUILD b/system/git/APKBUILD new file mode 100644 index 000000000..0a400b851 --- /dev/null +++ b/system/git/APKBUILD @@ -0,0 +1,255 @@ +# Contributor: Ɓukasz Jendrysik +# Maintainer: Natanael Copa +pkgname=git +pkgver=2.15.0 +pkgrel=0 +pkgdesc="A distributed version control system" +url="https://www.git-scm.com/" +arch="all" +license="GPL2+" +depends= +replaces="git-perl" + +# secfixes: +# 2.14.1: +# - CVE-2017-1000117 + +# note that order matters +subpackages="$pkgname-doc + $pkgname-bash-completion:completion:noarch + perl-$pkgname-svn:_perl_git_svn:noarch + perl-$pkgname:_perl_git:noarch + $pkgname-svn + $pkgname-email + $pkgname-fast-import:_fast_import + $pkgname-cvs::noarch + $pkgname-p4::noarch + $pkgname-daemon + $pkgname-gitweb + $pkgname-subtree::noarch + $pkgname-subtree-doc:subtree_doc:noarch + $pkgname-perl:_git_perl:noarch + $pkgname-gui::noarch + $pkgname-gitk::noarch + " +# we need tcl and tk to be built before git due to git-gui and gitk +makedepends="zlib-dev openssl-dev curl-dev expat-dev perl-dev + pcre2-dev asciidoctor xmlto perl-error tcl tk" +checkdepends="python3" +source="https://www.kernel.org/pub/software/scm/git/git-$pkgver.tar.xz + bb-tar.patch + dont-test-other-encodings.patch + git-daemon.initd + git-daemon.confd + " + +_gitcoredir=/usr/libexec/git-core +builddir="$srcdir"/$pkgname-$pkgver + +prepare() { + default_prepare + cat >> config.mak <<-EOF + NO_GETTEXT=YesPlease + NO_SVN_TESTS=YesPlease + NO_REGEX=YesPlease + USE_ASCIIDOCTOR=1 + USE_LIBPCRE2=YesPlease + NO_NSEC=YesPlease + NO_SYS_POLL_H=1 + CFLAGS=$CFLAGS + EOF +} + +build() { + cd "$builddir" + make -j1 prefix=/usr DESTDIR="$pkgdir" perl/perl.mak + make prefix=/usr DESTDIR="$pkgdir" +} + +check() { + cd "$builddir" + make prefix=/usr DESTDIR="$pkgdir" test +} + +package() { + cd "$builddir" + make -j1 prefix=/usr \ + DESTDIR="$pkgdir" \ + INSTALLDIRS=vendor \ + install + mkdir -p "$pkgdir"/var/git + install -Dm755 "$srcdir"/git-daemon.initd \ + "$pkgdir"/etc/init.d/git-daemon + install -Dm644 "$srcdir"/git-daemon.confd \ + "$pkgdir"/etc/conf.d/git-daemon + + make prefix=/usr DESTDIR="$pkgdir" install-man +} + +_perl_git_svn() { + pkgdesc="Perl interface to Git::SVN" + depends="git=$pkgver-r$pkgrel" + replaces="git-perl" + eval local `perl -V:vendorlib` + mkdir -p "$subpkgdir"/$vendorlib/Git + mv "$pkgdir"/$vendorlib/Git/SVN* "$subpkgdir"/$vendorlib/Git/ +} + +_perl_git() { + pkgdesc="Perl interface to Git" + depends="git=$pkgver-r$pkgrel perl-error" + replaces="git-perl" + eval local `perl -V:vendorlib` + eval local `perl -V:vendorarch` + for i in $vendorlib $vendorarch; do + mkdir -p "$subpkgdir"/${i%/*} + mv "$pkgdir"/$i "$subpkgdir"/$i + done +} + +email() { + depends="perl perl-git=$pkgver-r$pkgrel perl-net-smtp-ssl + perl-authen-sasl" + pkgdesc="Git tools for sending email" + replaces="git" + mkdir -p "$subpkgdir"/$_gitcoredir + mv "$pkgdir"/$_gitcoredir/*email* "$pkgdir"/$_gitcoredir/*imap* \ + "$subpkgdir"/$_gitcoredir +} + +svn() { + depends="perl perl-git-svn=$pkgver-r$pkgrel perl-subversion + perl-term-readkey" + pkgdesc="Subversion support for git" + replaces="" + + mkdir -p "$subpkgdir"/$_gitcoredir + mv "$pkgdir"/$_gitcoredir/git-svn \ + "$pkgdir"$_gitcoredir/git-remote-testsvn \ + "$subpkgdir"/$_gitcoredir/ +} + +cvs() { + pkgdesc="Git tools for importing CVS repositories" + depends="perl perl-git=$pkgver-r$pkgrel cvs perl-dbd-sqlite" + replaces="git-perl" + mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/$_gitcoredir + mv "$pkgdir"/usr/bin/git-cvs* "$subpkgdir"/usr/bin/ + mv "$pkgdir"/$_gitcoredir/*cvs* "$subpkgdir"/$_gitcoredir \ + +} + +_fast_import() { + pkgdesc="Git backend for fast Git data importers" + depends="git=$pkgver-r$pkgrel" + mkdir -p "$subpkgdir"/$_gitcoredir + mv "$pkgdir"/$_gitcoredir/git-fast-import "$subpkgdir"/$_gitcoredir/ +} + +p4() { + pkgdesc="Git tools for working with Perforce depots" + depends="git=$pkgver-r$pkgrel git-fast-import=$pkgver-r$pkgrel" + replaces="git" + mkdir -p "$subpkgdir"/$_gitcoredir/mergetools + mv "$pkgdir"/$_gitcoredir/*p4* "$subpkgdir"/$_gitcoredir/ + mv "$pkgdir"/$_gitcoredir/mergetools/*p4* \ + "$subpkgdir"/$_gitcoredir/mergetools/ +} + +daemon() { + pkgdesc="Git protocol daemon" + depends="git=$pkgver-r$pkgrel" + replaces="git" + mkdir -p "$subpkgdir"/$_gitcoredir + mv "$pkgdir"/$_gitcoredir/git-daemon \ + "$pkgdir"/$_gitcoredir/git-http-backend \ + "$pkgdir"/$_gitcoredir/git-shell \ + "$subpkgdir"/$_gitcoredir \ + + mv "$pkgdir"/etc "$subpkgdir"/ +} + +gitweb() { + pkgdesc="Simple web interface to git repositories" + depends="git=$pkgver-r$pkgrel perl" + replaces="git" + mkdir -p "$subpkgdir"/usr/share "$subpkgdir"$_gitcoredir + mv "$pkgdir"/usr/share/gitweb "$subpkgdir"/usr/share/ + mv "$pkgdir"/$_gitcoredir/git-instaweb "$subpkgdir"$_gitcoredir +} + +completion() { + pkgdesc="Bash completion for $pkgname" + depends="" + replaces="" + install_if="$pkgname=$pkgver-r$pkgrel bash-completion" + + install -Dm644 "$builddir"/contrib/completion/git-completion.bash \ + "$subpkgdir"/usr/share/bash-completion/completions/git +} + +subtree() { + depends="git=$pkgver-r$pkgrel" + pkgdesc="Split git repository into subtrees" + replaces="" + + cd "$builddir"/contrib/subtree + make prefix=/usr DESTDIR="$pkgdir" + make install prefix=/usr DESTDIR="$subpkgdir" +} + +subtree_doc() { + depends="" + pkgdesc="Split git repository into subtrees (documentation)" + replaces="" + + cd "$builddir"/contrib/subtree + make install-man prefix=/usr DESTDIR="$subpkgdir" + gzip -9 "$subpkgdir"/usr/share/man/man1/git-subtree.1 +} + +gui() { + depends="git=$pkgver-r$pkgrel tcl tk" + pkgdesc="GUI interface for git" + replaces="" + + mkdir -p "$subpkgdir"/usr/share "$subpkgdir"/usr/libexec/git-core + mv "$pkgdir"/usr/share/git-gui "$subpkgdir"/usr/share/ + mv "$pkgdir"/usr/libexec/git-core/git-citool \ + "$pkgdir"/usr/libexec/git-core/git-gui \ + "$pkgdir"/usr/libexec/git-core/git-gui--askpass \ + "$subpkgdir"/usr/libexec/git-core/ +} + +gitk() { + depends="git=$pkgver-r$pkgrel tcl tk" + pkgdesc="Gitk interface for git" + replaces="" + + mkdir -p "$subpkgdir"/usr/share "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/share/gitk "$subpkgdir"/usr/share/ + mv "$pkgdir"/usr/bin/gitk "$subpkgdir"/usr/bin/ +} + +# catch-the-rest of stuff that needs perl +_git_perl() { + depends="git=$pkgver-r$pkgrel perl-git=$pkgver-r$pkgrel perl" + pkgdesc="Additional Git commands that requires perl" + replaces="" + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/perl* "$subpkgdir"/usr/lib/ + cd "$pkgdir" + find -type f | xargs file --mime-type | grep perl | cut -d: -f1| while read f; do + mkdir -p "$subpkgdir"/${f%/*} + mv "$f" "$subpkgdir"/${f%/*} + done + find "$subpkgdir" -name perllocal.pod -delete +} + + +sha512sums="994704b440ebce104a99d815dd713af3173f29e70646d7135c3fcd1ac4694a26e499f0732843606c397cbf6108809eb397546c837623a4adbe1ccb2fc825cb64 git-2.15.0.tar.xz +85767b5e03137008d6a96199e769e3979f75d83603ac8cb13a3481a915005637409a4fd94e0720da2ec6cd1124f35eba7cf20109a94816c4b4898a81fbc46bd2 bb-tar.patch +135645fa57c41c50bec6d09f7d3c92f26d30334b5f342d50942c24e0dd11106e40c36b11346c9e6cd69e98b7a9ebeec80e4e4f1506ef689f39d7ef4539727dae dont-test-other-encodings.patch +89528cdd14c51fd568aa61cf6c5eae08ea0844e59f9af9292da5fc6c268261f4166017d002d494400945e248df6b844e2f9f9cd2d9345d516983f5a110e4c42a git-daemon.initd +fbf1f425206a76e2a8f82342537ed939ff7e623d644c086ca2ced5f69b36734695f9f80ebda1728f75a94d6cd2fcb71bf845b64239368caab418e4d368c141ec git-daemon.confd" diff --git a/system/git/bb-tar.patch b/system/git/bb-tar.patch new file mode 100644 index 000000000..d9433ef12 --- /dev/null +++ b/system/git/bb-tar.patch @@ -0,0 +1,8 @@ +--- a/templates/Makefile Mon Oct 26 02:57:33 2009 ++++ b/templates/Makefile Mon Nov 9 14:56:27 2009 +@@ -63,4 +63,4 @@ + install: all + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)' + (cd blt && $(TAR) cf - .) | \ +- (cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xof -) ++ (cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xf -) diff --git a/system/git/dont-test-other-encodings.patch b/system/git/dont-test-other-encodings.patch new file mode 100644 index 000000000..98949bc1b --- /dev/null +++ b/system/git/dont-test-other-encodings.patch @@ -0,0 +1,193 @@ +We can't support Japanese people using musl + +--- git-2.14.1/t/t3900-i18n-commit.sh.old 2017-08-09 14:54:31.000000000 -0500 ++++ git-2.14.1/t/t3900-i18n-commit.sh 2017-09-10 21:10:09.269860087 -0500 +@@ -76,132 +76,4 @@ + test_i18ngrep "did not conform" "$HOME"/stderr + ' + +-for H in ISO8859-1 eucJP ISO-2022-JP +-do +- test_expect_success "$H setup" ' +- git config i18n.commitencoding $H && +- git checkout -b $H C0 && +- echo $H >F && +- git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt +- ' +-done +- +-for H in ISO8859-1 eucJP ISO-2022-JP +-do +- test_expect_success "check encoding header for $H" ' +- E=$(git cat-file commit '$H' | sed -ne "s/^encoding //p") && +- test "z$E" = "z'$H'" +- ' +-done +- +-test_expect_success 'config to remove customization' ' +- git config --unset-all i18n.commitencoding && +- if Z=$(git config --get-all i18n.commitencoding) +- then +- echo Oops, should have failed. +- false +- else +- test z = "z$Z" +- fi && +- git config i18n.commitencoding UTF-8 +-' +- +-test_expect_success 'ISO8859-1 should be shown in UTF-8 now' ' +- compare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt +-' +- +-for H in eucJP ISO-2022-JP +-do +- test_expect_success "$H should be shown in UTF-8 now" ' +- compare_with '$H' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt +- ' +-done +- +-test_expect_success 'config to add customization' ' +- git config --unset-all i18n.commitencoding && +- if Z=$(git config --get-all i18n.commitencoding) +- then +- echo Oops, should have failed. +- false +- else +- test z = "z$Z" +- fi +-' +- +-for H in ISO8859-1 eucJP ISO-2022-JP +-do +- test_expect_success "$H should be shown in itself now" ' +- git config i18n.commitencoding '$H' && +- compare_with '$H' "$TEST_DIRECTORY"/t3900/'$H'.txt +- ' +-done +- +-test_expect_success 'config to tweak customization' ' +- git config i18n.logoutputencoding UTF-8 +-' +- +-test_expect_success 'ISO8859-1 should be shown in UTF-8 now' ' +- compare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt +-' +- +-for H in eucJP ISO-2022-JP +-do +- test_expect_success "$H should be shown in UTF-8 now" ' +- compare_with '$H' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt +- ' +-done +- +-for J in eucJP ISO-2022-JP +-do +- if test "$J" = ISO-2022-JP +- then +- ICONV=$J +- else +- ICONV= +- fi +- git config i18n.logoutputencoding $J +- for H in eucJP ISO-2022-JP +- do +- test_expect_success "$H should be shown in $J now" ' +- compare_with '$H' "$TEST_DIRECTORY"/t3900/'$J'.txt $ICONV +- ' +- done +-done +- +-for H in ISO8859-1 eucJP ISO-2022-JP +-do +- test_expect_success "No conversion with $H" ' +- compare_with "--encoding=none '$H'" "$TEST_DIRECTORY"/t3900/'$H'.txt +- ' +-done +- +-test_commit_autosquash_flags () { +- H=$1 +- flag=$2 +- test_expect_success "commit --$flag with $H encoding" ' +- git config i18n.commitencoding $H && +- git checkout -b $H-$flag C0 && +- echo $H >>F && +- git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt && +- test_tick && +- echo intermediate stuff >>G && +- git add G && +- git commit -a -m "intermediate commit" && +- test_tick && +- echo $H $flag >>F && +- git commit -a --$flag HEAD~1 && +- E=$(git cat-file commit '$H-$flag' | +- sed -ne "s/^encoding //p") && +- test "z$E" = "z$H" && +- git config --unset-all i18n.commitencoding && +- git rebase --autosquash -i HEAD^^^ && +- git log --oneline >actual && +- test_line_count = 3 actual +- ' +-} +- +-test_commit_autosquash_flags eucJP fixup +- +-test_commit_autosquash_flags ISO-2022-JP squash +- + test_done +--- git-2.14.1/t/t5100-mailinfo.sh.old 2017-08-09 14:54:31.000000000 -0500 ++++ git-2.14.1/t/t5100-mailinfo.sh 2017-09-10 23:26:39.206126739 -0500 +@@ -27,6 +27,7 @@ + + for mail in 00* + do ++ if [ $mail == 0004 ]; then continue; fi + test_expect_success "mailinfo $mail" ' + check_mailinfo "$mail" "" && + if test -f "$DATA/msg$mail--scissors" +--- git-2.14.1/t/t8005-blame-i18n.sh.old 2017-08-09 14:54:31.000000000 -0500 ++++ git-2.14.1/t/t8005-blame-i18n.sh 2017-09-16 00:42:35.123728809 -0500 +@@ -24,43 +24,10 @@ + git commit --author "$SJIS_NAME " -m "$SJIS_MSG" + ' + +-cat >expected <output && +- filter_author_summary output >actual && +- test_cmp expected actual +-' +- +-cat >expected <output && +- filter_author_summary output >actual && +- test_cmp expected actual +-' +- + cat >expected <