File: makeaspatch

package info (click to toggle)
afterstep 2.2.12-18.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,184 kB
  • sloc: ansic: 201,695; sh: 5,894; xml: 3,721; makefile: 2,094; perl: 1,558; cpp: 811
file content (60 lines) | stat: -rwxr-xr-x 2,053 bytes parent folder | download | duplicates (9)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh

# personnal preferences
ASDIR=/usr/src/AfterStep
ASDEVNAME=AfterStep-devel
ASCURNAME=AfterStep-current
PATCH=/tmp/patch

# make sure we do this in the right dir
cd $ASDIR

# remove the old devel version, and copy the new one
rm -rf ${ASCURNAME}2 ${ASCURNAME}-2
cp -r ${ASDEVNAME} ${ASCURNAME}-2

# clean out the directories we'll be making the patch from
(cd ${ASCURNAME} && tools/makeasclean)
(cd ${ASCURNAME}-2 && tools/makeasclean)

# make the patch
diff -N -u -r ${ASCURNAME} ${ASCURNAME}-2 > ${PATCH}

# check for c++-style comments
if grep -q "//" ${PATCH}; then
  echo "Warning!  Possible C++ comment(s) detected."
  fi

# try to make sure there's a ChangeLog entry
if ! grep -q "ChangeLog" ${PATCH}; then
  echo "Warning!  No ChangeLog entry detected."
  fi

# check the patch for files with no newline at the end; such files confuse 
# the various versions of patch
if grep -q "\\ No newline at end of file" ${PATCH}; then
  echo "Warning!  Files with no newline at the end detected in patch."
  echo "Please be sure all files have newlines at the end, otherwise some"
  echo "versions of patch will be confused."
  fi

# try to make sure "make config" was run if configure.in was changed
if grep -q "configure.in" ${PATCH} && ! grep -q "configure " ${PATCH}; then
  echo "Warning!  Changes to configure.in detected, but configure does"
  echo "not appear to be changed.  Please be sure to run:"
  echo "make config"
  echo "to update the configure script."
elif test ${ASDEVNAME}/configure -ot ${ASDEVNAME}/autoconf/configure.in; then
  echo "Warning!  configure appears to be older than configure.in.  Please"
  echo "be sure to run:"
  echo "make config"
  echo "to update the configure script."
fi

# try to make sure that the version number was changed
if ! grep -q "version=" ${PATCH}; then
  echo "Warning!  No change to version number detected.  Please change the"
  echo "version number with:"
  echo "makeasversion major.minor.patchlevel"
  echo "by incrementing the patchlevel.  For example, 1.7.0 would become 1.7.1."
fi