Bug 572878: Preserve file name when passing file to be signed

Do this by using a temp dir to store the unsigned files in rather
than mangling the name

Change-Id: I25d3b1fbb5751f8615266168a919990d9111204c
This commit is contained in:
Jonah Graham 2021-05-17 21:01:58 -04:00
parent 241c3a38fd
commit 8e3e8366c1
2 changed files with 12 additions and 8 deletions

View file

@ -73,11 +73,13 @@ MAC_TO_SIGN=$(OS_DIR_MACOS_X86_64)/libspawner.jnilib \
WIN_TO_SIGN=$(OS_DIR_WIN32_X86_64)/starter.exe \
$(OS_DIR_WIN32_X86_64)/spawner.dll \
$(OS_DIR_WIN32_X86_64)/pty.dll
TMPDIR := $(shell mktemp -d -t production-XXXXXXXXXX)
production: $(MAC_TO_SIGN) $(WIN_TO_SIGN)
$(foreach tosign,$(MAC_TO_SIGN) $(WIN_TO_SIGN),mv $(tosign) unsigned-$(tosign) &&) true
$(foreach tosign,$(MAC_TO_SIGN),curl -f --silent --show-error -o $(tosign) -F file=@unsigned-$(tosign) https://cbi.eclipse.org/macos/codesign/sign &&) true
$(foreach tosign,$(WIN_TO_SIGN),curl -f --silent --show-error -o $(tosign) -F file=@unsigned-$(tosign) https://cbi.eclipse.org/authenticode/sign &&) true
$(foreach tosign,$(MAC_TO_SIGN) $(WIN_TO_SIGN),rm unsigned-$(tosign) &&) true
$(foreach tosign,$(MAC_TO_SIGN) $(WIN_TO_SIGN),mv $(tosign) $(TMPDIR)$(tosign) &&) true
$(foreach tosign,$(MAC_TO_SIGN),curl -f --silent --show-error -o $(tosign) -F file=@$(TMPDIR)$(tosign) https://cbi.eclipse.org/macos/codesign/sign &&) true
$(foreach tosign,$(WIN_TO_SIGN),curl -f --silent --show-error -o $(tosign) -F file=@$(TMPDIR)$(tosign) https://cbi.eclipse.org/authenticode/sign &&) true
$(foreach tosign,$(MAC_TO_SIGN) $(WIN_TO_SIGN),rm $(TMPDIR)$(tosign) &&) true
rmdir $(TMPDIR)
# Windows x86_64

View file

@ -49,11 +49,13 @@ clean :
MAC_TO_SIGN=$(OS_DIR)/macosx/x86_64/libserial.jnilib
WIN_TO_SIGN=$(OS_DIR)/win32/x86_64/serial.dll
TMPDIR := $(shell mktemp -d -t production-XXXXXXXXXX)
production: $(MAC_TO_SIGN) $(WIN_TO_SIGN)
$(foreach tosign,$(MAC_TO_SIGN) $(WIN_TO_SIGN),mv $(tosign) unsigned-$(tosign) &&) true
$(foreach tosign,$(MAC_TO_SIGN),curl -f --silent --show-error -o $(tosign) -F file=@unsigned-$(tosign) https://cbi.eclipse.org/macos/codesign/sign &&) true
$(foreach tosign,$(WIN_TO_SIGN),curl -f --silent --show-error -o $(tosign) -F file=@unsigned-$(tosign) https://cbi.eclipse.org/authenticode/sign &&) true
$(foreach tosign,$(MAC_TO_SIGN) $(WIN_TO_SIGN),rm unsigned-$(tosign) &&) true
$(foreach tosign,$(MAC_TO_SIGN) $(WIN_TO_SIGN),mv $(tosign) $(TMPDIR)$(tosign) &&) true
$(foreach tosign,$(MAC_TO_SIGN),curl -f --silent --show-error -o $(tosign) -F file=@$(TMPDIR)$(tosign) https://cbi.eclipse.org/macos/codesign/sign &&) true
$(foreach tosign,$(WIN_TO_SIGN),curl -f --silent --show-error -o $(tosign) -F file=@$(TMPDIR)$(tosign) https://cbi.eclipse.org/authenticode/sign &&) true
$(foreach tosign,$(MAC_TO_SIGN) $(WIN_TO_SIGN),rm $(TMPDIR)$(tosign) &&) true
rmdir $(TMPDIR)
rebuild: clean all