Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xbstrap: add discard command for nuking packages #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

no92
Copy link
Member

@no92 no92 commented May 20, 2022

No description provided.

@ArsenArsen
Copy link
Member

Why change the meaning of mark_* instead of just removing the source and build directories (especially since this might lead to conflicts of some sort)?

Also, what scenario is this necessary in that isn't better addressed otherwise?

xbstrap/__init__.py Outdated Show resolved Hide resolved
@no92
Copy link
Member Author

no92 commented Jan 23, 2023

Addressed the issues raised above.

@Dennisbonke
Copy link
Member

Bump.

@ArsenArsen
Copy link
Member

my question remains unadressed

@no92
Copy link
Member Author

no92 commented Apr 10, 2023

Also, what scenario is this necessary in that isn't better addressed otherwise?

I use this to clean up sources I don't need (e.g. before pulling from CI), e.g. after upstreaming them. Also, testing patches is really convenient. Manually removing risks leaving parts of the package behind, which this would avoid. Finally, providing a way to delete packages is, to me, the natural counterpart to being able to build/pull them.

Copy link
Member

@ArsenArsen ArsenArsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still unconvinced theres a scenario in which this helps and which isn't an xbstrap bug. to address the ones you mentioned:

  • testing patches should work the same as with any git checkout? otherwise, rming just the source tree ought to work
  • manually removing the source directory should cause all the other package related data to go stale
  • this isn't a way to delete packages, as they remain in the repository if this command is done

i think it'd be better if this just became an uninstall command. one is needed, and this does that after mucking with some (but not all) package related information

Comment on lines +2628 to +3064
if cfg.use_xbps:
output = subprocess.DEVNULL
if verbosity:
output = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

xbstrap/base.py Outdated
Comment on lines 2641 to 3075
else:
raise GenericError("Package management configuration does not support discard")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it does - you already delete stuff when this happens?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

xbstrap/base.py Outdated Show resolved Hide resolved
@ikbenlike
Copy link

personally I feel a command like this is useful - I have ran into cases where I want to purge a package locally, and having to go in with a separate tool (even if just rm/rmdir) to do so feels like an oversight in the user experience of xbstrap, even more so because this functionality is seemingly trivial to implement

@ArsenArsen
Copy link
Member

again, an uninstall command would be very useful.
the delete-source action here also seems unobjectionable, even though I don't see how it's any better than removing source directories you work in manually anyway, however, the discard-pkg action does not discard pkgs (it uninstalls, but deletes build, but doesn't delete artifacts), hence it is not really acceptable in its current form

Comment on lines +2639 to +3073
_util.log_info("Running {}".format(args))
subprocess.call(args, env=environ, stdout=output)
Copy link
Member

@ArsenArsen ArsenArsen Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't there a helper for this?

(edit: that might be xbbs, please make one if there isn't one)

Copy link
Member

@ElectrodeYT ElectrodeYT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to resurrect this, but I would really like this to land in xbstrap at some point

Other than the package management bit, this looks OK to me, but i would also like a seperate uninstall command that just does xbps-remove and nothing else

xbstrap/base.py Outdated Show resolved Hide resolved
xbstrap/base.py Outdated
Comment on lines 2641 to 3075
else:
raise GenericError("Package management configuration does not support discard")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants