summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-11-25 10:50:47 +0200
committerTor Lillqvist <tml@collabora.com>2014-11-25 11:04:15 +0200
commita9a81a23009b2fc9b1552f367cb04996a99bf704 (patch)
tree2f29d20fabfdb8fdb177edc333fef960b6a6ba1c
parent0c4e9e6b7e4f7155e00f40e31a73a928ce4fad38 (diff)
Add comment about a bug but how this stuff still works by luck
The 'suffix' GNU Make function returns the file name suffix including the period. The test comparing to the string 'zip' will thus never match, and gb_UnpackedTarget_STRIP_COMPONENTS_ZIP_DEFAULT will not be used, but gb_UnpackedTarget_STRIP_COMPONENTS_TAR_DEFAULT. But as most of the Zip archives we unpack do have a top-level with a single directory anyway, that we want to "strip", that works out fine. Apparently those that don't have a such directory level pass a 0 as second argument to gb_UnpackedTarget_STRIP_COMPONENTS_ZIP_DEFAULT which has the effect of avoiding the "stripping". Not sure what to actually do here, so I just commented the situation... Should the code be fixed to do what it thinks it is doing, but then to keep things working as before, should gb_UnpackedTarget_STRIP_COMPONENTS_ZIP_DEFAULT be changed to 1? Change-Id: I6436865dafe47e21e1365a602889cedab3c09784
-rw-r--r--solenv/gbuild/UnpackedTarball.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/solenv/gbuild/UnpackedTarball.mk b/solenv/gbuild/UnpackedTarball.mk
index da2e9672a881..b9070b50391b 100644
--- a/solenv/gbuild/UnpackedTarball.mk
+++ b/solenv/gbuild/UnpackedTarball.mk
@@ -16,9 +16,17 @@
# NOTE: only for commands; targets should use TARFILE_LOCATION directly
gb_UnpackedTarget_STRIP_COMPONENTS_TAR_DEFAULT := 1
+
+# Note that because of a bug in
+# gb_UnpackedTarget__get_strip_components, this _ZIP_DEFAULT is
+# actually not used, but the above _TAR_DEFAULT is used for .zip
+# archives, too.
gb_UnpackedTarget_STRIP_COMPONENTS_ZIP_DEFAULT := 0
# gb_UnpackedTarget__get_strip_components target strip-components?
+# Note: the suiffix function returns also the period, like ".zip",
+# so the condition below is never true. I don't dare fix this as this
+# stuff seems to work anyway by accident...
define gb_UnpackedTarget__get_strip_components
$(strip $(if $(2),\
$(2),\