From 71ad7c8f4ea7278f48e276c2f232c674b20f7384 Mon Sep 17 00:00:00 2001 From: Raphael Moll Date: Mon, 2 Jun 2014 17:11:45 -0700 Subject: [PATCH] Fix SDK repo to prevent mixing different targets. DO NOT MERGE. This makes sure that sdk-repo-*.zip doesn't exist to avoid merging into an existing one. Also fix a warning when generating the repo.xml files. (cherry picked from commit 4df9f469f710b4eedde9020f7a35534a795edfb1) Change-Id: I8ad6763ace0d6075a743b99fd65a5ae8b69bf3d5 --- build/tools/mk_sdk_repo_xml.sh | 2 +- build/tools/sdk_repo.mk | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build/tools/mk_sdk_repo_xml.sh b/build/tools/mk_sdk_repo_xml.sh index 79298baa5..3fad505c8 100755 --- a/build/tools/mk_sdk_repo_xml.sh +++ b/build/tools/mk_sdk_repo_xml.sh @@ -267,7 +267,7 @@ function parse_attributes() { REV="${BASH_REMATCH[2]}" fi - if [[ $XSD_VERSION -ge $REV ]]; then + if [[ ( $REV =~ ^[0-9]+ && $XSD_VERSION -ge $REV ) || $XSD_VERSION == $REV ]]; then # Parse the property, if present. Any space is replaced by @ VALUE=$( grep "^$SRC=" "$PROPS" | cut -d = -f 2 | tr ' ' '@' | tr -d '\r' ) if [[ -n "$VALUE" ]]; then diff --git a/build/tools/sdk_repo.mk b/build/tools/sdk_repo.mk index 998009327..6de011768 100644 --- a/build/tools/sdk_repo.mk +++ b/build/tools/sdk_repo.mk @@ -32,6 +32,7 @@ define mk-sdk-repo-pkg-1 $(call sdk-repo-pkg-zip,$(2),$(3),$(4)): $(3) @echo "Building SDK repository package $(4) from $(notdir $(3))" $(hide) cd $(basename $(3)) && \ + rm -f ../$(notdir $(call sdk-repo-pkg-zip,$(2),$(3),$(4))) && \ zip -9rq ../$(notdir $(call sdk-repo-pkg-zip,$(2),$(3),$(4))) $(4)/* $(call dist-for-goals, sdk_repo, $(call sdk-repo-pkg-zip,$(2),$(3),$(4))) $(1) += $(4) $(2) \ @@ -54,6 +55,7 @@ define mk-sdk-repo-pkg-2 $(call sdk-repo-pkg-zip,$(2),$(3),$(4)): $(3) @echo "Building SDK repository package $(4) from $(notdir $(3))" $(hide) cd $(basename $(3))/$(4) && \ + rm -f ../../$(notdir $(call sdk-repo-pkg-zip,$(2),$(3),$(4))) && \ zip -9rq ../../$(notdir $(call sdk-repo-pkg-zip,$(2),$(3),$(4))) * $(call dist-for-goals, sdk_repo, $(call sdk-repo-pkg-zip,$(2),$(3),$(4))) $(1) += $(4) $(2) \ @@ -80,6 +82,7 @@ define mk-sdk-repo-pkg-3 $(call sdk-repo-pkg-zip,$(2),$(3),$(4)): $(3) @echo "Building SDK repository package $(4) from $(notdir $(3))" $(hide) cd $(basename $(3))/$(5) && \ + rm -f ../../../$(notdir $(call sdk-repo-pkg-zip,$(2),$(3),$(4))) && \ zip -9rq ../../../$(notdir $(call sdk-repo-pkg-zip,$(2),$(3),$(4))) * $(call dist-for-goals, sdk_repo, $(call sdk-repo-pkg-zip,$(2),$(3),$(4))) $(1) += $(4) $(2) \