Revision: 2547
          http://gar.svn.sourceforge.net/gar/?rev=2547&view=rev
Author:   wbonnet
Date:     2008-12-11 21:15:47 +0000 (Thu, 11 Dec 2008)

Log Message:
-----------
Add detection of invalid email address for maintainer (empty string may happen 
if package is not yet published)
Add detection of the package using a GARNAME different from package name. In 
such cases, script try to retrive maintainer name from a gspec file

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

Modified: csw/mgar/gar/v1/bin/mail2maintainer
===================================================================
--- csw/mgar/gar/v1/bin/mail2maintainer 2008-12-11 21:08:05 UTC (rev 2546)
+++ csw/mgar/gar/v1/bin/mail2maintainer 2008-12-11 21:15:47 UTC (rev 2547)
@@ -23,8 +23,17 @@
 function get_package_maintainer
 {
        _PACKAGE="$1"
+
+       # This has to be improved. Maintainer is retrieved from the web page. 
It will be replaced by a sql query
        _MAINTAINER="`wget -q http://www.opencsw.org/packages.php/$_PACKAGE -O- 
| grep Maintainer | sed -e "s,.*/maintainers/\([^\'\\\"]*\).*,\1,g"`"
-       
+
+       # In case Maintainer string is empty, try to find the maintainer from a 
gspec file
+       # It's a bit crappy, but it works in msot cases (but has to be replaced 
also)
+       if [ "$_MAINTAINER" -eq "" ] ; then
+               _PACKAGE="`grep bitname files/*.gspec | awk '{ print $3 }' | 
head -n 1`"
+               _MAINTAINER="`wget -q 
http://www.opencsw.org/packages.php/$_PACKAGE -O- | grep Maintainer | sed -e 
"s,.*/maintainers/\([^\'\\\"]*\).*,\1,g"`"
+       fi
+
        echo "$_MAINTAINER"
 }
 
@@ -62,5 +71,9 @@
        shift
 done
 
-eval mailx $MAIL_OPTIONS -b "will...@wbonnet.net" $EMAIL
-
+if [ ! -n "$MAINTAINER" ] ; then
+       echo "No valid maintainer for package : $PACKAGE_NAME"
+       eval mailx "-s" "\"[svn] Invalid maintainer for package 
$PACKAGE_NAME\"" -b "will...@wbonnet.net" uwa...@opencsw.org
+else
+       eval mailx $MAIL_OPTIONS -b "will...@wbonnet.net" $EMAIL        
+fi

Modified: csw/mgar/gar/v1/gar.lib.mk
===================================================================
--- csw/mgar/gar/v1/gar.lib.mk  2008-12-11 21:08:05 UTC (rev 2546)
+++ csw/mgar/gar/v1/gar.lib.mk  2008-12-11 21:15:47 UTC (rev 2547)
@@ -191,6 +191,7 @@
                        else \
                                if echo $(DISTFILES) | grep -w $$FILE 
>/dev/null; then \
                                        PACKAGE_UP_TO_DATE=1; \
+echo DISTFILES : $(DISTFILES); \
                        echo "$(GARNAME) : Package is up-to-date. Current 
version is $$FILE" ; \
                                else \
                                        NEW_FILES="$$FILE $$NEW_FILES"; \
@@ -211,6 +212,8 @@
                        fi; \
                fi; \
         else \
+echo GNU_MIRROR : $(GNU_MIRROR); \
+echo NEW_FILES : $$NEW_FILES; \
                        echo "$(GARNAME) : new upstream files available: 
$$NEW_FILES"; \
         fi; \
        fi

Modified: csw/mgar/gar/v2/bin/mail2maintainer
===================================================================
--- csw/mgar/gar/v2/bin/mail2maintainer 2008-12-11 21:08:05 UTC (rev 2546)
+++ csw/mgar/gar/v2/bin/mail2maintainer 2008-12-11 21:15:47 UTC (rev 2547)
@@ -23,8 +23,17 @@
 function get_package_maintainer
 {
        _PACKAGE="$1"
+
+       # This has to be improved. Maintainer is retrieved from the web page. 
It will be replaced by a sql query
        _MAINTAINER="`wget -q http://www.opencsw.org/packages.php/$_PACKAGE -O- 
| grep Maintainer | sed -e "s,.*/maintainers/\([^\'\\\"]*\).*,\1,g"`"
-       
+
+       # In case Maintainer string is empty, try to find the maintainer from a 
gspec file
+       # It's a bit crappy, but it works in msot cases (but has to be replaced 
also)
+       if [ "$_MAINTAINER" -eq "" ] ; then
+               _PACKAGE="`grep bitname files/*.gspec | awk '{ print $3 }' | 
head -n 1`"
+               _MAINTAINER="`wget -q 
http://www.opencsw.org/packages.php/$_PACKAGE -O- | grep Maintainer | sed -e 
"s,.*/maintainers/\([^\'\\\"]*\).*,\1,g"`"
+       fi
+
        echo "$_MAINTAINER"
 }
 
@@ -62,5 +71,9 @@
        shift
 done
 
-eval mailx $MAIL_OPTIONS -b "will...@wbonnet.net" $EMAIL
-
+if [ ! -n "$MAINTAINER" ] ; then
+       echo "No valid maintainer for package : $PACKAGE_NAME"
+       eval mailx "-s" "\"[svn] Invalid maintainer for package 
$PACKAGE_NAME\"" -b "will...@wbonnet.net" uwa...@opencsw.org
+else
+       eval mailx $MAIL_OPTIONS -b "will...@wbonnet.net" $EMAIL        
+fi


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.
_______________________________________________
devel mailing list
devel@lists.opencsw.org
https://lists.opencsw.org/mailman/listinfo/devel

Reply via email to