Skip to content

Commit

Permalink
python-installer: patch behavior for when script file exists
Browse files Browse the repository at this point in the history
This seems to happen when re-triggering a build.
The destination path is already there, so this exception gets raised.

Another approach is to do 'make package/<python-package>/clean' and
re-trigger the build.
But that becomes annoying.

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
  • Loading branch information
commodo committed Dec 25, 2024
1 parent b673425 commit ebfbc7d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lang/python/python-installer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=python-installer
PKG_VERSION:=0.7.0
PKG_RELEASE:=1
PKG_RELEASE:=2

PYPI_NAME:=installer
PKG_HASH:=a26d3e3116289bb08216e0d0f7d925fcef0b0194eedfa0c944bcaaa106c4b631
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/installer/destinations.py b/src/installer/destinations.py
index a3c1967..9f733c8 100644
--- a/src/installer/destinations.py
+++ b/src/installer/destinations.py
@@ -164,7 +164,7 @@ class SchemeDictionaryDestination(WheelDestination):
target_path = self._path_with_destdir(scheme, path)
if os.path.exists(target_path):
message = f"File already exists: {target_path}"
- raise FileExistsError(message)
+ os.remove(target_path)

parent_folder = os.path.dirname(target_path)
if not os.path.exists(parent_folder):

0 comments on commit ebfbc7d

Please sign in to comment.