gunnar: server/pear Pear.mk,1.10,1.11

cvs at kolab.org cvs at kolab.org
Wed Jul 22 08:28:43 CEST 2009


Author: gunnar

Update of /kolabrepository/server/pear
In directory doto:/tmp/cvs-serv24183

Modified Files:
	Pear.mk 
Log Message:
Reorganize the snapshot production so the important steps are not phony and dont need to be performed every time.

Index: Pear.mk
===================================================================
RCS file: /kolabrepository/server/pear/Pear.mk,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Pear.mk	13 Jul 2009 10:50:15 -0000	1.10
+++ Pear.mk	22 Jul 2009 06:28:40 -0000	1.11
@@ -45,6 +45,7 @@
 
 # Determine the exact commit that should be retrieved from the repository
 COMMIT =  $(shell grep "^repo_commit=" package.info | sed -e "s/repo_commit='\([A-Za-z0-9_:]*\)'.*/\1/")
+SAFE_COMMIT = $(shell grep "^repo_commit=" package.info | sed -e "s/repo_commit=':?\([A-Za-z0-9_]*\)'.*/\1/")
 
 # Determine the release tag a package derived from a repository checkout should get
 RELTAG = $(shell grep "^repo_release=" package.info | sed -e "s/repo_release='\([0-9]*\)'.*/\1/")
@@ -134,54 +135,43 @@
 	$(RPM) -Uhv --force $(KOLABRPMPKG)/$(PACKAGE)-$(VERSION)-$(RELEASE).$(PLATTAG).rpm
 
 # Target location for the repository checkout
-$(UPSTREAM):
-	mkdir -p $(UPSTREAM)
+$(UPSTREAM)/$(SAFE_COMMIT):
+	mkdir -p "$(UPSTREAM)/$(SAFE_COMMIT)"
 
-# Target for generating the repository checkout
+
+# Get the repository checkout
 ifeq ($(PACKAGE_VC),CVS)
-.PHONY: $(UPSTREAM)/$(CVS_REPO)
-$(UPSTREAM)/$(CVS_REPO):
-	if [ -e $(UPSTREAM)/$(CVS_REPO) ]; then                        \
-	  cd $(UPSTREAM)/$(CVS_REPO) && $(CVS_REPO_SC_CMD) "$(COMMIT)"; \
-	else                                                            \
-	  echo The password is 'horde';                                 \
-	  cvs -d $(CVS_REPO_URL) login;                                 \
-	  cd $(UPSTREAM) && $(CVS_REPO_CO_CMD) $(CVS_REPO);             \
-	  cd $(CVS_REPO) && $(CVS_REPO_SC_CMD) "$(COMMIT)";             \
-	fi;
+$(UPSTREAM)/$(SAFE_COMMIT)/$(CVS_REPO)/$(PEAR_PKGDIR): $(UPSTREAM)/$(SAFE_COMMIT)
+	@echo The password is 'horde'
+	@cvs -d $(CVS_REPO_URL) login
+	cd "$(UPSTREAM)/$(SAFE_COMMIT)" && $(CVS_REPO_CO_CMD) $(CVS_REPO)
+	cd "$(UPSTREAM)/$(SAFE_COMMIT)/$(CVS_REPO)" && $(CVS_REPO_SC_CMD) "$(COMMIT)"
 else
 ifeq ($(PACKAGE_VC),GIT)
-.PHONY: $(UPSTREAM)/$(GIT_REPO)
-$(UPSTREAM)/$(GIT_REPO):
-	if [ -e $(UPSTREAM)/$(GIT_REPO) ]; then                         \
-	  cd $(UPSTREAM)/$(GIT_REPO) && $(GIT_REPO_UP_CMD);             \
-	  $(GIT_REPO_SC_CMD) "$(COMMIT)";                               \
-	else                                                            \
-	  cd $(UPSTREAM) && $(GIT_REPO_CO_CMD) $(GIT_REPO_URL);         \
-	  cd $(GIT_REPO) && $(GIT_REPO_SC_CMD) "$(COMMIT)";             \
-	fi;
+$(UPSTREAM)/$(SAFE_COMMIT)/$(GIT_REPO)/$(PEAR_PKGDIR): $(UPSTREAM)/$(SAFE_COMMIT)
+	cd "$(UPSTREAM)/$(SAFE_COMMIT)" && $(GIT_REPO_CO_CMD) $(GIT_REPO_URL)
+	cd "$(UPSTREAM)/$(SAFE_COMMIT)/$(GIT_REPO)" && $(GIT_REPO_SC_CMD) "$(COMMIT)"
 endif
 endif
 
 # Generate the source package from the repository checkout
 ifeq ($(PACKAGE_VC),CVS)
-tmp/$(PACKAGE): $(UPSTREAM) $(UPSTREAM)/$(CVS_REPO)
+tmp/$(PACKAGE): $(UPSTREAM)/$(SAFE_COMMIT)/$(CVS_REPO)/$(PEAR_PKGDIR)
 	rm -rf tmp
 	mkdir tmp
-	cp -r $(UPSTREAM)/$(CVS_REPO)/$(PEAR_PKGDIR) tmp/$(PACKAGE)
+	cp -r "$(UPSTREAM)/$(SAFE_COMMIT)/$(CVS_REPO)/$(PEAR_PKGDIR)" tmp/$(PACKAGE)
 else
 ifeq ($(PACKAGE_VC),GIT)
-tmp/$(PACKAGE): $(UPSTREAM) $(UPSTREAM)/$(GIT_REPO)
+tmp/$(PACKAGE): $(UPSTREAM)/$(SAFE_COMMIT)/$(GIT_REPO)/$(PEAR_PKGDIR)
 	rm -rf tmp
 	mkdir tmp
-	cp -r $(UPSTREAM)/$(GIT_REPO)/$(PEAR_PKGDIR) tmp/$(PACKAGE)
+	cp -r "$(UPSTREAM)/$(SAFE_COMMIT)/$(GIT_REPO)/$(PEAR_PKGDIR)" tmp/$(PACKAGE)
 endif
 endif
 
 ifneq ($(PACKAGE_VC),)
 # Short name for the source package as a target for the command line.
-.PHONY:source
-source: tmp/$(PACKAGE)
+tmp/$(SOURCE_0): tmp/$(PACKAGE)
 	sed -i -e "/version/,+1 s#<release>\(.*\)</release>#<release>\1dev$(RELTAG)</release>#" tmp/$(PACKAGE)/package.xml
 	sed -i -e "/lead/,+1 s#<date>.*</date>#<date>$(DATE)</date>#" tmp/$(PACKAGE)/package.xml
 ifneq ($(ALTERNATE_CHANNEL),)
@@ -193,13 +183,15 @@
 	  sed -i -e '/date.*\/date/ i\ $(ALTERNATE_MAINTAINER_SNIPPET)'  tmp/$(PACKAGE)/package.xml; \
 	fi
 endif
-	$(PEAR) package tmp/$(PACKAGE)/package.xml
-	rm -rf tmp
+	cd tmp && $(PEAR) package $(PACKAGE)/package.xml
 
 # Short name for the source package as a target for the command line.
+tmp/.sent: tmp/$(SOURCE_0)
+	scp tmp/$(SOURCE_0) $(FILESERVER)
+	touch tmp/.sent
+
 .PHONY:snapshot
-snapshot: source
-	scp $(SOURCE_0) $(FILESERVER)
+snapshot: tmp/.sent
 endif
 
 # Target for retrieving the source package
@@ -271,6 +263,7 @@
 	rm -rf $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm
 	rm -rf $(SOURCE_0)
 	rm -rf *~
+	rm -rf tmp
 	rm -rf $(PACKAGE).spec
 	rm -rf package.patch
 





More information about the commits mailing list