On 6/9/22 18:16, Ben Koenig wrote:
Hi all,

I have a really random question/rant about package metadata across
different distros. Quick backstory.. For reasons best explained by
https://xkcd.com/2610/, I'm writing a series of scripts that ingest
package data into a set of SQL tables in mariadb. Part of this
involves defining a string for the "package name" and defining a
maximum length for the string - which is where things go horribly
wrong.

After some fiddling with packages in my distro I settled on a
character length of 50 for the package name. This was reasonable
until I started working on Fedora's data and found a package that
would give RMS a heart attack. Behold:

Package name:
compat-golang-github-akihirosuda-containerd-fuse-overlayfs-devel

As found in the repo data for FC36. This is probably the most
meaningless arrangement of 64 alphanumeric characters I have ever
seen, but my focus of the moment is assigning it a number so I can do
math on it. The obvious solution is to raise the character limit for
the SQL field to accomodate at least 65 characters, but that raises
the following question:

How high should I set the limit? Is there any reason to believe that
a package name would exceed, e.g. 100 characters?

I may up it to 100/150 but if anyone is aware of a package name for
any linux distro that exceeds 100 characters that would be helpful to
know. I only use a few different distros myself and wasn't expecting
to hit this issue. -Ben

This ended up being far uglier than expected.  Here's my result for
CentOS 7.9.

$ yum --color never list all 2>/dev/null | cut -d ' ' -f 1 | sed -e 
'0,/Installed/d' -e 's/\.x86_64.*//g' -e 's/\.i686.*//g' -e 's/\.noarch.*//g' | wc 
-L
63

The package with a name length of 63 is:
rh-java-common-apache-commons-collections-testframework-javadoc

I haven't used dnf yet, but perhaps the above yum command is an example
of why yum has been replaced by dnf.


galen
--
Galen Seitz
[email protected]

Reply via email to