verbosearg.diff

OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=590
This commit is contained in:
Michael Schröder 2021-10-06 14:02:17 +00:00 committed by Git OBS Bridge
parent a6beaf17ca
commit 814fa01bc3
3 changed files with 35 additions and 1 deletions

View File

@ -12,6 +12,7 @@ Thu Sep 23 20:57:45 CEST 2021 - mls@suse.de
- new patches:
* python-rpm-packaging.diff
* singlefilemode.diff
* verbosearg.diff
- modified patches:
* usr-lib-sysimage-rpm.patch
* localetag.diff

View File

@ -114,6 +114,7 @@ Patch117: findsupplements.diff
Patch122: db_conversion.diff
Patch123: nextiteratorheaderblob.diff
Patch131: posttrans.diff
Patch132: verbosearg.diff
Patch200: finddebuginfo.diff
Patch201: finddebuginfo-absolute-links.diff
Patch202: debugsubpkg.diff
@ -241,7 +242,7 @@ rm -rf sqlite
%patch -P 93 -P 94 -P 99
%patch -P 100 -P 102 -P 103
%patch -P 117
%patch -P 122 -P 123 -P 131
%patch -P 122 -P 123 -P 131 -P 132
# debugedit patches
pushd debugedit-5.0

32
verbosearg.diff Normal file
View File

@ -0,0 +1,32 @@
--- ./rpmio/macro.c.orig
+++ ./rpmio/macro.c
@@ -1141,7 +1141,10 @@ static size_t doExpand(MacroBuf mb, rpmMacroEntry me, ARGV_t argv)
static size_t doVerbose(MacroBuf mb, rpmMacroEntry me, ARGV_t argv)
{
- mbAppend(mb, rpmIsVerbose() ? '1' : '0');
+ if (argv[1] != NULL)
+ mbAppendStr(mb, rpmIsVerbose() ? argv[1] : "");
+ else
+ mbAppend(mb, rpmIsVerbose() ? '1' : '0');
return 0;
}
@@ -1282,7 +1285,7 @@ static struct builtins_s {
{ "uncompress", doUncompress, 1, ME_FUNC },
{ "undefine", doUndefine, 1, ME_FUNC },
{ "url2path", doFoo, 1, ME_FUNC },
- { "verbose", doVerbose, 0, ME_FUNC },
+ { "verbose", doVerbose, -1, ME_FUNC },
{ "warn", doOutput, 1, ME_FUNC },
{ NULL, NULL, 0 }
};
@@ -1347,7 +1350,7 @@ doExpandThisMacro(MacroBuf mb, rpmMacroEntry me, ARGV_t args, size_t *parsed)
int nargs = argvCount(args) - 1;
int needarg = (me->nargs != 0);
int havearg = (nargs > 0);
- if (needarg != havearg) {
+ if (((me->flags & ME_PARSE) || me->nargs >= 0) && needarg != havearg) {
mbErr(mb, 1, "%%%s: %s\n", me->name, needarg ?
_("argument expected") : _("unexpected argument"));
goto exit;