File: pre-publish-send-email.example

package info (click to toggle)
git-publish 1.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 200 kB
  • sloc: python: 861; sh: 281; makefile: 5
file content (31 lines) | stat: -rwxr-xr-x 793 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Check RHEL downstream patch format
#
# Copyright (c) 2014 Red Hat, Inc.
#
# This work is licensed under the MIT License.  Please see the LICENSE file or
# http://opensource.org/licenses/MIT.

set -e
[ ! -d redhat/ ] && exit 0

patch_dir=$1

fail() {
	echo "Error: $@"
	exit 1
}

check() {
	regexp=$1
	errmsg=$2
	if ! grep -q "$regexp" $(ls "$patch_dir"/*.patch | head -n1); then
		fail "$errmsg"
	fi
}

check '^Subject: \[.*RH.*\]' 'missing RHEL/RHEV/RHV tag in Subject: line'
check '^Subject: \[.*qemu-kvm.*\]' 'missing qemu-kvm/qemu-kvm-rhev tag in Subject: line'
check '^\(Bugzilla\|BZ\): ' 'missing Bugzilla: header in cover letter'
check '^\(Brew\|BREW\): ' 'missing Brew: header in cover letter'
check '^\(Upstream\|UPSTREAM\): ' 'missing Upstream: header in cover letter'