hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject incubator-hawq git commit: HAWQ-867. Replace the git-submobule mechanism with git-clone
Date Fri, 01 Jul 2016 03:24:16 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 4f39857f1 -> 497ae5db9


HAWQ-867. Replace the git-submobule mechanism with git-clone


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/497ae5db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/497ae5db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/497ae5db

Branch: refs/heads/master
Commit: 497ae5db996094150e475659e06eea929e209841
Parents: 4f39857
Author: Paul Guo <paulguo@gmail.com>
Authored: Thu Jun 30 18:34:27 2016 +0800
Committer: Paul Guo <paulguo@gmail.com>
Committed: Fri Jul 1 11:20:00 2016 +0800

----------------------------------------------------------------------
 .gitmodules                                     | 15 -----
 contrib/Makefile                                | 20 ++++--
 contrib/pgcrypto.patch                          | 13 ----
 depends/thirdparty/.gitignore                   | 10 +--
 depends/thirdparty/gp-xerces                    |  1 -
 depends/thirdparty/gp-xerces.commit             |  1 +
 .../gp-xerces/git_keep_empty_directory.readme   |  8 +++
 depends/thirdparty/gporca                       |  1 -
 depends/thirdparty/gporca.commit                |  1 +
 .../gporca/git_keep_empty_directory.readme      |  8 +++
 depends/thirdparty/gpos                         |  1 -
 depends/thirdparty/gpos.commit                  |  1 +
 .../gpos/git_keep_empty_directory.readme        |  8 +++
 depends/thirdparty/postgres                     |  1 -
 depends/thirdparty/postgres.commit              |  1 +
 .../postgres/git_keep_empty_directory.readme    |  8 +++
 src/.gitignore                                  |  1 -
 src/Makefile.global.in                          |  9 ---
 src/backend/Makefile                            | 68 ++++++++++++++++----
 src/pl/.gitignore                               |  2 +
 src/pl/Makefile                                 | 21 ++++--
 src/pl/plr                                      |  1 -
 src/pl/plr.commit                               |  1 +
 src/pl/plr/git_keep_empty_directory.readme      |  8 +++
 24 files changed, 138 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/.gitmodules
----------------------------------------------------------------------
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 6e33770..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,15 +0,0 @@
-[submodule "depends/thirdparty/gp-xerces"]
-	path = depends/thirdparty/gp-xerces
-	url = https://github.com/greenplum-db/gp-xerces.git
-[submodule "depends/thirdparty/gpos"]
-	path = depends/thirdparty/gpos
-	url = https://github.com/greenplum-db/gpos.git
-[submodule "depends/thirdparty/gporca"]
-	path = depends/thirdparty/gporca
-	url = https://github.com/greenplum-db/gporca.git
-[submodule "src/pl/plr"]
-	path = src/pl/plr
-	url = https://github.com/jconway/plr.git
-[submodule "depends/thirdparty/postgres"]
-	path = depends/thirdparty/postgres
-	url = https://github.com/postgres/postgres.git

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/contrib/Makefile
----------------------------------------------------------------------
diff --git a/contrib/Makefile b/contrib/Makefile
index a3c1804..1d4939f 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -14,10 +14,22 @@ WANTED_DIRS = \
 ifeq ($(with_pgcrypto), yes)
 WANTED_DIRS += pgcrypto
 
-# fixme: depend on pgcrypto.patch also.
-pgcrypto_prepare: pg_prepare
-	if [ ! -e $(abs_top_builddir)/$(subdir)/pgcrypto_prepare_timestamp ]; then \
-		(cd $(abs_top_srcdir)/depends/thirdparty/postgres/contrib/pgcrypto; git apply $(abs_top_srcdir)/$(subdir)/pgcrypto.patch)
&& \
+pgcrypto_commit := $(shell cat $(abs_top_srcdir)/depends/thirdparty/postgres.commit)
+
+pgcrypto_prepare_timestamp: pgcrypto.patch $(abs_top_srcdir)/depends/thirdparty/postgres.commit
+	rm -f pgcrypto_prepare_timestamp
+
+# This includes an ugly hack which remove two added files after "git-reset".
+# I do this because "git apply" fails if the two files have existed.
+pgcrypto_prepare: pgcrypto_prepare_timestamp
+	if [ ! -f $(abs_top_builddir)/$(subdir)/pgcrypto_prepare_timestamp ]; then \
+		[ "x$(pgcrypto_commit)" != "x" ] || exit 1; \
+		cd $(abs_top_srcdir)/depends/thirdparty; mkdir -p postgres; cd postgres; \
+		rm -f git_keep_empty_directory.readme; \
+		[ ! -d .git ] && git clone https://github.com/postgres/postgres.git .; \
+		git reset --hard $(pgcrypto_commit) || (echo Now fetch from upstream and try again; git
fetch origin master; git reset --hard $(pgcrypto_commit)) || exit 2; \
+		rm -f contrib/pgcrypto/pgcrypto.sql.in contrib/pgcrypto/uninstall_pgcrypto.sql; \
+		git apply $(abs_top_srcdir)/$(subdir)/pgcrypto.patch || exit 3; \
 		touch $(abs_top_builddir)/$(subdir)/pgcrypto_prepare_timestamp; \
 	fi
 else

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/contrib/pgcrypto.patch
----------------------------------------------------------------------
diff --git a/contrib/pgcrypto.patch b/contrib/pgcrypto.patch
index 96fb612..9663fab 100644
--- a/contrib/pgcrypto.patch
+++ b/contrib/pgcrypto.patch
@@ -1,16 +1,3 @@
-diff --git a/contrib/pgcrypto/.gitignore b/contrib/pgcrypto/.gitignore
-index 5dcb3ff..0b66753 100644
---- a/contrib/pgcrypto/.gitignore
-+++ b/contrib/pgcrypto/.gitignore
-@@ -2,3 +2,8 @@
- /log/
- /results/
- /tmp_check/
-+libpgcrypto.a
-+libpgcrypto.so
-+libpgcrypto.so.0
-+libpgcrypto.so.0.0
-+pgcrypto.sql
 diff --git a/contrib/pgcrypto/Makefile b/contrib/pgcrypto/Makefile
 index dadec95..cfae9c9 100644
 --- a/contrib/pgcrypto/Makefile

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/.gitignore
----------------------------------------------------------------------
diff --git a/depends/thirdparty/.gitignore b/depends/thirdparty/.gitignore
index 2fc21c9..74cf5a9 100644
--- a/depends/thirdparty/.gitignore
+++ b/depends/thirdparty/.gitignore
@@ -1,5 +1,5 @@
-pg_prepare_timestamp
-orca_prepare_timestamp
-gp-xerces_build_timestamp
-gporca_build_timestamp
-gpos_build_timestamp
+*_timestamp
+gp-xerces/
+gporca/
+gpos/
+postgres/

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/gp-xerces
----------------------------------------------------------------------
diff --git a/depends/thirdparty/gp-xerces b/depends/thirdparty/gp-xerces
deleted file mode 160000
index f07c17d..0000000
--- a/depends/thirdparty/gp-xerces
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit f07c17da813f44d8da17067a76491ca4b1deb02f
diff --git a/depends/thirdparty/gp-xerces/git_keep_empty_directory.readme b/depends/thirdparty/gp-xerces/git_keep_empty_directory.readme
new file mode 100644
index 0000000..b80ff26
--- /dev/null
+++ b/depends/thirdparty/gp-xerces/git_keep_empty_directory.readme
@@ -0,0 +1,8 @@
+This is a file to keep the "empty" directory in git repo to remind
+developers to avoid manipulating it himself/herself.
+
+This directory is for git-clone, git patch and then build of related git
+repo when building related features. Please do not write any files into the
+directory if it is empty, and if you are not developing related features
+and are not familiar with the related build mechanism you'd better not
+modify/add/delete files under this directory.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/gp-xerces.commit
----------------------------------------------------------------------
diff --git a/depends/thirdparty/gp-xerces.commit b/depends/thirdparty/gp-xerces.commit
new file mode 100644
index 0000000..eedc23f
--- /dev/null
+++ b/depends/thirdparty/gp-xerces.commit
@@ -0,0 +1 @@
+https://github.com/greenplum-db/gp-xerces.git master f07c17da813f44d8da17067a76491ca4b1deb02f

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/gp-xerces/git_keep_empty_directory.readme
----------------------------------------------------------------------
diff --git a/depends/thirdparty/gp-xerces b/depends/thirdparty/gp-xerces
deleted file mode 160000
index f07c17d..0000000
--- a/depends/thirdparty/gp-xerces
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit f07c17da813f44d8da17067a76491ca4b1deb02f
diff --git a/depends/thirdparty/gp-xerces/git_keep_empty_directory.readme b/depends/thirdparty/gp-xerces/git_keep_empty_directory.readme
new file mode 100644
index 0000000..b80ff26
--- /dev/null
+++ b/depends/thirdparty/gp-xerces/git_keep_empty_directory.readme
@@ -0,0 +1,8 @@
+This is a file to keep the "empty" directory in git repo to remind
+developers to avoid manipulating it himself/herself.
+
+This directory is for git-clone, git patch and then build of related git
+repo when building related features. Please do not write any files into the
+directory if it is empty, and if you are not developing related features
+and are not familiar with the related build mechanism you'd better not
+modify/add/delete files under this directory.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/gporca
----------------------------------------------------------------------
diff --git a/depends/thirdparty/gporca b/depends/thirdparty/gporca
deleted file mode 160000
index 0d83756..0000000
--- a/depends/thirdparty/gporca
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 0d837569e61182f68bf1b92038c6616401790a16
diff --git a/depends/thirdparty/gporca/git_keep_empty_directory.readme b/depends/thirdparty/gporca/git_keep_empty_directory.readme
new file mode 100644
index 0000000..b80ff26
--- /dev/null
+++ b/depends/thirdparty/gporca/git_keep_empty_directory.readme
@@ -0,0 +1,8 @@
+This is a file to keep the "empty" directory in git repo to remind
+developers to avoid manipulating it himself/herself.
+
+This directory is for git-clone, git patch and then build of related git
+repo when building related features. Please do not write any files into the
+directory if it is empty, and if you are not developing related features
+and are not familiar with the related build mechanism you'd better not
+modify/add/delete files under this directory.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/gporca.commit
----------------------------------------------------------------------
diff --git a/depends/thirdparty/gporca.commit b/depends/thirdparty/gporca.commit
new file mode 100644
index 0000000..c576ae2
--- /dev/null
+++ b/depends/thirdparty/gporca.commit
@@ -0,0 +1 @@
+https://github.com/greenplum-db/gporca.git master 0d837569e61182f68bf1b92038c6616401790a16

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/gporca/git_keep_empty_directory.readme
----------------------------------------------------------------------
diff --git a/depends/thirdparty/gporca b/depends/thirdparty/gporca
deleted file mode 160000
index 0d83756..0000000
--- a/depends/thirdparty/gporca
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 0d837569e61182f68bf1b92038c6616401790a16
diff --git a/depends/thirdparty/gporca/git_keep_empty_directory.readme b/depends/thirdparty/gporca/git_keep_empty_directory.readme
new file mode 100644
index 0000000..b80ff26
--- /dev/null
+++ b/depends/thirdparty/gporca/git_keep_empty_directory.readme
@@ -0,0 +1,8 @@
+This is a file to keep the "empty" directory in git repo to remind
+developers to avoid manipulating it himself/herself.
+
+This directory is for git-clone, git patch and then build of related git
+repo when building related features. Please do not write any files into the
+directory if it is empty, and if you are not developing related features
+and are not familiar with the related build mechanism you'd better not
+modify/add/delete files under this directory.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/gpos
----------------------------------------------------------------------
diff --git a/depends/thirdparty/gpos b/depends/thirdparty/gpos
deleted file mode 160000
index 6af760f..0000000
--- a/depends/thirdparty/gpos
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 6af760fb96f5bd48783e8644e7d63c39132b8c08
diff --git a/depends/thirdparty/gpos/git_keep_empty_directory.readme b/depends/thirdparty/gpos/git_keep_empty_directory.readme
new file mode 100644
index 0000000..b80ff26
--- /dev/null
+++ b/depends/thirdparty/gpos/git_keep_empty_directory.readme
@@ -0,0 +1,8 @@
+This is a file to keep the "empty" directory in git repo to remind
+developers to avoid manipulating it himself/herself.
+
+This directory is for git-clone, git patch and then build of related git
+repo when building related features. Please do not write any files into the
+directory if it is empty, and if you are not developing related features
+and are not familiar with the related build mechanism you'd better not
+modify/add/delete files under this directory.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/gpos.commit
----------------------------------------------------------------------
diff --git a/depends/thirdparty/gpos.commit b/depends/thirdparty/gpos.commit
new file mode 100644
index 0000000..5455581
--- /dev/null
+++ b/depends/thirdparty/gpos.commit
@@ -0,0 +1 @@
+https://github.com/greenplum-db/gpos.git master 6af760fb96f5bd48783e8644e7d63c39132b8c08

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/gpos/git_keep_empty_directory.readme
----------------------------------------------------------------------
diff --git a/depends/thirdparty/gpos b/depends/thirdparty/gpos
deleted file mode 160000
index 6af760f..0000000
--- a/depends/thirdparty/gpos
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 6af760fb96f5bd48783e8644e7d63c39132b8c08
diff --git a/depends/thirdparty/gpos/git_keep_empty_directory.readme b/depends/thirdparty/gpos/git_keep_empty_directory.readme
new file mode 100644
index 0000000..b80ff26
--- /dev/null
+++ b/depends/thirdparty/gpos/git_keep_empty_directory.readme
@@ -0,0 +1,8 @@
+This is a file to keep the "empty" directory in git repo to remind
+developers to avoid manipulating it himself/herself.
+
+This directory is for git-clone, git patch and then build of related git
+repo when building related features. Please do not write any files into the
+directory if it is empty, and if you are not developing related features
+and are not familiar with the related build mechanism you'd better not
+modify/add/delete files under this directory.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/postgres
----------------------------------------------------------------------
diff --git a/depends/thirdparty/postgres b/depends/thirdparty/postgres
deleted file mode 160000
index 932ded2..0000000
--- a/depends/thirdparty/postgres
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 932ded2ed51e8333852e370c7a6dad75d9f236f9
diff --git a/depends/thirdparty/postgres/git_keep_empty_directory.readme b/depends/thirdparty/postgres/git_keep_empty_directory.readme
new file mode 100644
index 0000000..b80ff26
--- /dev/null
+++ b/depends/thirdparty/postgres/git_keep_empty_directory.readme
@@ -0,0 +1,8 @@
+This is a file to keep the "empty" directory in git repo to remind
+developers to avoid manipulating it himself/herself.
+
+This directory is for git-clone, git patch and then build of related git
+repo when building related features. Please do not write any files into the
+directory if it is empty, and if you are not developing related features
+and are not familiar with the related build mechanism you'd better not
+modify/add/delete files under this directory.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/postgres.commit
----------------------------------------------------------------------
diff --git a/depends/thirdparty/postgres.commit b/depends/thirdparty/postgres.commit
new file mode 100644
index 0000000..48316e9
--- /dev/null
+++ b/depends/thirdparty/postgres.commit
@@ -0,0 +1 @@
+ca59dfa6f727fe3bf3a01904ec30e87f7fa5a67e

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/depends/thirdparty/postgres/git_keep_empty_directory.readme
----------------------------------------------------------------------
diff --git a/depends/thirdparty/postgres b/depends/thirdparty/postgres
deleted file mode 160000
index 932ded2..0000000
--- a/depends/thirdparty/postgres
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 932ded2ed51e8333852e370c7a6dad75d9f236f9
diff --git a/depends/thirdparty/postgres/git_keep_empty_directory.readme b/depends/thirdparty/postgres/git_keep_empty_directory.readme
new file mode 100644
index 0000000..b80ff26
--- /dev/null
+++ b/depends/thirdparty/postgres/git_keep_empty_directory.readme
@@ -0,0 +1,8 @@
+This is a file to keep the "empty" directory in git repo to remind
+developers to avoid manipulating it himself/herself.
+
+This directory is for git-clone, git patch and then build of related git
+repo when building related features. Please do not write any files into the
+directory if it is empty, and if you are not developing related features
+and are not familiar with the related build mechanism you'd better not
+modify/add/delete files under this directory.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/src/.gitignore
----------------------------------------------------------------------
diff --git a/src/.gitignore b/src/.gitignore
index 1280701..512464f 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -2,4 +2,3 @@ Makefile.global
 Makefile.port
 Makefile.custom
 VERSIONS.mk
-pl/plr_prepare_timestamp

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/src/Makefile.global.in
----------------------------------------------------------------------
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 1afbc16..785c4df 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -692,15 +692,6 @@ include $(top_srcdir)/src/nls-global.mk
 endif # nls.mk
 endif # enable_nls
 
-pg_prepare:
-ifneq "$(findstring yes, $(with_pgcrypto))" ""
-	if [ ! -e $(abs_top_builddir)/depends/thirdparty/pg_prepare_timestamp ]; then \
-		cd $(abs_top_srcdir); \
-		git submodule update --init depends/thirdparty/postgres && \
-		touch $(abs_top_builddir)/depends/thirdparty/pg_prepare_timestamp; \
-	fi
-endif
-
 ##########################################################################
 #
 # Coverage

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/src/backend/Makefile
----------------------------------------------------------------------
diff --git a/src/backend/Makefile b/src/backend/Makefile
index b331d15..eb3a6a3 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -93,7 +93,7 @@ GPORCA_SRC_PATH := $(ORCA_SRC_PATH)/gporca
 GPOS_SRC_PATH := $(ORCA_SRC_PATH)/gpos
 GP_XERCES_SRC_PATH := $(ORCA_SRC_PATH)/gp-xerces
 
-submake-gporca: submake-gpos submake-gp-xerces orca_prepare
+submake-gporca: submake-gpos submake-gp-xerces gporca_prepare
 	if [ ! -f $(ORCA_BLD_PATH)/gporca_build_timestamp ]; then \
 		rm -rf $(ORCA_BLD_PATH)/gporca/build; mkdir -p $(ORCA_BLD_PATH)/gporca/build; cd $(ORCA_BLD_PATH)/gporca/build;
mkdir -p install; \
 		cmake $(GPORCA_SRC_PATH) -DCMAKE_INSTALL_PREFIX=$(prefix) \
@@ -105,7 +105,7 @@ submake-gporca: submake-gpos submake-gp-xerces orca_prepare
 		touch $(ORCA_BLD_PATH)/gporca_build_timestamp; \
 	fi
 
-submake-gpos: orca_prepare
+submake-gpos: gpos_prepare
 	if [ ! -f $(ORCA_BLD_PATH)/gpos_build_timestamp ]; then \
 		rm -rf $(ORCA_BLD_PATH)/gpos/build; mkdir -p $(ORCA_BLD_PATH)/gpos/build; cd $(ORCA_BLD_PATH)/gpos/build;
mkdir -p install; \
 		cmake $(GPOS_SRC_PATH) -DCMAKE_INSTALL_PREFIX=$(prefix) && \
@@ -113,7 +113,7 @@ submake-gpos: orca_prepare
 		touch $(ORCA_BLD_PATH)/gpos_build_timestamp; \
 	fi
 
-submake-gp-xerces: submake-gpos orca_prepare
+submake-gp-xerces: submake-gpos gp-xerces_prepare
 	if [ ! -f $(ORCA_BLD_PATH)/gp-xerces_build_timestamp ]; then \
 		rm -rf $(ORCA_BLD_PATH)/gp-xerces/build; mkdir -p $(ORCA_BLD_PATH)/gp-xerces/build; cd
$(ORCA_BLD_PATH)/gp-xerces/build; mkdir -p install; \
 		$(GP_XERCES_SRC_PATH)/configure --prefix=$(prefix); \
@@ -121,19 +121,61 @@ submake-gp-xerces: submake-gpos orca_prepare
 		touch $(ORCA_BLD_PATH)/gp-xerces_build_timestamp; \
 	fi
 
-orca_prepare:
-	if [ ! -f $(ORCA_BLD_PATH)/orca_prepare_timestamp ]; then \
-			cd $(abs_top_srcdir); \
-			git submodule update --init depends/thirdparty/gporca && \
-			git submodule update --init depends/thirdparty/gp-xerces && \
-			git submodule update --init depends/thirdparty/gpos && \
-			touch $(ORCA_BLD_PATH)/orca_prepare_timestamp; \
+gporca_git := $(shell cat $(ORCA_SRC_PATH)/gporca.commit | awk '{print $$1}')
+gpos_git := $(shell cat $(ORCA_SRC_PATH)/gpos.commit | awk '{print $$1}')
+gp_xerces_git := $(shell cat $(ORCA_SRC_PATH)/gp-xerces.commit | awk '{print $$1}')
+
+gporca_branch := $(shell cat $(ORCA_SRC_PATH)/gporca.commit | awk '{print $$2}')
+gpos_branch := $(shell cat $(ORCA_SRC_PATH)/gpos.commit | awk '{print $$2}')
+gp_xerces_branch := $(shell cat $(ORCA_SRC_PATH)/gp-xerces.commit | awk '{print $$2}')
+
+gporca_commit := $(shell cat $(ORCA_SRC_PATH)/gporca.commit | awk '{print $$3}')
+gpos_commit := $(shell cat $(ORCA_SRC_PATH)/gpos.commit | awk '{print $$3}')
+gp_xerces_commit := $(shell cat $(ORCA_SRC_PATH)/gp-xerces.commit | awk '{print $$3}')
+
+$(ORCA_BLD_PATH)/gporca_prepare_timestamp: $(ORCA_SRC_PATH)/gporca.commit
+	rm -f $(ORCA_BLD_PATH)/gporca_prepare_timestamp
+
+$(ORCA_BLD_PATH)/gpos_prepare_timestamp: $(ORCA_SRC_PATH)/gpos.commit
+	rm -f $(ORCA_BLD_PATH)/gpos_prepare_timestamp
+
+$(ORCA_BLD_PATH)/gp-xerces_prepare_timestamp: $(ORCA_SRC_PATH)/gp-xerces.commit
+	rm -f $(ORCA_BLD_PATH)/gp-xerces_prepare_timestamp
+
+gporca_prepare: $(ORCA_BLD_PATH)/gporca_prepare_timestamp
+	if [ ! -f $(ORCA_BLD_PATH)/gporca_prepare_timestamp ]; then \
+		[ "x$(gporca_commit)" != "x" ] || exit 1; \
+		cd $(ORCA_SRC_PATH); mkdir -p gporca; cd gporca; \
+		rm -f git_keep_empty_directory.readme; \
+		[ ! -d .git ] && git clone $(gporca_git) . && git checkout $(gporca_branch);
\
+		git reset --hard $(gporca_commit) || (echo Now fetch from upstream and try again; git fetch
origin $(gporca_git); git reset --hard $(gporca_commit)) || exit 2; \
+		touch $(ORCA_BLD_PATH)/gporca_prepare_timestamp; \
+	fi
+
+gpos_prepare: $(ORCA_BLD_PATH)/gpos_prepare_timestamp
+	if [ ! -f $(ORCA_BLD_PATH)/gpos_prepare_timestamp ]; then \
+		[ "x$(gpos_commit)" != "x" ] || exit 1; \
+		cd $(ORCA_SRC_PATH); mkdir -p gpos; cd gpos; \
+		rm -f git_keep_empty_directory.readme; \
+		[ ! -d .git ] && git clone $(gpos_git) . && git checkout $(gpos_branch);
\
+		git reset --hard $(gpos_commit) || (echo Now fetch from upstream and try again; git fetch
origin $(gpos_git); git reset --hard $(gpos_commit)) || exit 2; \
+		touch $(ORCA_BLD_PATH)/gpos_prepare_timestamp; \
+	fi
+
+gp-xerces_prepare: $(ORCA_BLD_PATH)/gp-xerces_prepare_timestamp
+	if [ ! -f $(ORCA_BLD_PATH)/gp-xerces_prepare_timestamp ]; then \
+		[ "x$(gp_xerces_commit)" != "x" ] || exit 1; \
+		cd $(ORCA_SRC_PATH); mkdir -p gp-xerces; cd gp-xerces; \
+		rm -f git_keep_empty_directory.readme; \
+		[ ! -d .git ] && git clone $(gp_xerces_git) . && git checkout $(gp_xerces_branch);
\
+		git reset --hard $(gp_xerces_commit) || (echo Now fetch from upstream and try again; git
fetch origin $(gp_xerces_git); git reset --hard $(gp_xerces_commit)) || exit 2; \
+		touch $(ORCA_BLD_PATH)/gp-xerces_prepare_timestamp; \
 	fi
 
 submake-libdxltranslators: submake-gporca
 	$(MAKE) -C gpopt all
 
-.PHONY: submake-gporca submake-gpos submake-gp-xerces orca_prepare
+.PHONY: submake-gporca submake-gpos submake-gp-xerces gporca_prepare gpos_prepare gp-xerces_prepare
 
 else
 submake-libdxltranslators:
@@ -368,7 +410,9 @@ endif
 	rm -rf $(ORCA_BLD_PATH)/gporca/build $(ORCA_BLD_PATH)/gporca_build_timestamp
 	rm -rf $(ORCA_BLD_PATH)/gpos/build $(ORCA_BLD_PATH)/gpos_build_timestamp
 	rm -rf $(ORCA_BLD_PATH)/gp-xerces/build $(ORCA_BLD_PATH)/gp-xerces_build_timestamp
-	rm -f $(ORCA_BLD_PATH)/orca_prepare_timestamp
+	rm -f $(ORCA_BLD_PATH)/gporca_build_timestamp
+	rm -f $(ORCA_BLD_PATH)/gpos_build_timestamp
+	rm -f $(ORCA_BLD_PATH)/gp-xerces_build_timestamp
 
 distclean: clean
 	rm -f port/tas.s port/dynloader.c port/pg_sema.c port/pg_shmem.c

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/src/pl/.gitignore
----------------------------------------------------------------------
diff --git a/src/pl/.gitignore b/src/pl/.gitignore
new file mode 100644
index 0000000..6befe73
--- /dev/null
+++ b/src/pl/.gitignore
@@ -0,0 +1,2 @@
+plr/
+plr_prepare_timestamp

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/src/pl/Makefile
----------------------------------------------------------------------
diff --git a/src/pl/Makefile b/src/pl/Makefile
index 79c6550..8babb18 100644
--- a/src/pl/Makefile
+++ b/src/pl/Makefile
@@ -34,12 +34,19 @@ ifeq ($(with_r), yes)
 DIRS += plr
 endif
 
-# fixme: depend on plr.patch also.
-plr_prepare:
-	if [ ! -e $(abs_top_builddir)/$(subdir)/plr_prepare_timestamp ]; then \
-		cd $(abs_top_srcdir); \
-		git submodule update --init $(subdir)/plr && \
-		(cd $(abs_top_srcdir)/$(subdir)/plr; git apply ../plr.patch) && \
+plr_commit := $(shell cat $(abs_top_srcdir)/$(subdir)/plr.commit)
+
+plr_prepare_timestamp: plr.patch plr.commit
+	rm -f plr_prepare_timestamp
+
+plr_prepare: plr_prepare_timestamp
+	if [ ! -f $(abs_top_builddir)/$(subdir)/plr_prepare_timestamp ]; then \
+		[ "x$(plr_commit)" != "x" ] || exit 1; \
+		cd $(abs_top_srcdir)/$(subdir); mkdir -p plr; cd plr; \
+		rm -f git_keep_empty_directory.readme; \
+		[ ! -d .git ] && git clone https://github.com/jconway/plr.git .; \
+		git reset --hard $(plr_commit) || (echo Now fetch from upstream and try again; git fetch
origin master; git reset --hard $(plr_commit)) || exit 2; \
+		git apply ../plr.patch || exit 3; \
 		touch $(abs_top_builddir)/$(subdir)/plr_prepare_timestamp; \
 	fi
 
@@ -48,7 +55,7 @@ ABS_PLR_SRCDIR = $(abs_top_srcdir)/$(subdir)/plr
 # rpm only so far.
 plr_pkgbuild: plr_prepare
 	if [ ! -f /etc/redhat-release ]; then echo "rpm build is not supported on the platform.";
exit 1; fi
-	rm -rf plr/build; mkdir plr/build;
+	rm -rf plr/build; mkdir -p plr/build;
 	rpmbuild -bb plr.spec --define 'plr_srcdir $(ABS_PLR_SRCDIR)' --define '_topdir $(ABS_PLR_SRCDIR)/build'
--define '__os_install_post \%{nil}'
 
 ifeq ($(with_r), yes)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/src/pl/plr
----------------------------------------------------------------------
diff --git a/src/pl/plr b/src/pl/plr
deleted file mode 160000
index 33a90a9..0000000
--- a/src/pl/plr
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 33a90a9a098fe7bf56256e231b9d0142016cb9f5
diff --git a/src/pl/plr/git_keep_empty_directory.readme b/src/pl/plr/git_keep_empty_directory.readme
new file mode 100644
index 0000000..b80ff26
--- /dev/null
+++ b/src/pl/plr/git_keep_empty_directory.readme
@@ -0,0 +1,8 @@
+This is a file to keep the "empty" directory in git repo to remind
+developers to avoid manipulating it himself/herself.
+
+This directory is for git-clone, git patch and then build of related git
+repo when building related features. Please do not write any files into the
+directory if it is empty, and if you are not developing related features
+and are not familiar with the related build mechanism you'd better not
+modify/add/delete files under this directory.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/src/pl/plr.commit
----------------------------------------------------------------------
diff --git a/src/pl/plr.commit b/src/pl/plr.commit
new file mode 100644
index 0000000..1988fcc
--- /dev/null
+++ b/src/pl/plr.commit
@@ -0,0 +1 @@
+33a90a9a098fe7bf56256e231b9d0142016cb9f5

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/497ae5db/src/pl/plr/git_keep_empty_directory.readme
----------------------------------------------------------------------
diff --git a/src/pl/plr b/src/pl/plr
deleted file mode 160000
index 33a90a9..0000000
--- a/src/pl/plr
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 33a90a9a098fe7bf56256e231b9d0142016cb9f5
diff --git a/src/pl/plr/git_keep_empty_directory.readme b/src/pl/plr/git_keep_empty_directory.readme
new file mode 100644
index 0000000..b80ff26
--- /dev/null
+++ b/src/pl/plr/git_keep_empty_directory.readme
@@ -0,0 +1,8 @@
+This is a file to keep the "empty" directory in git repo to remind
+developers to avoid manipulating it himself/herself.
+
+This directory is for git-clone, git patch and then build of related git
+repo when building related features. Please do not write any files into the
+directory if it is empty, and if you are not developing related features
+and are not familiar with the related build mechanism you'd better not
+modify/add/delete files under this directory.


Mime
View raw message