Re: [Rpm-maint] [rpm-software-management/rpm] Updated v3 and v4 package + header format documentation (PR #2861)

2024-01-19 Thread Daniel Alley
@dralley commented on this pull request.



> @@ -56,6 +56,8 @@ contains an OpenPGP signature on the header + payload data. 
> The PGP
 tag is used for RSA signatures and the GPG tag is used for DSA
 signatures.
 
+Note: the signature tags overlap with those of the main header.

Oh, and as per 
https://github.com/rpm-software-management/rpm/issues/2462#issuecomment-1493217258,
 `RPMTAG_FILESIGNATURES` and `RPMSIGTAG_FILESIGNATURES` are actually completely 
different non-overlapping constants, it's just not noticed because of, again, 
the merging of the signature and main headers during queries.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2861#discussion_r1460236459
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] Updated v3 and v4 package + header format documentation (PR #2861)

2024-01-19 Thread Daniel Alley
@dralley commented on this pull request.



> @@ -56,6 +56,8 @@ contains an OpenPGP signature on the header + payload data. 
> The PGP
 tag is used for RSA signatures and the GPG tag is used for DSA
 signatures.
 
+Note: the signature tags overlap with those of the main header.

The precise meaning of this is a bit ambiguous.  It might be possible to read 
this as "some tags can exist in both headers simultaneously" or "some tags can 
exist in either header".  The latter is technically true but isn't that more an 
artifact of how the headers get merged together than "correctness"?

It's definitely not universally true, as something would have to be seriously 
broken for a main header checksum/signature to end up in the main header :)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2861#pullrequestreview-1834626951
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] Updated v3 and v4 package + header format documentation (PR #2861)

2024-01-19 Thread Daniel Alley
@dralley commented on this pull request.



> +short archnum;
+char name[66];
+short osnum;
+short signature_type;
+char reserved[16];
+};
+```
+
+and is illustrated with one pulled from the rpm-2.1.2-1.i386.rpm
+package:
+
+```
+: ed ab ee db 03 00 00 00
+```
+
+The first 4 bytes (0-3) are "magic" used to uniquely identify an RPM

```suggestion
The first 4 bytes (0-3) are the "magic" number used to uniquely identify the 
file as an RPM package.
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2861#pullrequestreview-1834624557
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] Updated v3 and v4 package + header format documentation (PR #2861)

2024-01-19 Thread Daniel Alley
@dralley commented on this pull request.



> +## Lead Format
+
+The Lead is stored as a C structure:
+
+```
+struct rpmlead {
+unsigned char magic[4];
+unsigned char major, minor;
+short type;
+short archnum;
+char name[66];
+short osnum;
+short signature_type;
+char reserved[16];
+};
+```

Should endian-ness be discussed here?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2861#pullrequestreview-1834624461
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] Updated v3 and v4 package + header format documentation (PR #2861)

2024-01-19 Thread Daniel Alley
@dralley commented on this pull request.



> +0048: 00 00 00 00 00 01 00 05
+```
+
+Bytes 76-77 ("00 01" above) form an int16 that indicates the OS the
+package was built for.  In this case, 1 == Linux.  The next 2 bytes
+(78-79) form an int16 that indicates the signature type.  This tells
+RPM what to expect in the Signature.  For version 3.0 packages, this
+is 5, which indicates the new "Header-style" signatures.
+
+```
+0050: 04 00 00 00 68 e6 ff bf
+0058: ab ad 00 08 3c eb ff bf
+```
+
+The remaining 16 bytes (80-95) are currently unused and are reserved
+for future expansion.

The second half of this line probably ought to be tweaked to be a little more 
past-tense.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2861#pullrequestreview-1834623926
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] Updated v3 and v4 package + header format documentation (PR #2861)

2024-01-19 Thread Daniel Alley
@dralley commented on this pull request.



> +
+Field   | Value
+|--
+tag | Must equal the Index Entry (ie 62 or 63)
+type| BIN
+offset  | Size of the region entries in the Index
+count   | 16
+
+The number of entries in the region (aka region index length) can thus be
+calculated as `ril = -offset / sizeof(struct index_entry)`.
+
+When reading a package from disk, the number of region entries is expected
+to be the same as the index length in the Intro. However when a package
+is installed, extra data such as the install time is added to the header,
+that data falls outside the otherwise invisible region line in the index.
+These tags outside the immutable region are called "dribbles" in the RPM

This happens to satisfy 
https://github.com/rpm-software-management/rpm/issues/2462, so thanks for that! 
Feel free to close it or mark it to be closed automatically on merge of the 
commit.

I do also have a side remark under that issue, and I'm wondering if that should 
be tracked as a brand new issue, or discussion, etc. 
https://github.com/rpm-software-management/rpm/issues/2462#issuecomment-1493217258



-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2861#pullrequestreview-1834612619
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] Update format documentation in the manual (PR #2835)

2024-01-19 Thread Daniel Alley
Understood, thanks!  Feel free to close this once you're done with it.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2835#issuecomment-1901738765
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: add way to set macro for --nocheck in rpmbuild (#316)

2024-01-19 Thread Sérgio Basto
I prefer handle https://github.com/rpm-software-management/rpm/issues/2362 and 
https://github.com/rpm-software-management/rpm/issues/1929

since I don't use it but I found many people that use _without (wrongly)

https://sourcegraph.com/search?q=context:global+r:src.fedoraproject.org+file:.*%5C.spec%24+%5C%3Fwithout_=regexp=yes=0=repo

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/316#issuecomment-1901260310
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: add way to set macro for --nocheck in rpmbuild (#316)

2024-01-19 Thread Tomasz Kłoczko
> ```spec
> # Add handle --{with|without} check
> %__spec_check_pre \
> %{!?with_check:echo "%%check disabled."; exit 0} \
> %{___build_pre}
> ```

Actually this is not all. It needs to be added default value of the 
%with_check. So wole solution has two additional lines.
```spec
# Add handle --{with|without} check
%with_check   1
%__spec_check_pre \
%{!?with_check:echo "%%check disabled."; exit 0} \
%{___build_pre}
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/316#issuecomment-1900926087
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: add way to set macro for --nocheck in rpmbuild (#316)

2024-01-19 Thread Tomasz Kłoczko
> we can use : rpmbuild --without check

This can be added very easy by place in global macros single line modification
```spec
# Add handle --{with|without} check
%__spec_check_pre \
%{!?with_check:echo "%%check disabled."; exit 0} \
%{___build_pre}
```
Than you can place in spec file:
```spec
%bcond_with   check
```
to disable %check.
I'm using that hack +3 years.

Do you want this as PR? 樂 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/316#issuecomment-1900766922
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 build directory auto path to setup step (PR #2859)

2024-01-19 Thread Matteo Croce
@teknoraver commented on this pull request.



> @@ -17,6 +17,7 @@ target_link_libraries(rpmlua PRIVATE LUA::LUA)
 target_link_libraries(rpmbuild PRIVATE librpmbuild)
 target_link_libraries(rpmspec PRIVATE librpmbuild)
 target_link_libraries(rpmdeps PRIVATE librpmbuild)
+target_link_libraries(rpmuncompress PRIVATE archive)

With `LIBARCHIVE` I get:
```
[ 77%] Linking C executable rpmuncompress
/usr/bin/ld: cannot find -lLIBARCHIVE: No such file or directory
collect2: error: ld returned 1 exit status
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2859#discussion_r1459257480
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] Make user/group lookup caching thread-safe (PR #2843)

2024-01-19 Thread ニール・ゴンパ
@Conan-Kudo approved this pull request.

Modulo note as @dmnks stated, it looks good to me.



-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2843#pullrequestreview-1833116074
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 build directory auto path to setup step (PR #2859)

2024-01-19 Thread Matteo Croce
@teknoraver pushed 1 commit.

270555dfa40b2f4f4ecdb002275d6e956832041f  add build directory auto path to 
%autosetup

-- 
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2859/files/aed6cd0f9a69813c9b6f7937110eb4597620c91c..270555dfa40b2f4f4ecdb002275d6e956832041f
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] Update format documentation in the manual (PR #2835)

2024-01-19 Thread Panu Matilainen
The more I looked at this and the existing docs, the more clear it became that 
the stuff needs more than a touch-up job to be credible.

I ended up rewriting much of bit of it, updating and preserving the v3 docs too 
for historians and the like: #2861. That was quite the pile to chew out in a 
day, so there will be gaps and mistakes and all but I think it's now a more 
solid place to build on now.

After that churn, this PR wont be anywhere near applicable, but. There's good 
stuff in this PR and I initially tried to pull as much content from this PR as 
possible but got nowhere with that approach, because the initial state is what 
it is. I'll go through this once more once the dust settles to double-check 
what additions I missed and apply manually.

Thanks for the patch and initiative to get this updated! Getting v4 documented 
was one of my goals for last year and this PR was apparently the necessary kick 
to get started :smile: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2835#issuecomment-1900542163
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] Updated v3 and v4 package + header format documentation (PR #2861)

2024-01-19 Thread Panu Matilainen

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

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

-- Commit Summary --

  * Use markdown formatting features for package format, fix links
  * Split the lead and header structure to their own documents
  * Fix some inaccuracies in the format doc
  * Split the format document to v3 and v4 versions, cover v4 basics
  * Refine the header structure documentation a bit
  * First attempt at technical documentation for header regions

-- File Changes --

D docs/manual/format.md (266)
A docs/manual/format_header.md (203)
A docs/manual/format_lead.md (72)
A docs/manual/format_v3.md (72)
A docs/manual/format_v4.md (134)
D docs/manual/hregions.md (91)
M docs/manual/index.md (4)

-- Patch Links --

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2861
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 build directory auto path to setup step (PR #2859)

2024-01-19 Thread Matteo Croce
@teknoraver commented on this pull request.



> @@ -509,6 +509,9 @@ can just create the directory. It accepts a number of 
> options:
 -n DIR  set the name of build directory (default is `%{name}-%{version}`)
 -T  skip the default unpacking of the first source (used with
 `-a` or `-b`)
+-p  ensures that the sources will be in the default build directory,

It isn't yet. By now it's only used in `%setup`, but we can add it in 
`%autosetup` too and pass it along the chain.
-C is fine for me, it reminds the `tar -C` command which is used in 
rpmuncompress

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2859#discussion_r1459082653
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 build directory auto path to setup step (PR #2859)

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



> @@ -17,6 +17,7 @@ target_link_libraries(rpmlua PRIVATE LUA::LUA)
 target_link_libraries(rpmbuild PRIVATE librpmbuild)
 target_link_libraries(rpmspec PRIVATE librpmbuild)
 target_link_libraries(rpmdeps PRIVATE librpmbuild)
+target_link_libraries(rpmuncompress PRIVATE archive)

Is this the name of the dependency? It looks like it's `LIBARCHIVE` instead of 
`archive`.

> @@ -509,6 +509,9 @@ can just create the directory. It accepts a number of 
> options:
 -n DIR  set the name of build directory (default is `%{name}-%{version}`)
 -T  skip the default unpacking of the first source (used with
 `-a` or `-b`)
+-p  ensures that the sources will be in the default build directory,

How would this be exposed in `%autosetup`? We can't use `-p` there since that's 
for patchlevel passed to `patch`. Maybe instead use `-C` and describe it as 
`Create the build directory and ensure the archive contents are unpacked there, 
stripping the top level directory in the archive if it exists`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2859#pullrequestreview-1832404055
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] Unify regular and file trigger documentation (Issue #2860)

2024-01-19 Thread Michal Domonkos
These two features (regular triggers and file triggers) have, or [will 
have](https://github.com/rpm-software-management/rpm/issues/2755), a lot in 
common, so it makes sense to unify or even join those two documentation pages 
into one, or at least use the same structure so that it's easy to see the 
similarities.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2860
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 build directory auto path to setup step (PR #2859)

2024-01-19 Thread Matteo Croce
Implement RFE #2664

Add a `-p` flag to %setup which ensures that the sources will be extracted in 
the root of the build directory.
It works by inspecting the archive and stripping the first path entry if the 
archive has a top level directory alone in the root.

The archive inspection and path stripping is implemented in rpmuncompress which 
now has a new `-p` flag:

$ ~/rpm/usr/lib/rpm/rpmuncompress -x -v -p source-1.0.0 
source-singleroot.tar.gz
mkdir source-1.0.0 ;  /usr/bin/gzip -dc  
source-singleroot.tar.gz | /usr/bin/tar -xvvof -  -C 
source-1.0.0 --strip-components=1
-rw-r--r-- root/root32 2024-01-16 19:13 source-xx/file1
-rw-r--r-- root/root 33886 2024-01-16 19:13 source-xx/file2
drwxr-xr-x root/root 0 2024-01-16 19:13 source-xx/dir1/
-r--r--r-- root/root   210 2024-01-16 19:13 source-xx/dir1/file3

$ find source-1.0.0 -ls
92341  0 drwxr-xr-x   1 teknoraver teknoraver   28 Jan 16 19:16 
source-1.0.0
92342  4 -rw-r--r--   1 teknoraver teknoraver   32 Jan 16 19:13 
source-1.0.0/file1
92343 36 -rw-r--r--   1 teknoraver teknoraver33886 Jan 16 19:13 
source-1.0.0/file2
92344  0 drwxr-xr-x   1 teknoraver teknoraver   10 Jan 16 19:13 
source-1.0.0/dir1
92345  4 -r--r--r--   1 teknoraver teknoraver  210 Jan 16 19:13 
source-1.0.0/dir1/file3

$ ~/rpm/usr/lib/rpm/rpmuncompress -x -v -p source-2.0.0 source-noroot.tar.gz
mkdir source-2.0.0 ;  /usr/bin/gzip -dc  
source-noroot.tar.gz | /usr/bin/tar -xvvof -  -C 
source-2.0.0
drwxr-xr-x root/root 0 2024-01-16 19:13 dir1/
-r--r--r-- root/root   210 2024-01-16 19:13 dir1/file3
-rw-r--r-- root/root32 2024-01-16 19:13 file1
-rw-r--r-- root/root 33886 2024-01-16 19:13 file2

$ find source-2.0.0 -ls
92346  0 drwxr-xr-x   1 teknoraver teknoraver   28 Jan 16 19:17 
source-2.0.0
92347  0 drwxr-xr-x   1 teknoraver teknoraver   10 Jan 16 19:13 
source-2.0.0/dir1
92348  4 -r--r--r--   1 teknoraver teknoraver  210 Jan 16 19:13 
source-2.0.0/dir1/file3
92349  4 -rw-r--r--   1 teknoraver teknoraver   32 Jan 16 19:13 
source-2.0.0/file1
92350 36 -rw-r--r--   1 teknoraver teknoraver33886 Jan 16 19:13 
source-2.0.0/file2
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * add build directory auto path to setup step

-- File Changes --

M CMakeLists.txt (5)
M build/parsePrep.c (13)
M docs/manual/spec.md (3)
M tools/CMakeLists.txt (1)
M tools/rpmuncompress.c (75)

-- Patch Links --

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2859
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] RFE: add a cmake target for hands-free docs-server (Issue #2854)

2024-01-19 Thread Panu Matilainen
On a related note, it wouldn't hurt to ship the manual in html format in our 
tarballs. I guess we'd need Mr Jekyll for that too.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2854#issuecomment-1900072519
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] Update Docs for "Users and Groups" in the manual (Issue #2857)

2024-01-19 Thread Panu Matilainen
Well, I always intended systemd-sysusers to be the native and default "backend" 
of this feature because ... it is. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2857#issuecomment-1899950764
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] Make user/group lookup caching thread-safe (PR #2843)

2024-01-19 Thread Panu Matilainen
@pmatilai commented on this pull request.



>  
 return 0;
 }
 
 const char * rpmugUname(uid_t uid)
 {
-static uid_t lastUid = (uid_t) -1;
-static char * lastUname = NULL;
-
-if (uid == (uid_t) -1) {
-   lastUid = (uid_t) -1;

Yup, and as an added bonus it now never contains any invalid uid/gid because 0 
is just root which we handle in the code separately. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2843#discussion_r1458532869
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