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

xbps-uhelper: add verbose output for cmpver/pkgmatch #549

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.

Sign up for GitHub

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

Merged
Duncaen merged 1 commit into void-linux:master from classabbyamp:uhelper-verbose
Jun 1, 2023

Uh oh!

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

Merged

xbps-uhelper: add verbose output for cmpver/pkgmatch #549

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
d7d76ae
xbps-uhelper: add verbose output for cmpver/pkgmatch
classabbyamp Mar 29, 2023
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

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

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

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

Diff view
Diff view

There are no files selected for viewing

28 changes: 24 additions & 4 deletions 28 bin/xbps-uhelper/main.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ usage(void)
" -C --config <dir> Path to confdir (xbps.d)\n"
" -d --debug Debug mode shown to stderr\n"
" -r --rootdir <dir> Full path to rootdir\n"
" -v --verbose Verbose messages\n"
" -V --version Show XBPS verison\n"
"\n"
"MODE\n"
Expand Down Expand Up @@ -96,11 +97,12 @@ main(int argc, char **argv)
{ "config", required_argument, NULL, 'C' },
{ "debug", no_argument, NULL, 'd' },
{ "rootdir", required_argument, NULL, 'r' },
{ "verbose", no_argument, NULL, 'v' },
{ "version", no_argument, NULL, 'V' },
{ NULL, 0, NULL, 0 }
};

while ((c = getopt_long(argc, argv, "C:dr:V", longopts, NULL)) != -1) {
while ((c = getopt_long(argc, argv, "C:dr:vV", longopts, NULL)) != -1) {
switch (c) {
case 'C':
confdir = optarg;
Expand All @@ -112,6 +114,9 @@ main(int argc, char **argv)
case 'd':
flags |= XBPS_FLAG_DEBUG;
break;
case 'v':
flags |= XBPS_FLAG_VERBOSE;
break;
case 'V':
printf("%s\n", XBPS_RELVER);
exit(EXIT_SUCCESS);
Expand Down Expand Up @@ -318,14 +323,29 @@ main(int argc, char **argv)
/* Matches a pkg with a pattern */
if (argc != 3)
usage();

exit(xbps_pkgpattern_match(argv[1], argv[2]));
rv = xbps_pkgpattern_match(argv[1], argv[2]);
if (flags & XBPS_FLAG_VERBOSE) {
if (rv >= 0)
fprintf(stderr, "%s %s %s\n",
argv[1],
(rv == 1) ? "matches" : "does not match",
argv[2]);
else
xbps_error_printf("%s: not a pattern\n", argv[2]);
}
exit(rv);
} else if (strcmp(argv[0], "cmpver") == 0) {
/* Compare two version strings, installed vs required */
if (argc != 3)
usage();

exit(xbps_cmpver(argv[1], argv[2]));
rv = xbps_cmpver(argv[1], argv[2]);
if (flags & XBPS_FLAG_VERBOSE)
fprintf(stderr, "%s %s %s\n",
argv[1],
(rv == 1) ? ">" : ((rv == 0) ? "=" : "<"),
argv[2]);
exit(rv);
} else if (strcmp(argv[0], "arch") == 0) {
/* returns the xbps native arch */
if (argc != 1)
Expand Down
19 changes: 19 additions & 0 deletions 19 bin/xbps-uhelper/xbps-uhelper.1
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ Enables extra debugging shown to stderr.
Show the help message.
.It Fl r, Fl -rootdir Ar dir
Specifies a full path for the target root directory.
.It Fl v, Fl -verbose
Enables verbose messages.
.It Fl V, Fl -version
Show the version information.
.El
Expand All @@ -85,6 +87,14 @@ strings,
See
.Sx EXIT STATUS
for more information.
If
.Fl -verbose
is specified, also prints
.Qo
.Ar instver
<|=|>
.Ar reqver
.Qc .
.It Cm getname Ar string ...
Prints the pkgname of
.Ar pkgpatterns
Expand Down Expand Up @@ -126,6 +136,15 @@ with a
See
.Sx EXIT STATUS
for more information.
If
.Fl -verbose
is specified, also prints
.Qo
.Ar pkgver
matches|does not match
.Ar pkgpattern
.Qc ,
or an error.
.It Cm real-version Ar pkgname ...
Prints the version of installed real packages.
.It Cm version Ar pkgname ...
Expand Down
5 changes: 1 addition & 4 deletions 5 data/_xbps
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,7 @@ _xbps_uchroot() {
_xbps_uhelper() {
local ret=1
_arguments \
{-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,--version}'[Show XBPS version]' \
$_xbps_common \
'1:action:->actions' \
'*:: :->args' && ret=0
case $state in
Expand Down
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.