Re: [Rpm-maint] [rpm-software-management/rpm] Remove the internal OpenPGP parser (Issue #2414)

2024-03-25 Thread Michael Schroeder
Yes, I'll take the ownership for now. Thanks.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2414#issuecomment-2017947916
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Add a note about --setenv to test README (PR #2991)

2024-03-25 Thread Michal Domonkos
This is entirely non-obvious as one would assume that any exported env vars are 
inherited by the runroot() subprocesses.  Yet they arent because we 
intentionally reset the environment in the bwrap containers with --clearenv 
(see atlocal.in).  Its a common use case, though, so deserves a proper 
note.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Add a note about --setenv to test README

-- File Changes --

M tests/README.md (7)

-- Patch Links --

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2991
You are receiving this because you are subscribed to this thread.

Message ID: rpm-software-management/rpm/pull/2...@github.com
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add a note about --setenv to test README (PR #2991)

2024-03-25 Thread Michal Domonkos
Merged #2991 into master.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2991#event-12232880576
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add support for sysusers group membership lines (PR #2990)

2024-03-25 Thread Panu Matilainen
@pmatilai commented on this pull request.



> +if rpm.expand('%[0%{?_use_weak_usergroup_deps}]') ~= '0' then
+   return
+end
+for line in io.lines(macros["1"]) do
+if line:sub(1, 1) == '#' then
+goto continue
+end
+fields = {}
+for w in line:gmatch("%S+") do
+table.insert(fields, w)
+end
+if #fields >= 3 and fields[1] == 'm' then
+   print(string.format('user(%s)\\ngroup(%s)', fields[2], fields[3]))
+end
+::continue::
+end

Put these into some %__sysusers_helper() macro (in the same file) that both 
requires and recommends call, no reason to duplicate identical code.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2990#pullrequestreview-1957460293
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add support for sysusers group membership lines (PR #2990)

2024-03-25 Thread Panu Matilainen
@pmatilai commented on this pull request.



> +if rpm.expand('%[0%{?_use_weak_usergroup_deps}]') ~= '0' then
+   return
+end
+for line in io.lines(macros["1"]) do
+if line:sub(1, 1) == '#' then
+goto continue
+end
+fields = {}
+for w in line:gmatch("%S+") do
+table.insert(fields, w)
+end
+if #fields >= 3 and fields[1] == 'm' then
+   print(string.format('user(%s)\\ngroup(%s)', fields[2], fields[3]))
+end
+::continue::
+end

Basically it becomes something like

```
%__sysusers_helper() %{lua:
   ...the actual work...
}

%__sysusers_requires() %{lua:
macros.__sysusers_helper({arg[1], arg[2]})
}
%__sysusers_recommends() %{lua:
macros.__sysusers_helper({arg[1], arg[2]})
}
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2990#discussion_r1537488180
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add support for sysusers group membership lines (PR #2990)

2024-03-25 Thread Panu Matilainen
@pmatilai commented on this pull request.



> @@ -20,3 +20,41 @@
 ::continue::
 end
 }
+
+%__sysusers_recommends() %{lua:
+if rpm.expand('%[0%{?_use_weak_usergroup_deps}]') == '0' then

Oh and there's indeed a nicer way to do this (I remember you asking about this 
but didn't have an answer off-hand):

```
if tonumber(macros._use_weak_usergroup_deps) == 0 then
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2990#pullrequestreview-1957611121
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] rpm2archive -f pax cannot handle utf8 filenames (Issue #2972)

2024-03-25 Thread Michael Schroeder
I'll open a pull request for this.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2972#issuecomment-2017876840
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Support per-user macro configuration in XDG_CONFIG_HOME (PR #2992)

2024-03-25 Thread Panu Matilainen
Look for per-user macros primarily in ${XDG_CONFIG_HOME}/rpmmacros but fall 
back to traditional ~/.rpmmacros iff it exists and theres no config in the 
XDG location. As per the XDG spec, if ${XDG_CONFIG_HOME} is not set, it 
defaults to ~/.config

Fixes: #2153
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Sanitize rpmGlob() behavior wrt non-glob patterns
  * Support per-user macro configuration in XDG_CONFIG_HOME

-- File Changes --

M include/rpm/rpmfileutil.h (4)
M lib/rpmrc.c (55)
M rpmio/rpmglob.c (2)
M tests/rpmmacro.at (35)

-- Patch Links --

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2992
You are receiving this because you are subscribed to this thread.

Message ID: rpm-software-management/rpm/pull/2...@github.com
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add support for sysusers group membership lines (PR #2990)

2024-03-25 Thread Panu Matilainen
@pmatilai commented on this pull request.



> +fields = {}
+for w in line:gmatch("%S+") do
+table.insert(fields, w)
+end
+if #fields >= 3 and fields[1] == 'm' then
+   print(string.format('user(%s)\\ngroup(%s)', fields[2], fields[3]))
+end
+::continue::
+end
+}
+
+%__sysusers_requires() %{lua:
+if rpm.expand('%[0%{?_use_weak_usergroup_deps}]') ~= '0' then
+   return
+end
+for line in io.lines(macros["1"]) do

Parametric macro arguments are available as `arg[1]` etc, no need to go through 
`macros`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2990#pullrequestreview-1957576966
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Add support for sysusers group membership lines (PR #2990)

2024-03-25 Thread Florian Festi
Add support for sysusers group membership lines

m user group

Create Requires/Recommends for both the user and the group.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Re-Word User / Group handling a bit
  * Add support for sysusers group membership lines

-- File Changes --

M docs/manual/users_and_groups.md (23)
M fileattrs/sysusers.attr (38)
M macros.in (21)
M tests/data/SPECS/klang.spec (2)
M tests/rpmi.at (58)

-- Patch Links --

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2990
You are receiving this because you are subscribed to this thread.

Message ID: rpm-software-management/rpm/pull/2...@github.com
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Fix "cannot adjust line" warning in rpm(8) man page (PR #2994)

2024-03-25 Thread Tim Landscheidt
These two commits, ready for inclusion, document that the `--macros` option 
accepts globs as well and fix a warning caused by groff not being able to 
adjust (justify) the line(s) with the default value for the `--macros` option.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Document in rpm(8) that --macros accepts globs
  * Fix cannot adjust line warning in rpm(8) man page

-- File Changes --

M docs/man/rpm.8.md (22)

-- Patch Links --

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2994
You are receiving this because you are subscribed to this thread.

Message ID: rpm-software-management/rpm/pull/2...@github.com
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Set the charset of the libarchive strings to utf8 (PR #2993)

2024-03-25 Thread Michael Schroeder
Our headers are always useing utf8 and the pax standard also requires utf8 
strings. So do this nasty little locale switching to make libarchive not depend 
on the active locale.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Move C_LOCALE setting in front of config.h generation
  * Set the charset of the libarchive strings to utf8
  * rpm2archive: fix error handling in process_package

-- File Changes --

M CMakeLists.txt (14)
M tools/rpm2archive.c (67)

-- Patch Links --

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2993
You are receiving this because you are subscribed to this thread.

Message ID: rpm-software-management/rpm/pull/2...@github.com
___
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 per-user macro configuration in XDG_CONFIG_HOME (PR #2992)

2024-03-25 Thread ニール・ゴンパ
@Conan-Kudo requested changes on this pull request.



> +#ifdef MACROFILES
+static char *initMacroPath(const char *confdir)
+{
+return xstrdup(MACROFILES);
+}
+#else
+/*
+ * Prefer XDG_CONFIG_HOME/rpmmacros but fall back to ~/.rpmmacros
+ * if it exists and the XDG path doesn't.
+ */
+static char *initMacroPath(const char *confdir)
+{
+const char *xdgconf = getenv("XDG_CONFIG_HOME");
+if (!(xdgconf && *xdgconf))
+   xdgconf = "~/.config";
+char *dotpath = rpmGetPath(xdgconf, "/rpmmacros", NULL);

What about `$XDG_CONFIG_HOME/rpm/macros` instead? That mimics what we do in 
`/etc/rpm` too.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2992#pullrequestreview-1958109674
You are receiving this because you are subscribed to this thread.

Message ID: ___
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 per-user macro configuration in XDG_CONFIG_HOME (PR #2992)

2024-03-25 Thread Michal Domonkos
@dmnks commented on this pull request.



> +#ifdef MACROFILES
+static char *initMacroPath(const char *confdir)
+{
+return xstrdup(MACROFILES);
+}
+#else
+/*
+ * Prefer XDG_CONFIG_HOME/rpmmacros but fall back to ~/.rpmmacros
+ * if it exists and the XDG path doesn't.
+ */
+static char *initMacroPath(const char *confdir)
+{
+const char *xdgconf = getenv("XDG_CONFIG_HOME");
+if (!(xdgconf && *xdgconf))
+   xdgconf = "~/.config";
+char *dotpath = rpmGetPath(xdgconf, "/rpmmacros", NULL);

+1 for the above path, too. It's also more conventional, as it seems.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2992#discussion_r1537906333
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RFE: Declarative build system support (#1087)

2024-03-25 Thread Cristian Le
Found out about this new feature. How does one go about constructing such 
`BuildSystem`, do they just define a `%buildsystem__conf` macros?

I am considering the case of [MPI 
packaging](https://pagure.io/packaging-committee/issue/1345) and it would be a 
neat approach to `for` looping all mpi variants. One thing that would be needed 
is to expand `BuildOption(section)` for specific variant, e.g.: 
`BuildOption(conf-serial)`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1087#issuecomment-2018377515
You are receiving this because you are subscribed to this thread.

Message ID: ___
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 per-user macro configuration in XDG_CONFIG_HOME (PR #2992)

2024-03-25 Thread Panu Matilainen
@pmatilai pushed 3 commits.

ee17de74cf23df317e9c53f259c9bdd483a2ff4d  Use rpmGlobPath(... RPMGLOB_NOCHECK) 
for rpmrc reading
3b796dc90e819fe7cfaa621cd7e8d4f62c6c517d  Sanitize rpmGlob() behavior wrt 
non-glob patterns
1172a0f60e336891a86df77de89e3e82d536b39f  Support per-user macro configuration 
in XDG_CONFIG_HOME

-- 
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2992/files/03490923d27afb018990b9c834f6594de8e77607..1172a0f60e336891a86df77de89e3e82d536b39f
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Remove the internal OpenPGP parser (Issue #2414)

2024-03-25 Thread Panu Matilainen
Okay, made you the admin of that repo. Have fun, as they say :sweat_smile: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2414#issuecomment-2018081307
You are receiving this because you are subscribed to this thread.

Message ID: ___
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 per-user macro configuration in XDG_CONFIG_HOME (PR #2992)

2024-03-25 Thread Michal Domonkos
@dmnks requested changes on this pull request.



> @@ -2,6 +2,41 @@
 #
 AT_BANNER([RPM macros])
 
+AT_SETUP([macro path])
+AT_KEYWORDS([macros])
+RPMDB_INIT
+
+# .rpmmacros exists

I'd suggest that we actually check that `~/.rpmmacros` really exists (or just 
`touch` it like in the other tests below). It's currently basically an 
[implementation 
detail](https://github.com/rpm-software-management/rpm/blob/e16bf1fb3198ef0b4c5a1644b627b91db13da99b/tests/Dockerfile.fedora#L55)
 of the test image that, if ever changes, would cause a weird test failure 
:smile: 

> +}
+#else
+/*
+ * Prefer XDG_CONFIG_HOME/rpmmacros but fall back to ~/.rpmmacros
+ * if it exists and the XDG path doesn't.
+ */
+static char *initMacroPath(const char *confdir)
+{
+const char *xdgconf = getenv("XDG_CONFIG_HOME");
+if (!(xdgconf && *xdgconf))
+   xdgconf = "~/.config";
+char *dotpath = rpmGetPath(xdgconf, "/rpmmacros", NULL);
+
+if (rpmGlob(dotpath, NULL, NULL)) {
+   const char *oldcfg = "~/.rpmmacros";
+   if (rpmGlob(oldcfg, NULL, NULL) == 0) {

Cosmetic: This second `rpmGlob()` check doesn't really achieve anything; if 
`~/.rpmmacros` is missing, we'll just keep (the also missing) 
`~/.config/rpmmacros` in `dotpath`. When later loading the macro files in 
`rpmInitMacros()`, we'll just skip over missing ones anyway.

Note that if you remove this check, though, you'll need to update the test 
covering the `XDG_CONFIG_HOME` use case (to actually create the 
`~/.zzz/rpmconfig` file).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2992#pullrequestreview-1957907594
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint