[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
www/proprietary/workshop item-create
From: |
Therese Godefroy |
Subject: |
www/proprietary/workshop item-create |
Date: |
Tue, 30 Oct 2018 10:02:08 -0400 (EDT) |
CVSROOT: /webcvs/www
Module name: www
Changes by: Therese Godefroy <th_g> 18/10/30 10:02:07
Modified files:
proprietary/workshop: item-create
Log message:
Move duplication test to the beginning; improve malware-count update.
CVSWeb URLs:
http://web.cvs.savannah.gnu.org/viewcvs/www/proprietary/workshop/item-create?cvsroot=www&r1=1.2&r2=1.3
Patches:
Index: item-create
===================================================================
RCS file: /webcvs/www/www/proprietary/workshop/item-create,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- item-create 28 Oct 2018 09:59:12 -0000 1.2
+++ item-create 30 Oct 2018 14:02:07 -0000 1.3
@@ -52,6 +52,12 @@
elif [[ "$files" =~ 'proprietary.html' ]]; then
echo 1>&2 "!!! proprietary.html is not a primary target for malware items."
sleep 5; exit 1
+elif grep -q "$id" mal.rec; then
+ echo 1>&2 "!!! An item with same Id is already in mal.rec.
+ - If the two items are different, please change the last digit.
+ - If you are editing an item that has been added already, you should
+ do it in mal.rec, and regenerate the pages with malgen. See README.md."
+ sleep 10; exit 1
fi
files=$(awk '/Target:/ {print $2}' item)
@@ -106,27 +112,21 @@
## REC version
-# Check that the recfile doesn't already have an item with same Id.
-if grep -q "$id" mal.rec; then
- echo 1>&2 " $id is already in mal.rec."
-else
-
- # Convert item to rec format.
- sed -e '/^Blurb:/ {N; s,\n[ ]\+<, <,}' \
+# Convert to rec format.
+sed -e '/^Blurb:/ {N; s,\n[ ]\+<, <,}' \
-e 's,^ ,+,' \
-e 's,^$,+,' $temp2 > item.rec
- # Create the 'Added' field.
- today=$(date +'%Y-%m-%d')
- sed -i "/^Id:/ s,^,\\nAdded: $today\\n", item.rec
-
- # Add the item to the recfile, but don't make this permanent before
- # checking HTML addition.
- sed '/^# ADD NEW BLURB HERE/r item.rec' mal.rec > mal.rec.temp
- if ! grep -q "$id" mal.rec.temp; then
+# Create the 'Added' field.
+today=$(date +'%Y-%m-%d')
+sed -i "/^Id:/ s,^,\\nAdded: $today\\n", item.rec
+
+# Add the item to the recfile, but don't make this permanent before
+# checking HTML addition.
+sed '/^# ADD NEW BLURB HERE/r item.rec' mal.rec > mal.rec.temp
+if ! grep -q "$id" mal.rec.temp; then
echo 1>&2 "!!! $id couldn't be added to mal.rec."
sleep 5; exit 2
- fi
fi
@@ -225,19 +225,23 @@
l=$((link_count/50))
l=$((l*50))
+# Update item and link count in proprietary.html and
+# free-software-even-more-important.html, as needed.
+month=$(date +'%B, %Y')
if grep -v "list around $i" ../proprietary.html > /dev/null &&
grep -v "more than $l references" ../proprietary.html > /dev/null; then
-# Update item and link count in proprietary.html and
-# free-software-even-more-important.html.
- month=$(date +'%B, %Y')
sed -i "
s|As of .*, the pages in this directory list .*$|As of $month, the pages in
this directory list around $i|
s|functionalities (with .* references|functionalities (with more than $l
references|
" ../proprietary.html
-
+ echo "Malware count was updated in proprietary.html."
+fi
+if grep -v "lists around $i different" \
+ ../../philosophy/free-software-even-more-important.html > /dev/null; then
sed -i "
s|That directory lists around .* different|That directory lists around $i
different|
s|malicious functionalities (as of .*),|malicious functionalities (as of
$month),|
" ../../philosophy/free-software-even-more-important.html
+ echo "Malware count was updated in free-software-even-more-important.html."
fi
exit 0