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 — xbps-uhelper: add verbose output for cmpver/pkgmatch by classabbyamp · Pull Request #549 · void-linux/xbps

Conversation

@classabbyamp

@classabbyamp classabbyamp commented Mar 29, 2023

Copy link
Copy Markdown
Member

I can never remember which retval means which thing. This only prints if -v/--verbose is specified.

Examples:

$ ./bin/xbps-uhelper/xbps-uhelper -v cmpver 1 2 ; echo ret: $?
1 < 2
ret: 255
$ ./bin/xbps-uhelper/xbps-uhelper -v cmpver 1 1 ; echo ret: $?
1 = 1
ret: 0
$ ./bin/xbps-uhelper/xbps-uhelper -v cmpver 2 1 ; echo ret: $?
2 > 1
ret: 1
$ ./bin/xbps-uhelper/xbps-uhelper -v pkgmatch 'foo-1.0_1' 'foo>=0' ; echo ret: $?
foo-1.0_1 matches foo>=0
ret: 1
$ ./bin/xbps-uhelper/xbps-uhelper -v pkgmatch 'foo-1.0_1' 'foo<0.1_1' ; echo ret: $?
foo-1.0_1 does not match foo<0.1_1
ret: 0

it also seems that getting an error from pkgmatch is currently impossible

Sorry, something went wrong.

Uh oh!

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

All reactions
@leahneukirchen

leahneukirchen commented Mar 30, 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.

Chocimier
Chocimier approved these changes Apr 12, 2023
View reviewed changes

@Chocimier Chocimier left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Nice, can you add completion too?

diff --git a/data/_xbps b/data/_xbps
index 31587571..6b5e3153 100644
--- a/data/_xbps
+++ b/data/_xbps
@@ -232,6 +232,7 @@ _xbps_uhelper() {
                {-C,--config=-}'[Full path to configuration file]:config file:_files' \
                {-d,--debug}'[Debug mode shown to stderr]' \
                {-r,--rootdir=-}'[Full path to rootdir]:root dir:_files -/' \
+               {-v,--verbose}'[Verbose messages]' \
                {-V,--version}'[Show XBPS version]' \
                '1:action:->actions' \
                '*:: :->args' && ret=0

Sorry, something went wrong.

Uh oh!

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

All reactions
@classabbyamp
classabbyamp force-pushed the uhelper-verbose branch from 9ef4389 to b0768e2 Compare April 12, 2023 19:57
@classabbyamp

classabbyamp commented Apr 12, 2023

Copy link
Copy Markdown
Member Author

Nice, can you add completion too?

ope forgot that, done (in a better way i think)

All reactions

Sorry, something went wrong.

Uh oh!

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

@classabbyamp

classabbyamp commented Apr 12, 2023

Copy link
Copy Markdown
Member Author

I've fixed that CI failure in f117b1f

All reactions

Sorry, something went wrong.

Uh oh!

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

@Duncaen

Duncaen commented May 30, 2023

Copy link
Copy Markdown
Member

What about printing this to stderr instead of stdout?

All reactions

Sorry, something went wrong.

Uh oh!

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

@classabbyamp

classabbyamp commented May 30, 2023

Copy link
Copy Markdown
Member Author

yes good idea

All reactions

Sorry, something went wrong.

Uh oh!

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

@classabbyamp
classabbyamp force-pushed the uhelper-verbose branch 2 times, most recently from 38facaf to 43e5a7f Compare June 1, 2023 18:15
@classabbyamp
xbps-uhelper: add verbose output for cmpver/pkgmatch
d7d76ae
I can never remember which retval means which thing. This only prints if
-v/--verbose is specified.

Examples:
```
$ ./bin/xbps-uhelper/xbps-uhelper -v cmpver 1 2 ; echo ret: $?
1 < 2
ret: 255
$ ./bin/xbps-uhelper/xbps-uhelper -v cmpver 1 1 ; echo ret: $?
1 = 1
ret: 0
$ ./bin/xbps-uhelper/xbps-uhelper -v cmpver 2 1 ; echo ret: $?
2 > 1
ret: 1
$ ./bin/xbps-uhelper/xbps-uhelper -v pkgmatch 'foo-1.0_1' 'foo>=0' ; echo ret: $?
foo-1.0_1 matches foo>=0
ret: 1
$ ./bin/xbps-uhelper/xbps-uhelper -v pkgmatch 'foo-1.0_1' 'foo<0.1_1' ; echo ret: $?
foo-1.0_1 does not match foo<0.1_1
ret: 0
```

it also seems that getting an error from pkgmatch is currently impossible
@classabbyamp
classabbyamp force-pushed the uhelper-verbose branch from 43e5a7f to d7d76ae Compare June 1, 2023 18:16
@Duncaen
Duncaen merged commit 50fb201 into void-linux:master Jun 1, 2023
@classabbyamp
classabbyamp deleted the uhelper-verbose branch June 1, 2023 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@Chocimier Chocimier Chocimier approved these changes
Reviewers whose approvals may not affect merge requirements

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.

4 participants

@classabbyamp @leahneukirchen @Duncaen @Chocimier
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.