commit 7ae6c62ef273cc324e0d87573d0f0e6b8dd889f1 Author: Patrick Ohly Date: Thu Jul 16 18:05:46 2009 +0200 converted to git checkout diff --git a/Makefile b/Makefile index c209347..8472aa1 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ #!/usr/bin/make -f # -# Build (debuggable) Evo from SVN +# Build (debuggable) Evo from GIT # Run "make help" for some help, or see the comments below. # # Requires GNU make 3.80 or better. @@ -231,18 +231,18 @@ RM := rm -f RMDIR := rm -rf SED := sed SUDO := sudo -SVN := svn +GIT := git TOUCH := touch UNPACK := tar xjf WGET := wget MKSTAMP = $(TOUCH) '$(STAMPFILE)' -# How to get things from SVN +# How to get things from GIT -SVNROOTURL := http://svn.gnome.org/svn +GITROOTURL := git://git.gnome.org -# Compute the SVN version path +# Compute the GIT version branch # If it's empty, assume the trunk # If it contains a "/", use it as-is # Otherwise, convert it into a branch name using the standard GNOME format. @@ -256,18 +256,12 @@ ifeq ($(BRANCH),) endif ifeq ($(BRANCH),) - SVNPATH := trunk - BRANCH := trunk + BRANCH := master else - ifeq ($(notdir $(BRANCH)),$(BRANCH)) - SVNPATH := branches/gnome-$(subst .,-,$(BRANCH)) - else - SVNPATH := $(BRANCH) - endif - branch := branch $(BRANCH) + BRANCH := gnome-$(subst .,-,$(BRANCH)) endif -SVNPKGURL = "$(SVNROOTURL)/$$pkg/$(SVNPATH)" +GITPKGURL = "$(GITROOTURL)/$$pkg" # Make sure we look in the new location for apps @@ -310,7 +304,7 @@ help: # Make sure none of the targets are considered intermediate .PRECIOUS: $(foreach X,$(STAMPTYPES),$(STAMPDIR)/%.$X) \ - $(addsuffix /.svn,$(PACKAGES)) + $(addsuffix /.git,$(PACKAGES)) # ----- install script wrappers @@ -339,7 +333,7 @@ install: esac; \ done -# ----- install SVN workspaces +# ----- install GIT workspaces $(STAMPDIR)/%.install: $(STAMPDIR)/%.build | $(PREFIX) $V [ -d '$(PREFIX)/etc/gconf' ] || $(MKDIR) '$(PREFIX)/etc/gconf' @@ -348,7 +342,7 @@ $(STAMPDIR)/%.install: $(STAMPDIR)/%.build | $(PREFIX) $(MAKE) install $(INSTALL_OPTS) $($*_INSTALL_OPTS) @ $(MKSTAMP) -# ----- build SVN workspaces +# ----- build GIT workspaces $(STAMPDIR)/%.build: $(STAMPDIR)/%.config $V cd '$(OBJPATH)' \ @@ -356,7 +350,7 @@ $(STAMPDIR)/%.build: $(STAMPDIR)/%.config $(MAKE) $(BUILD_OPTS) $($*_BUILD_OPTS) @ $(MKSTAMP) -# ----- configure SVN workspaces +# ----- configure GIT workspaces _CONFIG = $(MKDIR) '$(OBJPATH)/' && cd '$(OBJPATH)' \ && $(CONFIG_VARS) $($*_CONFIG_VARS) \ @@ -371,35 +365,47 @@ $(STAMPDIR)/%.config: $(STAMPDIR)/%.patch $V $(_CONFIG) @ $(MKSTAMP) -# ----- patch SVN workspaces +# ----- patch GIT workspaces $(STAMPDIR)/%.patch: $(STAMPDIR)/%.update @ $(MKSTAMP) -# ----- update SVN workspaces +# ----- update GIT workspaces -getsvnrev = `$(SVN) info $(1) | $(SED) -n 's/^Revision: \([0-9][0-9]*\).*/\1/p'` +getgitrev = `$(GIT) show-ref --head --hash HEAD` +samebranchcheck = [ $(BRANCH) = `$(GIT) branch | grep '^*' | sed -e 's/\* //'` ] +# Non-empty rev list between local ref and remote ref implies +# that there are unmerged revisions on the remote branch => not up-to-date. +uptodatecheck = ( localref=`$(GIT) show-ref --hash heads/$(BRANCH)`; \ + remoteref=`$(GIT) show-ref --hash origin/$(BRANCH)`; \ + ( [ "$$localref" = "$$remoteref" ] \ + || [ `$(GIT) rev-list "$$localref..$$remoteref" | wc -l` -eq 0 ] ) \ + && $(samebranchcheck) ) +updaterange = "`$(GIT) show-ref --hash heads/$(BRANCH)`..`$(GIT) show-ref --hash origin/$(BRANCH)`" -getsvninfo = eval `$(SVN) info $(2) | $(SED) -n -e 's/^Revision: \([0-9][0-9]*\).*/$(1)rev="\1"/p' -e 's/^URL: \(http:.*\)/$(1)url="\1"/p'` - -$(STAMPDIR)/%.update: %/.svn FORCE | check-prereqs-$(DISTRO) +$(STAMPDIR)/%.update: %/.git FORCE | check-prereqs-$(DISTRO) $V pkg='$*'; cd "$$pkg" \ - && $(call getsvninfo,repo,$(SVNPKGURL)) \ - && $(call getsvninfo,work,) \ - && if [ "$$workrev:$$workurl" = "$$reporev:$$repourl" ]; then \ - $(ECHO) "No SVN update needed for $$pkg."; \ + && $(GIT) fetch \ + && if $(uptodatecheck); then \ + $(ECHO) "No GIT update needed for $$pkg."; \ [ -f '$(STAMPFILE)' ] || $(MKSTAMP); \ else \ - $(ECHO) ">>>> Updating package $$pkg from SVN:"; \ - $(SVN) switch $(SVNPKGURL) \ - && $(SVN) update \ - && $(MKSTAMP); \ + $(ECHO) ">>>> Updating package $$pkg from GIT:"; \ + ( $(samebranchcheck) \ + && $(GIT) merge origin/$(BRANCH) \ + || \ + $(GIT) branch | grep $(BRANCH) >/dev/null \ + && $(GIT) checkout $(BRANCH) \ + && $(GIT) merge origin/$(BRANCH) \ + || \ + $(GIT) checkout -b $(BRANCH) origin/$(BRANCH) ) \ + && $(MKSTAMP); \ fi FORCE: -%/.svn: - @ $(ECHO) ">>>> Checking out package $* from SVN:" - $V pkg='$*'; $(SVN) checkout $(SVNPKGURL) "$$pkg" +%/.git: + @ $(ECHO) ">>>> Checking out package $* from GIT:" + $V pkg='$*'; $(GIT) clone $(GITPKGURL) "$$pkg" && cd $$pkg && ( [ $(BRANCH) = "master" ] || $(GIT) checkout -b $(BRANCH) origin/$(BRANCH) ) @ $(TOUCH) '$(CURDIR)/$(STAMPDIR)/$*.update' .PHONY: check-update @@ -407,17 +413,11 @@ check-update: @for pkg in $(PACKAGES); do \ ( \ cd "$$pkg"; \ - $(call getsvninfo,repo,$(SVNPKGURL)); \ - $(call getsvninfo,work,); \ - if [ "$$workrev" = "$$reporev" ]; then \ - $(ECHO) ">>>> No SVN update needed for $$pkg."; \ + $(GIT) fetch; \ + if $(uptodatecheck); then \ + $(ECHO) ">>>> No GIT update needed for $$pkg."; \ else \ - $(ECHO) ">>>> $$pkg has SVN updates available:"; \ - if [ "$$workurl" = "$$repourl" ]; then \ - $(SVN) status -q -u; \ - else \ - $(ECHO) "-> On $(BRANCH). Use 'make update'."; \ - fi; \ + $(ECHO) ">>>> $$pkg has GIT updates available"; \ fi; \ ); \ done @@ -427,32 +427,17 @@ check-changelog: @for pkg in $(PACKAGES); do \ ( \ cd "$$pkg"; \ - $(call getsvninfo,repo,$(SVNPKGURL)); \ - $(call getsvninfo,work,); \ - if [ "$$workrev" = "$$reporev" ]; then \ - $(ECHO) ">>>> No SVN update needed for $$pkg."; \ + $(GIT) fetch; \ + if $(uptodatecheck); then \ + $(ECHO) ">>>> No GIT update needed for $$pkg."; \ else \ - $(ECHO) ">>>> $$pkg has SVN updates available:"; \ - if [ "$$workurl" != "$$repourl" ]; then \ - $(ECHO) "-> On $(BRANCH). Use 'make update'."; \ - else \ - log="/tmp/svnstatus.log.$$$$"; \ - $(SVN) status -q -u 2>&1 | tee "$$log"; \ - sort "$$log" \ - | while read stat rev fn; do \ - case $$fn in \ - ChangeLog|*/ChangeLog) \ - $(ECHO) ">>>> $$pkg: $(SVN) diff -r $$rev:HEAD $$fn"; \ - $(SVN) diff -r "$$rev:HEAD" "$$fn" ;; \ - esac; \ - done; \ - $(RM) "$$log"; \ - fi; \ + $(ECHO) ">>>> $$pkg has GIT updates available:"; \ + PAGER= $(GIT) log $(updaterange); \ fi; \ ); \ done -# ----- create SVN workspaces +# ----- create GIT workspaces # ----- check packages @@ -630,11 +615,11 @@ $(call prereqs,evolution-webcal) #h:MAKE TARGETS: #h: #h:all [Default] Check out, configure, compile, install the various -#h: components necessary to build Evolution from SVN. +#h: components necessary to build Evolution from GIT. #h: -#h:update Perform SVN updates of all the checked out components. +#h:update Perform GIT updates of all the checked out components. #h: -#h:check-update Check whether there are new updates in the SVN repository. +#h:check-update Check whether there are new updates in the GIT repository. #h: Doesn't check anything out. #h: #h:check-changelog Check whether there are new updates, AND show the ChangeLog @@ -663,8 +648,8 @@ $(call prereqs,evolution-webcal) #h: build. Currently supported are "feisty", "gutsy", "hardy", and #h: "etch" (Debian). You can also set it to empty and hope for the best. #h: -#h:BRANCH The SVN label or branch to build. If you don't set this then -#h: a distro-specific value is chosen: it uses the SVN trunk where +#h:BRANCH The GIT label or branch to build. If you don't set this then +#h: a distro-specific value is chosen: it uses the GIT master where #h: possible. #h: #h:CCACHE Enable ccache (on by default). If you don't want to use it, @@ -682,7 +667,7 @@ $(call prereqs,evolution-webcal) #h: those listed in this variable. #h: #h:local_PACKAGES A list of extra packages you want to build. These must be -#h: "standard" Gnome packages kept on the Gnome SVN server and +#h: "standard" Gnome packages kept on the Gnome GIT server and #h: using the normal build operations. Common packages you might #h: want to list here are glib, libbonobo, and libsoup. #h: