#!/bin/sh

# make sure we do this in the right dir
cd /usr/src/AfterStep

# remove the old devel version, and copy the new one
rm -rf ascp-current2
cp -r ascp-devel ascp-current2

# clean out the directories we'll be making the patch from
cd ascp-current
makeascpclean
cd ..
cd ascp-current2
makeascpclean
cd ..

# make the patch
diff -N -u -r ascp-current ascp-current2 > /tmp/patch

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

# try to make sure there's a ChangeLog entry
if grep -q "ChangeLog" /tmp/patch; then
  # do nothing
  echo "" > /dev/null
  else
  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" /tmp/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
#!/bin/sh

# make sure we do this in the right dir
cd /usr/src/AfterStep

# remove the old devel version, and copy the new one
rm -rf ascp-current2
cp -r ascp-devel ascp-current2

# clean out the directories we'll be making the patch from
cd ascp-current
makeascpclean
cd ..
cd ascp-current2
makeascpclean
cd ..

# make the patch
diff -N -u -r ascp-current ascp-current2 > /tmp/patch

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

# try to make sure there's a ChangeLog entry
if grep -q "ChangeLog" /tmp/patch; then
  # do nothing
  echo "" > /dev/null
  else
  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" /tmp/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
