GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bin/xbps-uhelper: allow multiple arguments for many actions by classabbyamp · Pull Request #536 · void-linux/xbps

Conversation

@classabbyamp

@classabbyamp classabbyamp commented Feb 9, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • allow multiple arguments for many actions

Only implemented where it makes sense to, i.e., not cmpver, pkgmatch, arch, getsystemdir, digest, and fetch.

Tests show a large speed-up is possible when processing a large number of inputs (1718 in this case):

Before

xbps-query -Rp pkgver -s python  0.18s user 0.02s system 99% cpu 0.199 total
cut -d: -f1  0.00s user 0.00s system 0% cpu 0.198 total
xargs -n1 xbps-uhelper getpkgname > /dev/null  0.49s user 1.17s system 94% cpu 1.761 total

After

xbps-query -Rp pkgver -s python  0.17s user 0.03s system 99% cpu 0.200 total
cut -d: -f1  0.00s user 0.00s system 0% cpu 0.200 total
xargs ./bin/xbps-uhelper/xbps-uhelper getpkgname > /dev/null  0.00s user 0.00s system 1% cpu 0.197 total

(note the lack of -n1 in the second one)

  • add getname and getversion actions

These actions are kind of "meta" actions, combining getpkgdepname and getpkgname (and the respective version actions) so that a list of mixed pkgvers and package patterns can be interpreted. This uses the internal format check of xbps_pkgpattern_{name,version}() to allow for a fallback to xbps_pkg_{name,version}() for exact versions, then falls back to displaying an error message if that also fails.


this will also be somewhat intertwined with an xbps-uhelper manpage, like in #533

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@classabbyamp
classabbyamp force-pushed the uhelper/moar-args branch from 20a9977 to 9b1b90c Compare February 9, 2023 10:28
@leahneukirchen

leahneukirchen commented Feb 9, 2023

Copy link
Copy Markdown
Member

Useful!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@classabbyamp
classabbyamp force-pushed the uhelper/moar-args branch from 9b1b90c to aee22b4 Compare February 9, 2023 23:23
classabbyamp added 2 commits February 9, 2023 18:25
@classabbyamp
bin/xbps-uhelper: allow multiple arguments for many actions
47acd31
@classabbyamp
bin/xbps-uhelper: add getname and getversion actions
9938759
these actions are kind of "meta" actions, combining getpkgdepname and
getpkgname (and the respective version actions) so that a list of mixed
pkgvers and package patterns can be interpreted. This uses the internal
format check of `xbps_pkgpattern_{name,version}()` to allow for a
fallback to `xbps_pkg_{name,version}()` for exact versions, then falls
back to displaying an error message if that also fails.
@classabbyamp
classabbyamp force-pushed the uhelper/moar-args branch from aee22b4 to 9938759 Compare February 9, 2023 23:50
@classabbyamp
classabbyamp marked this pull request as ready for review February 9, 2023 23:54
@classabbyamp

classabbyamp commented Feb 9, 2023

Copy link
Copy Markdown
Member Author

Useful!

would this be helpful for any xtools? I see xpkg uses sed at the moment

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Duncaen
Duncaen merged commit 7391a7b into void-linux:master Feb 10, 2023
@classabbyamp
classabbyamp deleted the uhelper/moar-args branch February 10, 2023 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@classabbyamp @leahneukirchen @Duncaen
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.