You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by dr...@apache.org on 2019/04/02 02:09:27 UTC

svn commit: r1856792 - /httpd/site/trunk/tools/announce.sh

Author: druggeri
Date: Tue Apr  2 02:09:27 2019
New Revision: 1856792

URL: http://svn.apache.org/viewvc?rev=1856792&view=rev
Log:
A round of script fixes for the new format

Modified:
    httpd/site/trunk/tools/announce.sh

Modified: httpd/site/trunk/tools/announce.sh
URL: http://svn.apache.org/viewvc/httpd/site/trunk/tools/announce.sh?rev=1856792&r1=1856791&r2=1856792&view=diff
==============================================================================
--- httpd/site/trunk/tools/announce.sh (original)
+++ httpd/site/trunk/tools/announce.sh Tue Apr  2 02:09:27 2019
@@ -88,7 +88,7 @@ SHORT_STATUS=`cat "$private_base"/SECURI
 
 #Notice the grep for CVE<stuff> with a line-ending / (that gets stripped). This is needed in case
 #subsequent lines have a note referring to a file in the directory, too
-for dir in `echo "$SHORT_STATUS" | grep -o 'CVE.*/$' | sed -e 's/\///g'`;do
+for dir in `echo "$SHORT_STATUS" | grep -o '\- CVE.*$' | sed -e 's/\///g' -e 's/^- //g'`;do
 echo "Checking $dir..."
   #Flip the bit
   is_security_release=1
@@ -96,27 +96,30 @@ echo "Checking $dir..."
   #If this is in the section not-yet-ready for announce, apply the
   # patch before moving on to announcement generation
   if echo "$SHORT_STATUS" | sed -n '/CHANGES READY FOR REPLACEMENT/,/##/p' | grep "$dir" >/dev/null;then
-    #Apply our CHANGES updates
-    patch -p0 -d "$branch_base" < "$private_base"/SECURITY/$dir/CHANGES.diff 
-    patch -p0 -d "$release_base" < "$private_base"/SECURITY/$dir/CHANGES.diff 
-  fi
-
-  #Also check if there is a CHANGES entry that needs to be added
-  if test -f "$private_base"/SECURITY/$dir/CHANGES;then
-    for UPDATE_FILE in "$branch_base"/CHANGES "$release_base"/CHANGES;do
-      VERSION="$version" UPDATE_FILE="$UPDATE_FILE" STATUS_UPDATE=`cat "$private_base"/SECURITY/$dir/CHANGES` perl -e '
-        $ENV{STATUS_UPDATE} =~ s/^\s*$//g;
-        die "Status update not found!" if !$ENV{STATUS_UPDATE};
-        open(CHANGES, "$ENV{UPDATE_FILE}"); my @content=<CHANGES>; close(CHANGES);
-        foreach my $line (@content) {
-          print "$line";
-          if (!$added && $line =~ /Changes with Apache $ENV{VERSION}/i) {
-            print "\n$ENV{STATUS_UPDATE}\n";
+    #Apply our CHANGES updates via CHANGES.diff or CHANGES
+    #TODO: Verify that one and only one of the two options will be present at all times
+    if test -f "$private_base"/SECURITY/$dir/CHANGES.diff;then
+      patch -p0 -d "$branch_base" < "$private_base"/SECURITY/$dir/CHANGES.diff 
+      patch -p0 -d "$release_base" < "$private_base"/SECURITY/$dir/CHANGES.diff 
+    elif test -f "$private_base"/SECURITY/$dir/CHANGES;then
+      for UPDATE_FILE in "$branch_base"/CHANGES "$release_base"/CHANGES;do
+        VERSION="$version" UPDATE_FILE="$UPDATE_FILE" STATUS_UPDATE=`cat "$private_base"/SECURITY/$dir/CHANGES` perl -e '
+          $ENV{STATUS_UPDATE} =~ s/^\s*$//g;
+          die "Status update not found!" if !$ENV{STATUS_UPDATE};
+          open(CHANGES, "$ENV{UPDATE_FILE}"); my @content=<CHANGES>; close(CHANGES);
+          foreach my $line (@content) {
+            print "$line";
+            if (!$added && $line =~ /Changes with Apache $ENV{VERSION}/i) {
+              print "\n$ENV{STATUS_UPDATE}\n";
+            }
           }
-        }
-      ' > "$scratch"/tmp_status
-      mv "$scratch"/tmp_status "$UPDATE_FILE"
-    done
+        ' > "$scratch"/tmp_status
+        mv "$scratch"/tmp_status "$UPDATE_FILE"
+      done
+    else
+      echo "Missing CHANGES.diff or CHANGES file for $dir"
+      exit 1
+    fi
   fi
 
   #From start of file to "---"
@@ -342,6 +345,12 @@ if test -z "$NONINTERACTIVE";then
   echo "$release_base/Announcement$branch.html"
   echo "$private_base/SECURITY/STATUS"
   echo ""
+  if test $is_security_release = 1;then
+    echo "This release IS DETECTED TO BE A SECURITY RELEASE"
+  else
+    echo "This release is not detected to be a security release"
+  fi
+  echo ""
   echo "To proceed, simply exit the shell. If you DO NOT want to proceed, you can exit with a non-zero code like so:"
   echo "exit 1"
   echo ""