From 7954ba9bc196b34ced6c3359c464afbd0678c2e0 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Wed, 28 Nov 2018 13:34:45 -0500
Subject: productbuild: escape pkg-ref urls

Inspired-by: James Goruk <james.goruk@gmail.com>
Fixes: #18645
---
 Source/CPack/cmCPackPKGGenerator.cxx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx
index bdda386..9401bca 100644
--- a/Source/CPack/cmCPackPKGGenerator.cxx
+++ b/Source/CPack/cmCPackPKGGenerator.cxx
@@ -225,7 +225,8 @@ void cmCPackPKGGenerator::CreateChoice(const cmCPackComponent& component,
     xout.Content(this->GetPackageName(component));
   } else {
     xout.Content("file:./");
-    xout.Content(relativePackageLocation);
+    xout.Content(cmSystemTools::EncodeURL(relativePackageLocation,
+                                          /*escapeSlashes=*/false));
   }
   xout.EndElement(); // pkg-ref
 }
-- 
cgit v0.12