[csw-devel] SF.net SVN: gar:[2449] csw/mgar/gar

wbonnet at users.sourceforge.net wbonnet at users.sourceforge.net
Tue Dec 2 23:25:06 CET 2008


Revision: 2449
          http://gar.svn.sourceforge.net/gar/?rev=2449&view=rev
Author:   wbonnet
Date:     2008-12-02 22:25:06 +0000 (Tue, 02 Dec 2008)

Log Message:
-----------
Add bcc to uwatch at opencsw.org to keep a track of notification sent
Port modification to gar V2

Modified Paths:
--------------
    csw/mgar/gar/v1/gar.lib.mk
    csw/mgar/gar/v2/bin/mail2maintainer
    csw/mgar/gar/v2/bin/upstream_watch
    csw/mgar/gar/v2/gar.lib.mk

Modified: csw/mgar/gar/v1/gar.lib.mk
===================================================================
--- csw/mgar/gar/v1/gar.lib.mk	2008-12-02 22:17:29 UTC (rev 2448)
+++ csw/mgar/gar/v1/gar.lib.mk	2008-12-02 22:25:06 UTC (rev 2449)
@@ -140,7 +140,7 @@
 			  echo "Please consider updating your package." ; \
 			  echo ""; \
 			  echo "---"; \
-			  echo "upstream notification job"; } | $(GARBIN)/mail2maintainer -s '[svn] $(GARNAME) upstream update notification' $(GARNAME); \
+			  echo "upstream notification job"; } | $(GARBIN)/mail2maintainer -b uwatch at opencsw.org -s '[svn] $(GARNAME) upstream update notification' $(GARNAME); \
 	        else \
 #    			if [ ! -n '$(UFILES_REGEX)' ]; then \
 #				{ echo ""; \
@@ -151,7 +151,7 @@
 #				  echo "Please consider updating your package. Documentation is available from this link : http://www.opencsw.org" ; \
 #				  echo ""; \
 #				  echo "---"; \
-#				  echo "upstream notification job"; } | $(GARBIN)/mail2maintainer -s '[svn] $(GARNAME) upstream update notification' $(GARNAME); \
+#				  echo "upstream notification job"; } | $(GARBIN)/mail2maintainer -b uwatch at opencsw.org -s '[svn] $(GARNAME) upstream update notification' $(GARNAME); \
 #    			fi; \
        		fi; \
 	fi

Modified: csw/mgar/gar/v2/bin/mail2maintainer
===================================================================
--- csw/mgar/gar/v2/bin/mail2maintainer	2008-12-02 22:17:29 UTC (rev 2448)
+++ csw/mgar/gar/v2/bin/mail2maintainer	2008-12-02 22:25:06 UTC (rev 2449)
@@ -23,7 +23,7 @@
 function get_package_maintainer
 {
 	_PACKAGE="$1"
-	_MAINTAINER="`wget -q http://securebar.secure-tunnel.com/cgi-bin/nph-freebar.cgi/110110/http/www.blastwave.org/packages.php/$_PACKAGE -O- | grep Maintainer | sed -e "s,.*/maintainers/\([^\'\\\"]*\).*,\1,g"`"
+	_MAINTAINER="`wget -q http://www.opencsw.org/packages.php/$_PACKAGE -O- | grep Maintainer | sed -e "s,.*/maintainers/\([^\'\\\"]*\).*,\1,g"`"
 	
 	echo "$_MAINTAINER"
 }
@@ -38,7 +38,7 @@
 function maintainer2mail
 {
 	_MAINTAINER="$1"
-	echo "$_MAINTAINER at blastwave.org"
+	echo "$_MAINTAINER at opencsw.org"
 }
 
 PATH=$PATH:/opt/csw/bin:/usr/sfw/bin
@@ -46,7 +46,7 @@
 if [[ -z "$1" ]]; then
 	cat <<EOF
 Usage: mail2maintainer [mail options] package_name
-Given a blastwave package name, send an email to the maintainer.
+Given a package name, send an email to the maintainer.
 EOF
 	exit 1
 fi

Modified: csw/mgar/gar/v2/bin/upstream_watch
===================================================================
--- csw/mgar/gar/v2/bin/upstream_watch	2008-12-02 22:17:29 UTC (rev 2448)
+++ csw/mgar/gar/v2/bin/upstream_watch	2008-12-02 22:25:06 UTC (rev 2449)
@@ -14,7 +14,6 @@
 use Env;
 use Getopt::Long;
 
-
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 # Function : compare_versions
 # Purpose  : Compare version number of two software
@@ -91,7 +90,7 @@
 	$http_proxy_cmd = "set http:proxy $ENV{HTTP_PROXY};" if exists $ENV{HTTP_PROXY};
 	$http_proxy_cmd = "set http:proxy $ENV{http_proxy};" if exists $ENV{http_proxy};
 
-	open (FH, "lftp -q -c \"set net:timeout 10; set net:max-retries 1; $ftp_proxy_cmd $http_proxy_cmd open $url/ && ls\" 2>/dev/null |");
+	open (FH, "lftp -q -c \"set net:timeout 10; set net:max-retries 16; $ftp_proxy_cmd $http_proxy_cmd open $url/ && ls\" 2>/dev/null |");
 
 	while (my $line = <FH>) {
 		my @cols = split (/\s+/, $line);

Modified: csw/mgar/gar/v2/gar.lib.mk
===================================================================
--- csw/mgar/gar/v2/gar.lib.mk	2008-12-02 22:17:29 UTC (rev 2448)
+++ csw/mgar/gar/v2/gar.lib.mk	2008-12-02 22:25:06 UTC (rev 2449)
@@ -103,11 +103,10 @@
 
 #################### CHECKNEW RULES ####################
 
-# check a new upstream files are available
-
-UW_ARGS = $(addprefix -u ,$(MASTER_SITES))
-ifneq ($(UFILES_REGEX),)
-	FILES2CHECK = $(shell http_proxy=$(http_proxy) ftp_proxy=$(ftp_proxy) $(GARBIN)/upstream_watch $(UW_ARGS) $(addsuffix ',$(addprefix ',$(UFILES_REGEX))))
+UPSTREAM_MASTER_SITES ?= $(MASTER_SITES)
+UW_ARGS = $(addprefix -u ,$(UPSTREAM_MASTER_SITES))
+ifneq ($(UFILES_REGEX), "")    
+	FILES2CHECK = $(shell http_proxy=$(http_proxy) ftp_proxy=$(ftp_proxy) $(GARBIN)/upstream_watch $(UW_ARGS) $(addsuffix ',$(addprefix ',$(UFILES_REGEX)))) 
 else
 	FILES2CHECK = ""
 endif
@@ -124,7 +123,7 @@
 			fi; \
 			$(MAKE) checknew-$$FILE >/dev/null; \
 		done; \
-		if [ -n "$$NEW_FILES" ]; then \
+		if test -z "$$NEW_FILES" ; then \
 			{ echo ""; \
 			  echo "Hello dear $(GARNAME) maintainer,"; \
 			  echo ""; \
@@ -134,31 +133,60 @@
 			  echo "    $$NEW_FILES"; \
 			  echo ""; \
 			  echo "is/are available at the following url(s):"; \
-			  echo "    $(MASTER_SITES)"; \
+			  echo "    $(UPSTREAM_MASTER_SITES)"; \
 			  echo ""; \
 			  echo "Please consider updating your package." ; \
 			  echo ""; \
 			  echo "---"; \
-			  echo "upstream notification job"; } | $(GARBIN)/mail2maintainer -s '$(GARNAME) upstream update notification' $(GARNAME); \
-		fi; \
+			  echo "upstream notification job"; } | $(GARBIN)/mail2maintainer -b uwatch at opencsw.org -s '[svn] $(GARNAME) upstream update notification' $(GARNAME); \
+	        else \
+#    			if [ ! -n '$(UFILES_REGEX)' ]; then \
+#				{ echo ""; \
+#				  echo "Hello dear $(GARNAME) maintainer,"; \
+#				  echo ""; \
+#				  echo "The upstream notification job has detected that $(GARNAME) is not configured for automatic upstream file update detection."; \
+#				  echo ""; \
+#				  echo "Please consider updating your package. Documentation is available from this link : http://www.opencsw.org" ; \
+#				  echo ""; \
+#				  echo "---"; \
+#				  echo "upstream notification job"; } | $(GARBIN)/mail2maintainer -b uwatch at opencsw.org -s '[svn] $(GARNAME) upstream update notification' $(GARNAME); \
+#    			fi; \
+       		fi; \
 	fi
 	
-
 check-upstream: 
 	@if [ -n '$(FILES2CHECK)' ]; then \
 		NEW_FILES=""; \
+		PACKAGE_UP_TO_DATE=0; \
 		for FILE in $(FILES2CHECK) ""; do \
 			[ -n "$$FILE" ] || continue; \
-			if test -f $(COOKIEDIR)/checknew-$$FILE || echo $(DISTFILES) | grep -w $$FILE >/dev/null; then \
-				: ; \
+			if test -f $(COOKIEDIR)/checknew-$$FILE ; then \
+				PACKAGE_UP_TO_DATE=1; \
 			else \
-				NEW_FILES="$$FILE $$NEW_FILES"; \
+				if echo $(DISTFILES) | grep -w $$FILE >/dev/null; then \
+					PACKAGE_UP_TO_DATE=1; \
+	                echo "$(GARNAME) : Package is up-to-date. Current version is $$FILE" ; \
+				else \
+					NEW_FILES="$$FILE $$NEW_FILES"; \
+				fi; \
 			fi; \
 			$(MAKE) checknew-$$FILE >/dev/null; \
 		done; \
-		if [ -n "$$NEW_FILES" ]; then \
-			echo "$(GARNAME): new upstream files available: $$NEW_FILES"; \
-		fi; \
+		if test -z "$$NEW_FILES" ; then \
+  			if [ ! -n '$(UFILES_REGEX)' ]; then \
+                echo "$(GARNAME) : Warning UFILES_REGEX is not set : $(UFILES_REGEX)" ; \
+			else \
+	  			if [ "$$PACKAGE_UP_TO_DATE" -eq "0" ]; then \
+					echo "$(GARNAME) : Warning no files to check ! $(FILES2CHECK)" ; \
+					echo "$(GARNAME) :     UPSTREAM_MASTER_SITES is $(UPSTREAM_MASTER_SITES)" ; \
+					echo "$(GARNAME) :     DISTNAME is $(DISTNAME)" ; \
+					echo "$(GARNAME) :     UFILES_REGEX is : $(UFILES_REGEX)" ; \
+					echo "$(GARNAME) : Please check configuration" ; \
+	    		fi; \
+    		fi; \
+        else \
+			echo "$(GARNAME) : new upstream files available: $$NEW_FILES"; \
+        fi; \
 	fi
 	
 checknew-%:


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list