diff --git a/external/nss/ExternalProject_nss.mk b/external/nss/ExternalProject_nss.mk index c7738ca2d759..759ef461e3f8 100644 --- a/external/nss/ExternalProject_nss.mk +++ b/external/nss/ExternalProject_nss.mk @@ -16,7 +16,9 @@ $(eval $(call gb_ExternalProject_register_targets,nss,\ )) ifeq ($(OS),WNT) -$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecutable_get_dependencies,python) +$(call gb_ExternalProject_get_state_target,nss,build): \ + $(call gb_ExternalExecutable_get_dependencies,python) \ + $(SRCDIR)/external/nss/nsinstall.py $(call gb_Trace_StartRange,nss,EXTERNAL) $(call gb_ExternalProject_run,build,\ $(if $(MSVC_USE_DEBUG_RUNTIME),USE_DEBUG_RTL=1,BUILD_OPT=1) \ @@ -43,7 +45,9 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecuta else # OS!=WNT # make sure to specify NSPR_CONFIGURE_OPTS as env (before make command), so nss can append it's own defaults # OTOH specify e.g. CC and NSINSTALL as arguments (after make command), so they will overrule nss makefile values -$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecutable_get_dependencies,python) +$(call gb_ExternalProject_get_state_target,nss,build): \ + $(call gb_ExternalExecutable_get_dependencies,python) \ + $(SRCDIR)/external/nss/nsinstall.py $(call gb_Trace_StartRange,nss,EXTERNAL) $(call gb_ExternalProject_run,build,\ $(if $(filter ANDROID FREEBSD LINUX MACOSX,$(OS)),$(if $(filter X86_64,$(CPUNAME)),USE_64=1)) \ diff --git a/external/nss/nsinstall.py b/external/nss/nsinstall.py index 80e9c1679373..d90a85e6c540 100644 --- a/external/nss/nsinstall.py +++ b/external/nss/nsinstall.py @@ -99,17 +99,17 @@ def nsinstall(argv): if options.D: if len(args) != 1: return 1 - if os.path.exists(args[0]): + try: + if options.m: + os.makedirs(args[0], options.m) + else: + os.makedirs(args[0]) + except FileExistsError: if not os.path.isdir(args[0]): sys.stderr.write('nsinstall: ' + args[0] + ' is not a directory\n') sys.exit(1) if options.m: os.chmod(args[0], options.m) - sys.exit() - if options.m: - os.makedirs(args[0], options.m) - else: - os.makedirs(args[0]) return 0 # nsinstall arg1 [...] directory