From 98c8649d0c7d1e3c4c8d8d09e022befa853fb1e7 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Tue, 9 Mar 2021 16:56:26 -0600 Subject: [PATCH] [dotnet] remove +sha from templates in installers (#10816) I noticed the new templates did not actually work from the installer unless I did: % sudo mv \ /usr/local/share/dotnet/template-packs/Microsoft.iOS.Templates.14.4.100-ci.main.1180+sha.bccef33d3.nupkg \ /usr/local/share/dotnet/template-packs/Microsoft.iOS.Templates.14.4.100-ci.main.1180.nupkg I checked other templates like Android or ASP.NET, and they do not currently have a hash like `+sha.bccef33d3` in the file name. To fix this problem, I updated the file in the installers so we now remove the `+sha.bccef33d3` portion from file name: $(subst +$(NUGET_BUILD_METADATA),,$(notdir $(TEMPLATE_PACKS_$(4)))) I also found the `Microsoft.iOS.Bundle.*.zip` did not contain `template-packs` at all, so I fixed this as well. --- dotnet/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dotnet/Makefile b/dotnet/Makefile index 1f8ea32e76..627ece02c4 100644 --- a/dotnet/Makefile +++ b/dotnet/Makefile @@ -258,7 +258,7 @@ $(TMP_PKG_DIR)/Microsoft.$1.Templates.$2.pkg: $(TEMPLATE_PACK_$(4)) | $(TMP_PKG_ $$(Q) rm -f $$@ $$(Q) rm -rf tmpdir/Microsoft.$1.Templates.$2/ $$(Q) mkdir -p tmpdir/Microsoft.$1.Templates.$2/usr/local/share/dotnet/template-packs/ - $$(Q) $$(CP) $(TEMPLATE_PACKS_$(4)) tmpdir/Microsoft.$1.Templates.$2/usr/local/share/dotnet/template-packs/ + $$(Q) $$(CP) $(TEMPLATE_PACKS_$(4)) tmpdir/Microsoft.$1.Templates.$2/usr/local/share/dotnet/template-packs/$(subst +$(NUGET_BUILD_METADATA),,$(notdir $(TEMPLATE_PACKS_$(4)))) $$(Q_GEN) pkgbuild --quiet --version '$2' --root tmpdir/Microsoft.$1.Templates.$2 --component-plist PackageInfo.plist --install-location / --identifier com.microsoft.net.$3.template.pkg $$@.tmp $$(Q) mv $$@.tmp $$@ @@ -282,7 +282,7 @@ $(DOTNET_PKG_DIR)/%: $(TMP_PKG_DIR)/% | $(DOTNET_PKG_DIR) PACKAGE_TARGETS += $(DOTNET_PKG_DIR)/Microsoft.$1.Bundle.$2.pkg -$(TMP_PKG_DIR)/Microsoft.$1.Bundle.$2.zip: $($(1)_NUGET_TARGETS) $(WORKLOAD_TARGETS) Makefile $(REF_PACK_$(4)) $(SDK_PACK_$(4)) | $(TMP_PKG_DIR) +$(TMP_PKG_DIR)/Microsoft.$1.Bundle.$2.zip: $($(1)_NUGET_TARGETS) $(WORKLOAD_TARGETS) Makefile $(REF_PACK_$(4)) $(SDK_PACK_$(4)) $(TEMPLATE_PACKS_$(4)) | $(TMP_PKG_DIR) $$(Q) rm -rf $$@ $$@.tmpdir $$@.tmp $$(Q) mkdir -p $$@.tmpdir/dotnet/sdk-manifests/$(DOTNET6_VERSION_BAND)/ $$(Q) mkdir -p $$@.tmpdir/dotnet/packs/Microsoft.$1.Sdk @@ -291,6 +291,7 @@ $(TMP_PKG_DIR)/Microsoft.$1.Bundle.$2.zip: $($(1)_NUGET_TARGETS) $(WORKLOAD_TARG $$(Q) $(CP) -r Microsoft.NET.Workload.$1 $$@.tmpdir/dotnet/sdk-manifests/$(DOTNET6_VERSION_BAND)/ $$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Sdk $$@.tmpdir/dotnet/packs/Microsoft.$1.Sdk/$2 $$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Ref $$@.tmpdir/dotnet/packs/Microsoft.$1.Ref/$2 + $$(Q) $(CP) $(TEMPLATE_PACKS_$(4)) $$@.tmpdir/dotnet/template-packs/$(subst +$(NUGET_BUILD_METADATA),,$(notdir $(TEMPLATE_PACKS_$(4)))) $$(Q_GEN) cd $$@.tmpdir && zip -9rq $$(abspath $$@.tmp) . $$(Q) mv $$@.tmp $$@ $$(Q) echo Created $$@ @@ -311,7 +312,7 @@ $(TMP_PKG_DIR)/Microsoft.$1.Windows.Bundle.$2.zip: $($(1)_NUGET_TARGETS) $($(1)_ $$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Sdk $$@.tmpdir/dotnet/packs/Microsoft.$1.Sdk/$2 $$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Windows.Sdk $$@.tmpdir/dotnet/packs/Microsoft.$1.Windows.Sdk/$2 $$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Ref $$@.tmpdir/dotnet/packs/Microsoft.$1.Ref/$2 - $$(Q) $(CP) $(TEMPLATE_PACKS_$(4)) $$@.tmpdir/dotnet/template-packs/ + $$(Q) $(CP) $(TEMPLATE_PACKS_$(4)) $$@.tmpdir/dotnet/template-packs/$(subst +$(NUGET_BUILD_METADATA),,$(notdir $(TEMPLATE_PACKS_$(4)))) $$(Q_GEN) cd $$@.tmpdir && zip -9rq $$(abspath $$@.tmp) . $$(Q) mv $$@.tmp $$@ $$(Q) echo Created $$@