Re: [Rpm-maint] [rpm-software-management/rpm] Support libgrypt as crypto library (#826)

2019-09-09 Thread ニール・ゴンパ
@pmatilai Perhaps we may want to add a commit to deprecate NSS backend or just 
straight rip it out?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/826#issuecomment-529617826___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Correct and update Query formats documentation (#827)

2019-09-09 Thread Panu Matilainen
Merged #827 into master.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/827#event-2618729816___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Correct and update Query formats documentation (#827)

2019-09-09 Thread Panu Matilainen
Works for me.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/827#issuecomment-529480192___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Correct and update Query formats documentation (#827)

2019-09-09 Thread pavlinamv
>>Or just leave them as historical reference for future generations to gape 
>> at...

> I like this option. :)

Changed. I leave the original names.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/827#issuecomment-529469822___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Correct and update Query formats documentation (#827)

2019-09-09 Thread pavlinamv
@pavlinamv pushed 1 commit.

8a1f9ec0f420ba4a5eec64db52c5d86ff6162c03  Correct and update Query formats 
documentation


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/827/files/209faf3a124341c3e26ba811759a09ec89490603..8a1f9ec0f420ba4a5eec64db52c5d86ff6162c03
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Rip the marker support for multiline %{expr:...} error messages (#828)

2019-09-09 Thread Panu Matilainen
Merged #828 into master.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/828#event-2618623253___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Correct and update Query formats documentation (#827)

2019-09-09 Thread ニール・ゴンパ
> Or just leave them as historical reference for future generations to gape 
> at...

I like this option. :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/827#issuecomment-529461999___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Correct and update Query formats documentation (#827)

2019-09-09 Thread Panu Matilainen
pmatilai commented on this pull request.



>  
 To make this work properly, you need to tell RPM to always print the first
 item in the NAME element. You do this by placing a '=' before the tag
 name, like this:
 
 \verbatim
-rpm -q --queryformat "[%{=NAME} %{FILENAMES}\n]" cdp
+rpm -q --queryformat "[%{=NAME} %{FILENAMES}\n]" systemd

If you change this, then you also need to change the output sample below.

We can't list the entire systemd package contents there so dunno if it's really 
worth it. Looking closer, there are several other now extinct package names 
mentioned in the document too, IF we want to update then maybe we should update 
them all. Or just leave them as historical reference for future generations to 
gape at...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/827#pullrequestreview-285487935___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Rip the marker support for multiline %{expr:...} error messages (#828)

2019-09-09 Thread pavlinamv
Corrected according to the review.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/828#issuecomment-52945___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Rip the marker support for multiline %{expr:...} error messages (#828)

2019-09-09 Thread pavlinamv
@pavlinamv pushed 1 commit.

218633033acea714edbbdb6b21a8dba8aa3d39e8  Disable marker on multiline 
expression error messages


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/828/files/b2260fbae4087f55615219376906d066db7341ee..218633033acea714edbbdb6b21a8dba8aa3d39e8
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Improve description of conditionals + comments in spec documentation (#830)

2019-09-09 Thread Panu Matilainen
pmatilai commented on this pull request.



> +%elifarch, %elifos or %else can be optionally used. Conditionals %endif and
+%else should not be followed by any text. Conditionals may be nested within
+other conditionals.
+
+Conditionals are not macros. It has an interesting consequence (similar as
+the fact that macros get expanded in comments). If a conditional is a part
+of a definition like
+\verbatim
+   %define macro_with_if \
+   %if 0  \
+   %global output XXX\
+   %endif
+\endverbatim
+the expansion (including %global) occurs before evaluating of the
+conditionals. Thus after the expansion of %macro_with_if macro %output
+is defined to XXX.

I don't think this last block belongs here, at least in this detail. Dark 
corners are often best left undocumented to allow changing if a saner behavior 
becomes feasible later. I'd condense that into something like:

%if-conditionals are not macros, and are unlikely to yield expected results if 
used in them.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/830#pullrequestreview-285483065___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Improve description of conditionals + comments in spec documentation (#830)

2019-09-09 Thread Panu Matilainen
pmatilai commented on this pull request.



> +
+%if can be used for various purposes. The test can be evaluated based on
+the existence of a macro, like:
+\verbatim
+   %if %{defined with_foo} && %{undefined with_bar}
+\endverbatim
+string comparison:
+\verbatim
+   %if %{optimize_flags} != "none"
+\endverbatim
+or a mathematical statement:
+\verbatim
+   %if 0%{?fedora} > 10 || 0%{?rhel} > 7
+\endverbatim
+Generally, a mathematical statement allows to use logical operators
+&&, ||, !, relational operators !=, ==, <, > , <=, >= and parentheses.

Might as well document the rest of the mathematical operators as well (+-/*)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/830#pullrequestreview-285478700___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Improve description of conditionals + comments in spec documentation (#830)

2019-09-09 Thread Panu Matilainen
pmatilai commented on this pull request.



>   %endif
 \endverbatim
 
-Conditionals are not macros, thus they can be used in spec files only.
+%ifos is used to control RPM's spec file processing according to the
+build system's operating system.
+
+%if can be used for various purposes. The test can be evaluated based on
+the existence of a macro, like:
+\verbatim
+   %if %{defined with_foo} && %{undefined with_bar}
+\endverbatim
+string comparison:
+\verbatim
+   %if %{optimize_flags} != "none"

To set a good example, for string comparisons it's best to quote both operands.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/830#pullrequestreview-285477252___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Improve description of conditionals + comments in spec documentation (#830)

2019-09-09 Thread Panu Matilainen
pmatilai commented on this pull request.



>   %endif
 \endverbatim
 
-Conditionals are not macros, thus they can be used in spec files only.
+%ifos is used to control RPM's spec file processing according to the
+build system's operating system.

It's not build system's operating system, but the build *target* operating 
system. In > 99% of the cases that's the same thing, but in theory rpm supports 
cross-architecture and -os builds.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/830#pullrequestreview-285475964___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Improve description of conditionals + comments in spec documentation (#830)

2019-09-09 Thread Panu Matilainen
pmatilai commented on this pull request.



>  \verbatim
-   %ifarch ppc64 ppc x86_64
-   ...
-   %if 0%{?ver} && 0%{?ver} >= 100
-   ...
-   %else
-   ...
-   %endif
+   %ifarch %{power64} s390x x86_64 ia64
+   %global architectures 1

The new example is just as meaningles as the old one. While we're at it, lets 
make the example actually meaningful. As in, something that actually explains 
why somebody would want to use it, such as this snippet from anaconda.spec:
```
%ifarch s390 s390x
BuildRequires: s390utils-devel
%endif
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/830#pullrequestreview-285474685___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Correct and update Query formats documentation (#827)

2019-09-09 Thread pavlinamv
Moreover to the described corrections (according to the review) I add an 
example of example of a query expression.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/827#issuecomment-529451544___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Improve description of conditionals + comments in spec documentation (#830)

2019-09-09 Thread Panu Matilainen
pmatilai commented on this pull request.



> @@ -214,24 +214,67 @@ can express this as
BuildConflicts: gcc <= 2.7.2.1
 \endverbatim
 
+\section comments Comments
+
+Comments in spec file have # at the start of the line.
+\verbatim
+   # this is a comment
+\endverbatim
+Macros are expanded in comments, thus if a macro is in comment use two percent
+characters before it:

I'd make that more like:
```
Macros are expanded even in comment lines. If this is undesireable, escape the 
macro with an extra percent sign (%):
<...example..>
```

Now that we have such a thing, it'd be good to mention %dnl as a less quirky 
way of adding comments to specs.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/830#pullrequestreview-285472092___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Correct and update Query formats documentation (#827)

2019-09-09 Thread pavlinamv
@pavlinamv pushed 1 commit.

209faf3a124341c3e26ba811759a09ec89490603  Correct and update Query formats 
documentation


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/827/files/f7c7f469966081328932a6320c22e54643e59952..209faf3a124341c3e26ba811759a09ec89490603
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Rip the marker support for multiline %{expr:...} error messages (#828)

2019-09-09 Thread Panu Matilainen
pmatilai commented on this pull request.



> @@ -110,6 +110,12 @@ typedef struct _parseState {
 static void exprErr(const struct _parseState *state, const char *msg,
const char *p)
 {
+const char *s = state->str;
+
+s = strchr(s,'\n');
+if (s && (*(s+1) != '\0'))
+   p = NULL;
+

While "s" is perfectly acceptable variable name in a case like this, a more 
descriptive one would make the code that little bit more readable. Say, "nl" or 
even "newline", after which the whole thing reads almost as human language. 
*Almost* :)


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/828#pullrequestreview-285450831___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Rip the marker support for multiline %{expr:...} error messages (#828)

2019-09-09 Thread Panu Matilainen
pmatilai commented on this pull request.



> @@ -110,6 +110,12 @@ typedef struct _parseState {
 static void exprErr(const struct _parseState *state, const char *msg,
const char *p)
 {
+const char *s = state->str;
+
+s = strchr(s,'\n');

Waste of perfectly good screen estate... Why not just 
```const char *s = strchr(state->str, '\n');```



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/828#pullrequestreview-285450509___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Correct and update Query formats documentation (#827)

2019-09-09 Thread Panu Matilainen
pmatilai requested changes on this pull request.

A welcome update, but lets make it really count. Please address the individual 
comments.

> @@ -136,6 +135,8 @@ readable format in SI resp IEC 8 standard.
 humansi uses 1K = 1000, 1M = 100, ...
 humaniec uses 1K = 1024, 1M = 1048576, ...
 
+The formatting tags are listed in lib/formats.c in structure headerFmt_s.

Source code is not user documentation and should not be linked as such. The 
formats are documented in rpm (8) manual in the QUERY OPTIONS section.

> @@ -153,10 +154,10 @@ braces.
 
 \section queryformat_example Example: Viewing the Verify Flags
 
-The following example query is run against dev because I know %verify
-is used there.
+The following example query is run against nss because %verify is used
+there.

I agree the old sentence is pretty bad, but this is not much of an improvement. 
"nss" doesn't go by that name everywhere, the packaging details such as the 
name and use of %verify are highly distro specific. These days, "systemd" might 
well be the most ubiquitous name there is, but that doesn't make %verify flags 
any less distro specific.

>  \verbatim
-   rpm -q --qf '[%{filenames} %{fileverifyflags}\n]' dev
+   rpm -q --qf '[%{FILENAMES} %{FILEVERIFYFLAGS:hex}\n]' nss

To really improve this example, I'd suggest using something else than 
FILEVERIFYFLAGS for the data. FILEMODES:octal might be a better example as all 
packages with files have them, and the values are commonly known, so you could 
delete the rpmfiles.h reference and values from the document too.

> @@ -90,11 +89,11 @@ grep or awk). If you try the obvious,
 rpm -q --queryformat "[%{NAME} %{FILENAMES}\n]" cdp

While we're updating package names, here's another candidate. Even I don't 
remember what "cdp" used to do :D

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/827#pullrequestreview-285425915___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Support libgrypt as crypto library (#826)

2019-09-09 Thread Panu Matilainen
In a perfect world I'd be much happier with less choice over crypto 
implementations, but as it is, with our default being something of a cross 
between a gorilla and an elephant on our back, and the nicer one being 
license-restricted... 

Did a quick performance comparison between the variants, ```time ./rpm -qa|wc 
-l``` on my laptop, results are fastest from three runs each:

$time ./rpm -qa|wc -l

* openssl:
real0m1.609s
user0m1.523s
sys 0m0.111s

* libgcrypt:
real0m1.983s
user0m1.902s
sys 0m0.130s

* nss:
real0m2.683s
user0m2.580s
sys 0m0.124s

* beecrypt:
real0m4.706s
user0m4.610s
sys 0m0.115s

This comparison is quite favorable too:
$ wc -l  rpmio/digest_*.c
  507 rpmio/digest_beecrypt.c
  404 rpmio/digest_libgcrypt.c
  532 rpmio/digest_nss.c
  833 rpmio/digest_openssl.c

It's the simplest of them all code-wise and second fastest overall, beating our 
current default at both and with a nice license. Not to mention just a fraction 
of the size of the nss on the library side. What's not to like?

I'll be happy to merge, but I'd actually suggest going one step further: add a 
separate commit to make libgcrypt the default.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/826#issuecomment-529410611___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Suppress inhibition lock warning message in single-user mode (#831)

2019-09-09 Thread shogo-matsumoto
The inhibition lock warning message is output in single-user mode
due to absent of dbus service. I suppress the warning message because
the inhibit operation may not be needed in this mode and the message
just confuses users.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/831

-- Commit Summary --

  * Suppress inhibition lock warning message in single-user mode

-- File Changes --

M plugins/systemd_inhibit.c (4)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/831.patch
https://github.com/rpm-software-management/rpm/pull/831.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/831
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint