Updated hint
[linux_from_scratch_hints.git] / MAINTAINER / checkHint
blob9f41db10a36d95869414271702ac6f680c91ed19
1 #!/bin/sh
2 # [Based on the website script by Olivier Pérès]
3 # [Modified by Tushar Teredesai]
4 # [License: GPL]
5 #
6 # Script to verify that the hint meets the basic formatting standards.
7 # Additional checks are performed by the maintainer before committing.
8 # The section checks if all the required sections are present in the
9 # hint file.
11 # It outputs the sections that are used for the online hint index.
12 # Verify the output for correctness.
14 if [ "$DEBUG" = "yes" ]
15 then
16 set -x
19 if [ "$1" = "" ]
20 then
21 echo "ERROR: Hint File not specified."
22 echo "Usage: `basename $0` hint_file.txt"
23 exit 1
25 HINT_FILE="$1"
26 if [ ! -f "$HINT_FILE" ]
27 then
28 echo "ERROR: Hint File not found"
29 exit 1
32 AUTHORS=`echo \`grep "^AUTHOR:" $HINT_FILE | cut -f2 -d: | sed 's/$/,/'\` | sed 's/,$//'`
33 DATE=`echo \`grep -h "^DATE:" $HINT_FILE | cut -f2 -d:\``
34 LICENSE=`echo \`grep -h "^LICENSE:" $HINT_FILE | cut -f2 -d:\``
35 SYNOPSIS=`echo \`grep -h "^SYNOPSIS:" $HINT_FILE | cut -f2 -d:\``
36 DESCRIPTION=`grep -h "^DESCRIPTION:" $HINT_FILE`
37 PREREQUISITES=`grep -h "^PREREQUISITES:" $HINT_FILE`
38 HINT=`grep -h "^HINT:" $HINT_FILE`
39 CHANGELOG=`grep -h "^CHANGELOG:" $HINT_FILE`
40 if [ -z "$AUTHORS" ]
41 then
42 echo "No author specified..."
43 else
44 echo "Authors: $AUTHORS"
46 if [ -z "$DATE" ]
47 then
48 echo "DATE is missing..."
49 else
50 echo "Date: $DATE"
52 if [ -z "$LICENSE" ]
53 then
54 echo "LICENSE is missing..."
55 else
56 echo "License: $LICENSE"
58 if [ -z "$SYNOPSIS" ]
59 then
60 echo "SYNOPSIS is missing..."
61 else
62 echo "Synopsis: $SYNOPSIS"
64 if [ -z "$DESCRIPTION" ]
65 then
66 echo "DESCRIPTION is missing..."
68 if [ -z "$PREREQUISITES" ]
69 then
70 echo "PREREQUISITES is missing..."
72 if [ -z "$HINT" ]
73 then
74 echo "HINT is missing..."
76 if [ -z "$CHANGELOG" ]
77 then
78 echo "CHANGELOG is missing..."