diff --git a/abuild.conf.in b/abuild.conf.in index 9d03acf5918d5f68563e2320d7efb6b5c9f6e1c9..5db5a6ca5d52bf69d67e21b40889b3666b81c973 100644 --- a/abuild.conf.in +++ b/abuild.conf.in @@ -15,7 +15,7 @@ #REPODEST=$HOME/packages/ # PACKAGER and MAINTAINER are used by newapkbuild when creating new aports for -# the APKBUILD's "Contributor:" comment and "maintainer" field, respectively. +# the APKBUILD's "Contributor:" and "Maintainer:" comments, respectively. #PACKAGER="Your Name <your@email.address>" #MAINTAINER="$PACKAGER" diff --git a/abuild.in b/abuild.in index 6ac7176a245f962246c6a84bc4e54eb19b7a517e..b834e7313693917dd6f5d21c690070c22cf580f4 100644 --- a/abuild.in +++ b/abuild.in @@ -311,8 +311,8 @@ default_validate() { [ -n "$conflicts" ] && die "APKBUILD contains \$conflicts. Explicit conflicts should be added as '!pkgname' to depends" check_maintainer || die "Provide a valid RFC822 maintainer address" - grep -q '^# *Maintainer:' "$APKBUILD" \ - && warning "Setting the maintainer with a comment is deprecated. Use maintainer=\"$maintainer\" instead" + [ $(grep '^# *Maintainer:' "$APKBUILD" | wc -l) -gt 1 ] \ + && die "More than one maintainer" check_license || warning "Please use valid SPDX license identifiers found at: https://spdx.org/licenses" check_depends_dev || warning "depends_dev found but no development subpackage found" @@ -996,7 +996,9 @@ git_last_commit_epoch() { } get_maintainer() { - : "${maintainer:=$(awk -F': ' '/# *Maintainer/ {print $2}' "$APKBUILD")}" + if [ -z "$maintainer" ]; then + maintainer=$(awk -F': ' '/# *Maintainer/ {print $2}' "$APKBUILD") + fi } check_maintainer() { diff --git a/apkbuild-cpan.in b/apkbuild-cpan.in index 33f17a8838fa4f3b12ca6a662693707471a1c03b..73d091e39b180382f7ff2a865a783692752f63b5 100755 --- a/apkbuild-cpan.in +++ b/apkbuild-cpan.in @@ -39,9 +39,8 @@ my $package_mappings = { }; our $packager = ""; my $template = <<'EOF'; -# Automatically generated by apkbuild-cpan, template 5 +# Automatically generated by apkbuild-cpan, template 4 [% authors %] -maintainer=[% maintainer %] pkgname=[% pkgname %] pkgver=[% pkgver %] pkgrel=[% pkgrel %] @@ -96,12 +95,11 @@ sub read_assignments_from_file { my %hash = ( %sline, %mline ); return \%hash if $filename ne 'APKBUILD'; - my $authors = $text =~ /^# Contributor: .*$/mg; + my $authors = join( "\n", + $text =~ /^# Contributor: .*$/mg, + $text =~ /^# Maintainer: .*$/mg ); $hash{'authors'} = $authors if length($authors) > 1; - my $maintainer = $text =~ /^# Maintainer: .*$/mg; - $hash{'maintainer'} = $maintainer if length($maintainer) > 1; - my $options = $text =~ m/^options=\"(.*)\"(.*)$/mg; $hash{'options'} = "$1" if length($options) >= 1; $hash{'options_comment'} = "$2" if length($options) >= 1; @@ -155,7 +153,6 @@ sub write_apkbuild { my ( $distdata, $apkbuild, $moddata ) = @_; my $authors = undef; - my $maintainer = $packager; my $replaces = undef; my $provides = undef; my $pkgrel = 0; @@ -164,8 +161,6 @@ sub write_apkbuild { my $orig_source = undef; if ( defined $apkbuild ) { $authors = $apkbuild->{authors}; - $maintainer = $apkbuild->{maintainer}; - $pkgrel = $apkbuild->{pkgrel}; $provides = $apkbuild->{provides}; $replaces = $apkbuild->{replaces}; $pkgrel = $apkbuild->{pkgrel}; @@ -195,9 +190,8 @@ sub write_apkbuild { my %repl = ( authors => ( $authors - or "# Contributor: $packager" + or "# Contributor: $packager\n# Maintainer: $packager" ), - maintainer => $maintainer, pkgname => map_cpan_to_apk( $moddata->{distribution} ), pkgreal => $pkgreal, pkgver => $pkgver, diff --git a/apkbuild-pypi.in b/apkbuild-pypi.in index 333479bb33dbf2ec2300aa04055f5bfa48064dcf..88ee804156974f633de8fa1f52a56244044bc908 100755 --- a/apkbuild-pypi.in +++ b/apkbuild-pypi.in @@ -16,9 +16,8 @@ my %pkgmap = (); my %licenses = (); my $template = <<'EOF'; -# Automatically generated by apkbuild-pypi, template 5 +# Automatically generated by apkbuild-pypi, template 4 [% authors %] -maintainer=[% maintainer %] pkgname=[% pkgname %] pkgver=[% pkgver %] pkgrel=[% pkgrel %] @@ -77,12 +76,11 @@ sub read_assignments_from_file { my %hash = ( %sline, %mline ); return \%hash if $filename ne 'APKBUILD'; - my $authors = $text =~ /^# Contributor: .*$/mg; + my $authors = join( "\n", + $text =~ /^# Contributor: .*$/mg, + $text =~ /^# Maintainer: .*$/mg ); $hash{'authors'} = $authors if length($authors) > 1; - my $maintainer = $text =~ /^# Maintainer: .*$/mg; - $hash{'maintainer'} = $maintainer if length($maintainer) > 1; - if ($text =~ m/^provides=\"(.*)\"(.*)$/m) { $hash{'provides'} = $1; $hash{'provides_comment'} = $2; @@ -183,7 +181,6 @@ sub write_apkbuild { my $replaces = undef; my $provides = undef; my $authors = undef; - my $maintainer = $packager; my $license = undef; my $url = undef; my $pkgname = undef; @@ -202,7 +199,6 @@ sub write_apkbuild { if (defined $apkbuild) { $authors = $apkbuild->{authors}; - $maintainer = $apkbuild->{maintainer}; $provides = $apkbuild->{provides}; $replaces = $apkbuild->{replaces}; $license = $apkbuild->{license}; @@ -224,8 +220,7 @@ sub write_apkbuild { my $srcurl = get_source($distdata); my %repl = ( - authors => ($authors or "# Contributor: $packager"), - maintainer => $mantainer, + authors => ($authors or "# Contributor: $packager\n# Maintainer: $packager"), pkgname => ($pkgname or map_pypi_to_apk($pkgreal)), pkgreal => $pkgreal, pkgver => $distdata->{info}{version}, diff --git a/newapkbuild.in b/newapkbuild.in index 8b95106f326745e09bd0aadaa2bf078ca7354fee..855d522b9b14e89235358db853b0d38e1e1aeef3 100644 --- a/newapkbuild.in +++ b/newapkbuild.in @@ -304,7 +304,7 @@ newaport() { # Generate header with standard variables cat >APKBUILD<<__EOF__ # Contributor:${PACKAGER:+" "}${PACKAGER} -maintainer="$MAINTAINER" +# Maintainer:${MAINTAINER:+" "}${MAINTAINER} pkgname=$pkgname pkgver=$pv pkgrel=0 diff --git a/sample.APKBUILD b/sample.APKBUILD index 5341fb43b2cd912b343f2824280f1de026d88be6..2489dea2ab6d7ba3d15db59735d500240ac44127 100644 --- a/sample.APKBUILD +++ b/sample.APKBUILD @@ -2,7 +2,7 @@ # and remove these comments. # Contributor: Your Name <youremail@domain.com> -maintainer="Your Name <youremail@domain.com>" +# Maintainer: Your Name <youremail@domain.com> pkgname=NAME pkgver=VERSION pkgrel=0 diff --git a/tests/abuild_test b/tests/abuild_test index ba1ed823e8e72687269f1054aad2daf5f1f10515..d7e4a5ebb9b69809e37b42de99d8e1a68ae1daa2 100755 --- a/tests/abuild_test +++ b/tests/abuild_test @@ -98,7 +98,7 @@ abuild_build_fail_body() { init_keys mkdir buildfail cat >buildfail/APKBUILD <<-EOF - maintainer="Joe User <juser@example.com>" + # Maintainer: Joe User <juser@example.com> pkgname="buildfail" pkgver="1.0" pkgrel=0 @@ -129,7 +129,7 @@ abuild_invalid_filename_body() { mkdir invalid-filename cd invalid-filename cat >APKBUILD <<-EOF - maintainer="Joe User <juser@example.com>" + # Maintainer: Joe User <juser@example.com> pkgname="invalid-filename" pkgver="1.0" pkgrel=0 @@ -161,7 +161,7 @@ abuild_usr_lib64_body() { mkdir lib64test cd lib64test cat >APKBUILD <<-EOF - maintainer="Joe User <juser@example.com>" + # Maintainer: Joe User <juser@example.com> pkgname="lib64test" pkgver="1.0" pkgrel=0 @@ -299,7 +299,7 @@ abuild_subpkg_dep_leak_body() { mkdir -p testrepo/subpkg-dep-leak cd testrepo/subpkg-dep-leak cat > APKBUILD <<-EOF - maintainer="Natanael Copa <ncopa@alpinelinux.org>" + # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname="subpkg-dep-leak" pkgver=1.0 pkgrel=0 @@ -398,7 +398,7 @@ abuild_reject_init_with_improper_shebang_body() { mkdir invalid-initd cd invalid-initd cat >APKBUILD<<-EOF - maintainer="Natanael Copa <ncopa@alpinelinux.org>" + # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname="invalid-initd" pkgver="1.0" pkgrel=0 @@ -591,7 +591,7 @@ abuild_git_ceiling_body() { mkdir git-pkg cd git-pkg cat >APKBUILD<<-EOF - maintainer="Joe User <juser@example.com>" + # Maintainer: Joe User <juser@example.com> pkgname="git-pkg" pkgver="1.0" pkgrel=0 @@ -621,7 +621,7 @@ abuild_package_size_body() { cd test-size cat > APKBUILD <<-EOF - maintainer="Test User 123 <123@example.com>" + # Maintainer: Test User 123 <123@example.com> # test package pkgname="test-size" @@ -731,7 +731,7 @@ abuild_keepdirs_body() { cd test-amove cat > APKBUILD <<-EOF - maintainer="Test User 123 <123@example.com>" + # Maintainer: Test User 123 <123@example.com> # test package pkgname="test-keepdirs" @@ -757,7 +757,7 @@ abuild_amove_body() { cd test-amove cat > APKBUILD <<-EOF - maintainer="Test User 123 <123@example.com>" + # Maintainer: Test User 123 <123@example.com> # test package pkgname="test-amove" @@ -853,7 +853,7 @@ abuild_doc_body() { cd foo cat > APKBUILD <<-EOF - maintainer="Test User 123 <123@example.com>" + # Maintainer: Test User 123 <123@example.com> # test package pkgname="foo" pkgver="1.0" @@ -891,7 +891,7 @@ abuild_dev_body() { cd foo cat > APKBUILD <<-EOF - maintainer="Test User 123 <123@example.com>" + # Maintainer: Test User 123 <123@example.com> # test package pkgname="foo" pkgver="1.0" @@ -930,7 +930,7 @@ abuild_devhelp_warn_body() { cd foo cat > APKBUILD <<-EOF - maintainer="Test User 123 <123@example.com>" + # Maintainer: Test User 123 <123@example.com> pkgname="foo" pkgver="1.0" pkgrel=0 @@ -953,7 +953,7 @@ abuild_devhelp_body() { cd foo cat > APKBUILD <<-EOF - maintainer="Test User 123 <123@example.com>" + # Maintainer: Test User 123 <123@example.com> pkgname="foo" pkgver="1.0" pkgrel=0 @@ -981,14 +981,14 @@ abuild_check_maintainer_body() { "Trailing Space <n@example.com> " \ "Foo<u@example.com>" \ '"Quotes <u@example.com>"'; do - printf "maintainer='%s'\npkgname=foo\n" "${m//"'"/"'\\''"}" > APKBUILD + printf "# Maintainer: %s\n%s\n" "$m" "pkgname=foo" > APKBUILD atf_check -s not-exit:0 \ -e match:"ERROR:" \ abuild check_maintainer done for m in "Test User <123@example.com>" "Foo O'Brian <n@example.com>" "Åukasz Something <s@example.com>"; do - printf "maintainer='%s'\npkgname=foo\n" "${m//"'"/"'\\''"}" > APKBUILD + printf "# Maintainer: %s\n%s\n" "$m" "pkgname=foo" > APKBUILD atf_check abuild check_maintainer done } @@ -1000,7 +1000,7 @@ abuild_cleanoldpkg_body() { for arch in aarch64 x86_64; do for v in 0.9 1.0 1.1; do cat > APKBUILD <<-EOF - maintainer="Test User 123 <123@example.com>" + # Maintainer: Test User 123 <123@example.com> # test package pkgname="foo" pkgver="$v" @@ -1063,7 +1063,7 @@ abuild_pyc_warn_body() { mkdir -p pycachetest cd pycachetest cat >APKBUILD <<-EOF - maintainer="Joe User <juser@example.com>" + # Maintainer: Joe User <juser@example.com> pkgname="pycachetest" pkgver="1.0" pkgrel=0 @@ -1088,7 +1088,7 @@ abuild_pyc_body() { mkdir -p foo cd foo cat >APKBUILD <<-EOF - maintainer="Joe User <juser@example.com>" + # Maintainer: Joe User <juser@example.com> pkgname="foo" pkgver="1.0" pkgrel=0 @@ -1137,7 +1137,7 @@ abuild_command_provides_body() { mkdir testprovides cd testprovides cat >APKBUILD<<-EOF - maintainer="Natanael Copa <ncopa@alpinelinux.org>" + # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=testprovides pkgver=1.0 pkgrel=0 @@ -1172,7 +1172,7 @@ abuild_gocache_dir_body() { mkdir gocache-dir cd gocache-dir cat >APKBUILD<<-EOF - maintainer="Joe User <juser@example.com>" + # Maintainer: Joe User <juser@example.com> pkgname="gocache-dir" pkgver="1.0" pkgrel=0 @@ -1203,7 +1203,7 @@ abuild_cargo_home_dir_body() { mkdir cargo-home-dir cd cargo-home-dir cat >APKBUILD<<-EOF - maintainer="Joe User <juser@example.com>" + # Maintainer: Joe User <juser@example.com> pkgname="cargo-home-dir" pkgver="1.0" pkgrel=0 @@ -1234,7 +1234,7 @@ abuild_fish_comp_split_body() { mkdir fish-split-dir cd fish-split-dir cat >APKBUILD<<-EOF - maintainer="Joe User <juser@example.com>" + # Maintainer: Joe User <juser@example.com> pkgname="fish-split-dir" pkgver="1.0" pkgrel=0 @@ -1291,7 +1291,7 @@ abuild_deps_body() { mkdir testdeps cd testdeps cat >APKBUILD <<-EOF - maintainer="Joe User <juser@example.com>" + # Maintainer: Joe User <juser@example.com> pkgname="testdeps" pkgver="1.0" pkgrel=0 @@ -1351,7 +1351,7 @@ abuild_usr_merge_body() { mkdir usrmergetest cd usrmergetest cat >APKBUILD <<-EOF - maintainer="Joe User <juser@example.com>" + # Maintainer: Joe User <juser@example.com> pkgname="usrmergetest" pkgver="1.0" pkgrel=0 diff --git a/tests/abump_test b/tests/abump_test index d59dda00287099f2fa375ef976703ceefdeb3e9d..eadf173561adfb088d3f0111558ec107915f6312 100755 --- a/tests/abump_test +++ b/tests/abump_test @@ -40,7 +40,7 @@ abump_simple_bump_body() { cd main/foo echo "first" > foo-1.0.txt cat > APKBUILD <<-EOF - maintainer="Test user <user@example.com>" + # Maintainer: Test user <user@example.com> pkgname="foo" pkgver=1.0 pkgrel=0 @@ -84,7 +84,7 @@ abump_isolates_apkbuild_body() { cd main/bar echo "first" > bar-1.0.txt cat > APKBUILD <<-"EOF" - maintainer="Test user <user@example.com>" + # Maintainer: Test user <user@example.com> pkgname="bar" pkgver=1.0 pkgrel=0 diff --git a/tests/testrepo/dbgpkg/APKBUILD b/tests/testrepo/dbgpkg/APKBUILD index 9782fb7e0b6c25cc477e4abae7409ab9176bc0d5..e090c35fe281c1ecf2dc822f11d3139bae3df27b 100644 --- a/tests/testrepo/dbgpkg/APKBUILD +++ b/tests/testrepo/dbgpkg/APKBUILD @@ -1,4 +1,4 @@ -maintainer="Natanael Copa <ncopa@alpinelinux.org>" +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # test package pkgname="dbgpkg" diff --git a/tests/testrepo/invalid-filename/APKBUILD b/tests/testrepo/invalid-filename/APKBUILD index ecf368da7caeb86b2bd32d7892b6c1a97eb310a8..97931884cf1d4bf56ebefc3f7d788e25e2b0d35b 100644 --- a/tests/testrepo/invalid-filename/APKBUILD +++ b/tests/testrepo/invalid-filename/APKBUILD @@ -1,4 +1,4 @@ -maintainer="Natanael Copa <ncopa@alpinelinux.org>" +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # test package pkgname="invalid-filename" diff --git a/tests/testrepo/large-doc-subpkg/APKBUILD b/tests/testrepo/large-doc-subpkg/APKBUILD index 623c4b2f9db33433ea67216a318a7a105366a871..631d3757e2a172b9a3d402212667c9e02552fcf4 100644 --- a/tests/testrepo/large-doc-subpkg/APKBUILD +++ b/tests/testrepo/large-doc-subpkg/APKBUILD @@ -1,4 +1,4 @@ -maintainer="Natanael Copa <ncopa@alpinelinux.org>" +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # test package pkgname="large-doc-subpkg" diff --git a/tests/testrepo/lib64test/APKBUILD b/tests/testrepo/lib64test/APKBUILD index 0f3c1d7ad435d0cbb152f4b0848b43f81c256930..7da888f432d77b97731186515c46602464e4ec2e 100644 --- a/tests/testrepo/lib64test/APKBUILD +++ b/tests/testrepo/lib64test/APKBUILD @@ -1,4 +1,4 @@ -maintainer="Natanael Copa <ncopa@alpinelinux.org>" +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # test package pkgname="lib64test" diff --git a/tests/testrepo/pkg path with spaces/APKBUILD b/tests/testrepo/pkg path with spaces/APKBUILD index 70afebc6d4dbcbc2e2120957c58a309b33b71bb9..9a1687ac4be5afbe02b996c8aeeea179d947b837 100644 --- a/tests/testrepo/pkg path with spaces/APKBUILD +++ b/tests/testrepo/pkg path with spaces/APKBUILD @@ -1,4 +1,4 @@ -maintainer="Natanael Copa <ncopa@alpinelinux.org>" +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # test package pkgname="pkg-path-with-spaces" diff --git a/tests/testrepo/pkg1/APKBUILD b/tests/testrepo/pkg1/APKBUILD index 60b9efdf713f9d681b45dac4e157ffba1de256f4..a87d7d0247d7bd29943600366b0c654e927310c3 100644 --- a/tests/testrepo/pkg1/APKBUILD +++ b/tests/testrepo/pkg1/APKBUILD @@ -1,4 +1,4 @@ -maintainer="Natanael Copa <ncopa@alpinelinux.org>" +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # test package pkgname="pkg1" diff --git a/tests/testrepo/py3 foo and bar/APKBUILD b/tests/testrepo/py3 foo and bar/APKBUILD index 1bb3802471219e16b3a1f679660e010e556af32b..28837a7355a31b7a86a4eff4ef2afd626605620d 100644 --- a/tests/testrepo/py3 foo and bar/APKBUILD +++ b/tests/testrepo/py3 foo and bar/APKBUILD @@ -1,4 +1,4 @@ -maintainer="Test user <user@example.com>" +# Maintainer: Test user <user@example.com> pkgname=py3-foo-and-bar pkgver=1.0.0 pkgrel=0 diff --git a/tests/testrepo/py3-conflicting-python-versions/APKBUILD b/tests/testrepo/py3-conflicting-python-versions/APKBUILD index d4f72368fde33c0b69f26ca48ae233057cf963c8..12190b098473b7dca08f43917fb14fa8b52b7dd9 100644 --- a/tests/testrepo/py3-conflicting-python-versions/APKBUILD +++ b/tests/testrepo/py3-conflicting-python-versions/APKBUILD @@ -1,4 +1,4 @@ -maintainer="Test user <user@example.com>" +# Maintainer: Test user <user@example.com> pkgname=py3-conflicting-python-versions pkgver=1.0.0 pkgrel=0 diff --git a/tests/testrepo/setcap/APKBUILD b/tests/testrepo/setcap/APKBUILD index d6f9d4b8f3284b2b7db7133878e0709d6993ec99..6d5eb882f45d63b49a3e25f10d8aaf6e93373756 100644 --- a/tests/testrepo/setcap/APKBUILD +++ b/tests/testrepo/setcap/APKBUILD @@ -1,4 +1,4 @@ -maintainer="Natanael Copa <ncopa@alpinelinux.org>" +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # test package pkgname=setcap diff --git a/tests/testrepo/subpackage-arch/APKBUILD b/tests/testrepo/subpackage-arch/APKBUILD index ace5945525687295bd7e850c3f15507024316e3a..a4db324d3751a186b4fa5c2f7b1cd53a58374eed 100644 --- a/tests/testrepo/subpackage-arch/APKBUILD +++ b/tests/testrepo/subpackage-arch/APKBUILD @@ -1,4 +1,4 @@ -maintainer="Natanael Copa <ncopa@alpinelinux.org>" +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # test package pkgname=${TESTNAME-test-pkgname} diff --git a/tests/testrepo/test-licenses/APKBUILD b/tests/testrepo/test-licenses/APKBUILD index 947c46ef08713a97c63caccf6fe39b7cff77c172..0d954b7a7ccc57b298c9f0ca53553b8957a790e4 100644 --- a/tests/testrepo/test-licenses/APKBUILD +++ b/tests/testrepo/test-licenses/APKBUILD @@ -1,4 +1,4 @@ -maintainer="Olliver Schinagl <oliver@schinagl.nl>" +# Maintainer: Olliver Schinagl <oliver@schinagl.nl> # test package pkgname="${TESTNAME-test-licenses}" diff --git a/tests/testrepo/test-pkgname/APKBUILD b/tests/testrepo/test-pkgname/APKBUILD index 95068da4e77adf75ace8725ba9386bd97eb10389..e643acda10df38f3ba7ba5ef491f7c50e86629f6 100644 --- a/tests/testrepo/test-pkgname/APKBUILD +++ b/tests/testrepo/test-pkgname/APKBUILD @@ -1,4 +1,4 @@ -maintainer="Natanael Copa <ncopa@alpinelinux.org>" +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # test package pkgname=${TESTNAME-test-pkgname}