PLD-doc: PLDSA/send-sa - errorchecks

glen glen at pld-linux.org
Tue Jun 6 12:29:03 CEST 2006


Author: glen                         Date: Tue Jun  6 10:29:03 2006 GMT
Module: PLD-doc                       Tag: HEAD
---- Log message:
- errorchecks

---- Files affected:
PLD-doc/PLDSA:
   send-sa (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: PLD-doc/PLDSA/send-sa
diff -u PLD-doc/PLDSA/send-sa:1.2 PLD-doc/PLDSA/send-sa:1.3
--- PLD-doc/PLDSA/send-sa:1.2	Sun Jun  4 22:08:14 2006
+++ PLD-doc/PLDSA/send-sa	Tue Jun  6 12:28:58 2006
@@ -31,9 +31,12 @@
 
 sa_id=$(echo "$sa_file" | sed -e 's,.*db/\([^/]\+\)/\([^.]\+\).*,\1-\2,')
 date=$(date +%Y-%m-%d)
-announce_mail="glen at pld-linux.org"
+announce_mail="glen at delfi.ee"
 
 gen_sa() {
+	local body
+	body=$(gen_md5) || exit $?
+
 	cat <<-EOF
 	Subject: [PLDSA $sa_id] $subject
 	To: $announce_mail
@@ -42,7 +45,7 @@
 	cat "$sa_file" | sed -e "
 	s/%{date}/$date/
 	"
-	gen_md5
+	echo "$body"
 }
 
 get_package() {
@@ -57,6 +60,11 @@
 	if [ ! -f $infofile ]; then
 		$(wget -q -O "$infofile" "$url")
 	fi
+	[ -s "$infofile" ] || rm -f "$infofile"
+	if [ ! -f "$infofile" ]; then
+		echo >&2 "Infofile $infofile missing (package not moved to main?)"
+		exit 1
+	fi
 	cat "$infofile"
 }
 
@@ -72,11 +80,14 @@
 }
 
 gen_md5() {
+	set -x
+	local cur info
+	info=$(get_info) || exit $?
+
 	local ifs="$IFS"
 	IFS=':'
 	disturl="ftp://ftp.pld-linux.org/dists/ac/PLD"
-	local cur
-	get_info | grep '^file:' | while read tag arch file; do
+	echo "$info" | grep '^file:' | while read tag arch file; do
 		if [ "$arch" = SRPMS ]; then
 			url="$disturl/SRPMS/SRPMS/$file"
 		else
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/PLD-doc/PLDSA/send-sa?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list