Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ jobs:
with:
python-version: "3.9"
- name: Install dependencies
run: sudo apt-get install libcairo2-dev gcc python3-dev libgirepository1.0-dev libostree-dev fuse-overlayfs libcap-dev autoconf && python -m pip install -r requirements.txt && python -m pip install pylint
run: |
sudo apt-get update
sudo apt-get install libcairo2-dev gcc python3-dev libgirepository1.0-dev libostree-dev\
fuse-overlayfs libcap-dev autoconf
python -m pip install -r requirements.txt
python -m pip install pylint
- name: pylint
run: pylint --rcfile pylint.toml src/maps

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project tries to adhere to [Semantic Versioning](https://semver.org/spe
already installed.

### Changed
- Debugfix: Added some debugging info and mildly rework uninstall.

### Removed

Expand Down
28 changes: 25 additions & 3 deletions src/maps
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,20 @@ def uninstall_runtime(repo, args):
opts = '-rvf'
else:
opts = '-rf'
subprocess.run(f"rm {opts} {DATADIR}".split(), check=True)

try:
subprocess.run(f"rm {opts} {DATADIR}".split(), check=True)
except subprocess.CalledProcessError as e:
print(
"Removing files failed... This can sometimes happen if maps was killed instead of "
"graceful termination. Check the error message for which directory failed removal. "
f"\n\n{e}"
)

for sruntime in repo.list_refs()[1].keys():
if runtime in sruntime:
if remote == '_local':
remote = None
FLAG_REFEXISTS = True
if VERBOSE:
print("Marking branch for deletion from repo...")
Expand All @@ -766,8 +776,20 @@ def uninstall_runtime(repo, args):
break

if not (FLAG_DIREXISTS and FLAG_REFEXISTS):
print(f"Error, {remote}:{runtime} isn't deployed and thus cannot be uninstalled!")
sys.exit(2)
if VERBOSE:
print(f"FLAG_DIREXISTS: {FLAG_DIREXISTS}")
print(f"FLAG_REFEXISTS: {FLAG_REFEXISTS}")
if not remote:
remote = '_local'
if not FLAG_DIREXISTS and not FLAG_REFEXISTS:
print(f"Error, {remote}:{runtime} isn't deployed and thus cannot be uninstalled!")
sys.exit(2)
elif FLAG_DIREXISTS:
print(f"{remote}:{runtime} was not present in the local runtime, but was deployed on "
"the filesystem. Files were removed!")
elif FLAG_REFEXISTS:
print(f"{remote}:{runtime} was not deployed on the filesystem. Pruned from the local "
"repository!")
else:
print(f"Uninstalled {runtime} !")

Expand Down