common Makefile.common,1.54,1.55

Jeremy Katz (katzj) fedora-extras-commits at redhat.com
Wed May 16 20:31:32 UTC 2007


Author: katzj

Update of /cvs/pkgs/common
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6837

Modified Files:
	Makefile.common 
Log Message:
add certificate expiration checking based on cvs-import patch from Andreas
Thienemann



Index: Makefile.common
===================================================================
RCS file: /cvs/pkgs/common/Makefile.common,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- Makefile.common	4 May 2007 15:39:29 -0000	1.54
+++ Makefile.common	16 May 2007 20:31:02 -0000	1.55
@@ -201,9 +201,23 @@
 fi
 endef
 
+OPENSSL=$(shell which openssl 2>/dev/null)
+define check-cert
+	@if ! test -f $(HOME)/.fedora.cert ; then echo "ERROR: You need to download your Fedora client certificate" >&2 ; echo "       from https://admin.fedora.redhat.com/accounts/" >&2; exit 1 ; fi
+	@if [ -x ${OPENSSL} ]; then \
+	    ${OPENSSL} x509 -checkend 6000 -noout -in ${HOME}/.fedora.cert ; \
+	    if [ $? -ne 0 ]; then \
+	        echo "ERROR: Your Fedora client-side certificate expired." >&2 ; \
+                echo "       You need to download a new client-side certificate" >&2 ; \
+                echo "       from https://admin.fedora.redhat.com/accounts/" >&2 ; \
+                exit 1 ; \
+	    fi ; \
+	fi
+endef
+
 # Upload the FILES, adding to the ./sources manifest
 upload: $(FILES)
-	@if ! test -f $(HOME)/.fedora.cert ; then echo "ERROR: You need to download your Fedora client certificate" >&2 ; echo "       from https://admin.fedora.redhat.com/accounts/" >&2; exit 1 ; fi
+	$(check-cert)
 	@if ! test -f ./sources ; then touch ./sources ; fi
 	@if ! test -f ./.cvsignore ; then touch ./.cvsignore ; fi
 	@for f in $(FILES); do \
@@ -233,7 +247,7 @@
 
 # Upload FILES and recreate the ./sources file to include only these FILES
 new-source new-sources: $(FILES)
-	@if ! test -f $(HOME)/.fedora.cert ; then echo "ERROR: You need to download your Fedora client certificate" >&2 ; echo "       from https://admin.fedora.redhat.com/accounts/" >&2; exit 1 ; fi
+	$(check-cert)
 	@rm -f sources && touch sources
 	@rm -f .cvsignore && touch .cvsignore
 	@for f in $(FILES); do \




More information about the fedora-extras-commits mailing list