From d58fdaa2cde86feeeb6865b9ecbdae70c94dff3a Mon Sep 17 00:00:00 2001
From: Adriaan de Groot <groot@kde.org>
Date: Tue, 8 Oct 2019 15:00:25 +0200
Subject: [PATCH] [unpackfs] Stub of special handling for a single file

---
 src/modules/unpackfs/main.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/modules/unpackfs/main.py b/src/modules/unpackfs/main.py
index fd3f97353..b6cdd76a0 100644
--- a/src/modules/unpackfs/main.py
+++ b/src/modules/unpackfs/main.py
@@ -303,6 +303,10 @@ class UnpackOperation:
         try:
             if entry.is_file():
                 source = entry.source
+                if entry.total <= 1:
+                    # If there is one file, *and* the target does not exist (as a file or dir)
+                    # but the dirname of the target does, we should copy just one file and rename.
+                    pass
             else:
                 source = imgmountdir