diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2017-07-20 08:11:00 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2017-07-20 08:45:25 +0000 |
commit | a008382659bb958b2693b701e7e042c20f039c6b (patch) | |
tree | cae9f06c6ff5c279aea225dcf9b58d4f4b835a25 /main/abuild | |
parent | d9b200e3dd0b2a723993f2e6d625bdd54e96a041 (diff) | |
download | aports-a008382659bb958b2693b701e7e042c20f039c6b.tar.bz2 aports-a008382659bb958b2693b701e7e042c20f039c6b.tar.xz |
abuild: backport sanitycheck of secfixes comment
Diffstat (limited to 'main/abuild')
-rw-r--r-- | main/abuild/0001-abuild-add-sanitycheck-for-secfixes-comment.patch | 53 | ||||
-rw-r--r-- | main/abuild/APKBUILD | 6 |
2 files changed, 57 insertions, 2 deletions
diff --git a/main/abuild/0001-abuild-add-sanitycheck-for-secfixes-comment.patch b/main/abuild/0001-abuild-add-sanitycheck-for-secfixes-comment.patch new file mode 100644 index 0000000000..12c4aebe91 --- /dev/null +++ b/main/abuild/0001-abuild-add-sanitycheck-for-secfixes-comment.patch @@ -0,0 +1,53 @@ +From 1efaa3996e7f722ad05d67982b5b3ea78441dd41 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Thu, 20 Jul 2017 07:56:11 +0000 +Subject: [PATCH] abuild: add sanitycheck for secfixes comment + +The secfixes comment will be parsed and added to alpine-secdb. add +sanitycheck so we catch errors early. +--- + abuild.in | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/abuild.in b/abuild.in +index 7cf87e2..53926fc 100644 +--- a/abuild.in ++++ b/abuild.in +@@ -219,6 +219,7 @@ default_sanitycheck() { + check_maintainer || die "Provide a valid RFC822 maintainer address" + + check_depends_dev || warning "depends_dev found but no development subpackage found" ++ check_secfixes_comment || return 1 + + makedepends_has 'g++' && ! options_has toolchain && warning "g++ should not be in makedepends" + return 0 +@@ -816,6 +817,26 @@ check_maintainer() { + fi + } + ++check_secfixes_comment() { ++ local c=$(sed -E -n -e '/^# secfixes:/,/(^[^#]|^$)/p' $APKBUILD | grep '^#') ++ local invalid=$(echo "$c" \ ++ | grep -v -E '(^# secfixes:|^# +- [A-Z0-9-]+|^# [0-9]+.*:$|^#$)') ++ if [ -z "$invalid" ]; then ++ return 0 ++ fi ++ ++ # check if there are tabs ++ if echo "$invalid" | grep -q $'\t'; then ++ error "secfixes comment must not have tabs:" ++ echo "$c" | grep $'\t' >&2 ++ return 1 ++ fi ++ ++ error "secfixes comment is not valid:" ++ echo "$invalid" >&2 ++ return 1 ++} ++ + check_depends_dev() { + if [ -z "$depends_dev" ]; then + return 0 +-- +2.13.2 + diff --git a/main/abuild/APKBUILD b/main/abuild/APKBUILD index 3e24ef42d7..8185f162da 100644 --- a/main/abuild/APKBUILD +++ b/main/abuild/APKBUILD @@ -2,7 +2,7 @@ pkgname=abuild pkgver=3.0.0_rc4 _ver=${pkgver%_git*} -pkgrel=0 +pkgrel=1 pkgdesc="Script to build Alpine Packages" url="http://git.alpinelinux.org/cgit/abuild/" arch="all" @@ -21,6 +21,7 @@ subpackages="apkbuild-cpan:cpan:noarch apkbuild-gem-resolver:gems:noarch options="suid !check" pkggroups="abuild" source="http://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.xz + 0001-abuild-add-sanitycheck-for-secfixes-comment.patch " builddir="$srcdir/$pkgname-$_ver" @@ -67,4 +68,5 @@ _rootbld() { mkdir -p "$subpkgdir" } -sha512sums="e3b3827b7c3ebdc5d8ab39b1fc514a3cc0ed75a6d5ebc86c9d986441a7a16c1a3aa11f9840c35aa7f000a593421fdc9804b3608d7247f0b4686ba48cc898846a abuild-3.0.0_rc4.tar.xz" +sha512sums="e3b3827b7c3ebdc5d8ab39b1fc514a3cc0ed75a6d5ebc86c9d986441a7a16c1a3aa11f9840c35aa7f000a593421fdc9804b3608d7247f0b4686ba48cc898846a abuild-3.0.0_rc4.tar.xz +94cdfba2c185e96d3a631b36f5b438fd95f90a73b06cbb4afa7864454e05b7c91f6e7a905d7ec73e39fdcf2ab050a7ca59129621dabb39bdc0e2bf2ba38871a0 0001-abuild-add-sanitycheck-for-secfixes-comment.patch" |