[SVN] r2992 - trunk/tools/dar/scripts

svn-commits at rpmforge.net svn-commits at rpmforge.net
Fri Mar 11 17:56:48 CET 2005


Author: dag
Date: 2005-03-11 17:56:46 +0100 (Fri, 11 Mar 2005)
New Revision: 2992

Added:
   trunk/tools/dar/scripts/pre-description.sh
Modified:
   trunk/tools/dar/scripts/pre-disttag.sh
   trunk/tools/dar/scripts/pre-svn-rev.sh
Log:
Updates

Added: trunk/tools/dar/scripts/pre-description.sh
===================================================================
--- trunk/tools/dar/scripts/pre-description.sh	2005-03-11 16:50:04 UTC (rev 2991)
+++ trunk/tools/dar/scripts/pre-description.sh	2005-03-11 16:56:46 UTC (rev 2992)
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+### This script adds an RPMforge banner to the description of the package.
+
+#echo "** pre-svn-rev: OrigSpecfile: $origspecfile, Specfile: $specfile"
+#set -x
+
+#perl -pi.orig -0 -e 's|\n%changelog\n(\*\s.+)\n|\n%changelog\n$1 - '$revision'/'$author'\n|' $specfile
+#  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
+# This package is part of the RPMforge community project. In case you have
+# an improvement or feedback about this package, please visit:
+#
+# 		http://rpmforge.net/user/package/$app/
+#
+# The person responsible for this package is:
+#
+#		http://rpmforge.net/developer/team/$author/
+
+#diff -u "$specfile".orig "$specfile"
+#set +x

Modified: trunk/tools/dar/scripts/pre-disttag.sh
===================================================================
--- trunk/tools/dar/scripts/pre-disttag.sh	2005-03-11 16:50:04 UTC (rev 2991)
+++ trunk/tools/dar/scripts/pre-disttag.sh	2005-03-11 16:56:46 UTC (rev 2992)
@@ -8,10 +8,10 @@
 
 case "$buildarch" in
 	(src)
-		perl -pi.orig -e 's|^(Release)\s*:\s+(.+)\s*$|$1: $2.'$repotag'\n|' "$specfile"
+		perl -pi.orig -e 's|^(Release)\s*:\s+([^\s]+)\s*$|$1: $2.'$repotag'\n|' "$specfile"
 		;;
 	(*)
-		perl -pi.orig -e 's|^(Release)\s*:\s+(.+)\s*$|$1: $2.'${disttag// *}'.'$repotag'\n|' "$specfile"
+		perl -pi.orig -e 's|^(Release)\s*:\s+([^\s]+)\s*$|$1: $2.'${disttag// *}'.'$repotag'\n|' "$specfile"
 		;;
 esac
 

Modified: trunk/tools/dar/scripts/pre-svn-rev.sh
===================================================================
--- trunk/tools/dar/scripts/pre-svn-rev.sh	2005-03-11 16:50:04 UTC (rev 2991)
+++ trunk/tools/dar/scripts/pre-svn-rev.sh	2005-03-11 16:56:46 UTC (rev 2992)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-### This scripts add the last change author and revision to the
+### This script adds the last change author and revision to the
 ### changelog of the SPEC file, so RPM packages include it.
 
 #echo "** pre-svn-rev: OrigSpecfile: $origspecfile, Specfile: $specfile"
@@ -8,20 +8,16 @@
 
 ### Get Author and Revision from original specfile
 info=""; author=""; revision=""
-set -- $(
-while [ -z "$info" ]; do
-	info="$(svn info $origspecfile 2>/dev/null)"
-	if [ "$info" ]; then
-		echo "$info" | grep -E '^Last Changed Author: ' | sed -e 's|Last Changed Author: ||'
-		echo "$info" | grep -E '^Last Changed Rev: ' | sed -e 's|Last Changed Rev: ||'
-		break
-	else
-		sleep 5
-	fi
-done
-)
-author="$1"; revision="$2"
 
+info="$(svn info $origspecfile 2>/dev/null)"
+if [ -z "$info" ]; then
+	echo "** pre-svn-rev: No SVN info found. Please commit this SPEC file." >&2
+	exit 0
+fi
+
+author="$(echo "$info" | grep -E '^Last Changed Author: ' | sed -e 's|Last Changed Author: ||')"
+revision="$(echo "$info" | grep -E '^Last Changed Rev: ' | sed -e 's|Last Changed Rev: ||')"
+
 #echo "** pre-svn-rev: Author: $author, Revision: $revision"
 
 ### Add Revision and Author to specfile




More information about the commits mailing list