Skip to content

Commit 4393732

Browse files
reckless: don't update a plugin if a specific tag was previously installed
1 parent 086ebe5 commit 4393732

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/reckless

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,7 @@ class UpdateStatus(Enum):
17031703
UNINSTALLED = 2
17041704
ERROR = 3
17051705
METADATA_MISSING = 4
1706+
REFUSING_UPDATE = 5
17061707

17071708

17081709
def update_plugin(plugin_name: str) -> tuple:
@@ -1731,7 +1732,10 @@ def update_plugin(plugin_name: str) -> tuple:
17311732
for key in metadata:
17321733
if metadata[key].lower() == 'none':
17331734
metadata[key] = None
1734-
log.debug(f'{plugin_name} installation metadata: {str(metadata)}')
1735+
log.debug(f'{plugin_name} previous installation metadata: {str(metadata)}')
1736+
if metadata['requested commit']:
1737+
log.warning(f'refusing to upgrade {plugin_name}@{metadata["requested commit"]} due to previously requested tag/commit')
1738+
return (None, UpdateStatus.REFUSING_UPDATE)
17351739

17361740
src = InstInfo(plugin_name,
17371741
metadata['original source'], None)

0 commit comments

Comments
 (0)