SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
perl-JSON-XS is what Cpanel::JSON::XS was forked from, the one you installed is a different one, the original version, so it's not the wrong one per se, just a different one.
You can always just use cpan to install it, that's easy, but if it's not in slackbuilds, it would be nice to provide it for slackware users anyway since it's the recommended version from what I gather.
In 2.9.00-0435-p I added the relatively crude and basic
Code:
XML::Dumper
because it was as easy to implement quickly as the json one, but it's output is far inferior unfortunately, but it is xml, and it does work, and it was easy, so I'll leave a nicer xml output for later days.
I'd hoped these would be easy using modules. pinxi currently does not offer slackpkg --recommends package install names, mainly because I don't have them, and inxi's version of this wasn't flexible enough to readily add different package managers.
If you scroll down the file to: sub item_data { then down to the program/modules sections, you can see where the slackpkg names would go, and I'd just use the same ID method that -repos uses to determine it's slackpkg. Slackware has always held a special spot in the gnu/linux world due to its commitment to clean uncluttered Linux as far as I'm concerned, even though I don't use it personally, I admire it.
By the way, pinxi supports FreeBSDs as well, though it's not feature complete, sometimes because the data just isn't there, sometimes because I haven't had time to do it. With pinxi extending bsd support has been much easier, so I have added more features already.
pinxi currently does not offer slackpkg --recommends package install names, mainly because I don't have them
Neither does slackpkg...
Cool tool though, I remember inxi fondly from using Debian.
Quote:
Slackware has always held a special spot in the gnu/linux world due to its commitment to clean uncluttered Linux as far as I'm concerned, even though I don't use it personally, I admire it.
That's how to win friends and influence people right there :-)
perl-JSON-XS is what Cpanel::JSON::XS was forked from, the one you installed is a different one, the original version, so it's not the wrong one per se, just a different one.
I'd probably recommend looking into the Mojo toolkit also for a few reasons:
zakame, I'll take a look at those mojo ones. I was following perl maven's advice on the json one, but I'm not wedded to it. The xml::dump one was just the first xml generator I found that was easy to implement, but I don't like it's output that much.
rokytnji, that Other value is hard to know what to do with, it seems like it's either a gpu sensor that has not been labelled, or another cpu sensor. That temp is too high for a mobo sensor I believe, so it's not mobo. The SODIMM was supposed to be added, I'll check why it's not.
zakame, my initial look into the mojo toolkit appears negative, for example, I don't see an apt package for just Mojo::JSON module, only the full collection of mojo tools, which is serious overkill to get a single module installed. Both of the modules I picked do not I believe require further modules, but I'll confirm that. One of the core requirements I have for inxi/pinxi is to keep recommends and dependencies to an absolute barebones minimum.
I'll test on a few systems with barebones Perl installations, to see what either the Cpanel::JSON::XS or the XML::Dumper modules pull in, but to me, it looks like both are very lightweight and single modules without further dependencies. That would be a requirement for any suggested replacement as well, needless to say.
Looking for example at the Debian package, there are no further dependencies for the Cpanel::JSON::XS module, in fact, the only reason it has the Cpanel prefix is because it's sponsored by cpanel.
It's worth reading that a bit, to get a sense of what that module actually is. I also tend to somewhat respect Perl Maven's views, since I've used his online stuff a lot, and Cpanel::JSON::XS was the one he picked to demonstrate json encoding from all the ones he listed (and given it was basically perfect out of the box, that is, the ever so rare condition of "it just worked", would make a replacement have to be demonstrated as radically better in some way in order to justify spending dev time on it).
So tentatively, and because I'm really trying to get this stuff finished up (I have real work waiting on this process), I think I'll only change things at this point if there is a real need to do so, and if the solution can be verified to be better in a significant way. To me, pulling in an entire toolkit to get two modules would not qualify for that requirement I believe. Since most users will be installing modules from their package manager, the modules should be totally standalone.
I may however extend slightly the support, in the interest of very old systems that may not have access to Cpanel::JSON::XS, and make an optional test for just plain JSON::XS, which I believe will work in a similar way. I'll test that maybe today. I don't know the release dates of these modules initially.
However, with that said, I don't like the output of XML::Dumper, and welcome simple light solutions that might produce better output, as good as the essentially flawless json version. But that may require looping and actual processing of the data, which I don't want to do unless a real demonstrated interest in xml export exists.
I'm working on some other bugs right now, but 0435 will have support for using either JSON::XS or Cpanel::JSON::XS. This should cover most users in most situations, and also allow for very old systems like servers etc to still be able to use the json export function. I've updated --recommends to indicate this option.
Another core requirement for pinxi was that it work on stuff running Perl 5.08 or newer, ie, very old servers or vms that are still running, but which of course cannot upgrade their packages anymore. But could, for example, install something from CPAN directly, for example.
Keep in mind that Slackware 14.2 runs perl 5.22.2 and (as of today) Slackware-current has Perl 5.26.1. A stock Slackware installation of any sort does not ship with any JSON perl modules. That leaves us Slackware users with the following from SlackBuilds.org: slackbuilds.org search=perl-JSON&sv=14.2. Both look reasonably up to date.
One of the, if not THE core requirement when I selected the language that inxi would be rewritten in was that the language be what I consider 'adult', that is, not breaking their language features all the time. I've been immensely pleased testing pinxi on ancient systems, it works, all I had to do was not use a few new language features. I have to really give Perl 5.x devs credit, they know how to keep a language reliable and stable. So I develop it on 5.026, and have tested it all along on 5.008, 5.010, 5.012, and whatever variants are on some servers I use for testing. Also on old vm installs. Perl really shines, and has far exceeded my expectations for not breaking their language over time. As long as I am aware of which language features were introduced after 5.008, and avoid them, which has not been hard to do at all, there's been no issues at all. I've documented all these things on the pinxi github inxi-perl branch by the way, and those docs will be moved to master once pinxi moves to inxi.
Note that I just added in JSON::XS as a fallback option, since it's easy to implement too, it's the same syntax exactly. perl-JSON-XS is as you note packaged, so there's no issue, pinxi will test for CPAN::JSON::XS first, then JSON::XS, but it might be worth thinking about packaging the cpanel variant, the reason it was forked was that the maintainers of JSON::XS were not responding to issue reports, and they had some real bugs. As a maintainer / developer myself, I know exactly what that means when it comes to the long term utility of a project. In fact, inxi itself was forked in the very beginning due to the refusal of the previous program's maintainers to accept a trivial patch. So I know exactly what it means when programmers start ignoring issue reports...
However, I don't believe these issues would impact simple stuff like pinxi export to json.
I'll probably add in slackware package names to the built in --recommends tool if I have time to do it, though it would be nice if someone else could provide the package names for slackbuilds so I don't have to look them all up.
I'll probably add in slackware package names to the built in --recommends tool if I have time to do it, though it would be nice if someone else could provide the package names for slackbuilds so I don't have to look them all up.
The dependencies for perl-JSON-XS according to SlackBuilds.org are (must be installed starting with #1 and ending with #4:
Oh, I'm not spending time on per distro bugs in packages, all pinxi/inxi does is show recommended package names for a long set of packages, which can be seen if you run --recommends. The only thing requird to add a new package manager to that list is a list of package names, which I fill out currently for apt, rpm, and pacman, by googling the application name plus the package manager name, not particularly scientific, just mundane rote stuff. It's not very interesting to do it, but I wouldn't mind adding some more package managers to the supported ones pinxi already has, since that's now easy to do in perl pinxi. not a big deal, doesn't help me personally, but can help users of the various package managers, and maintainers, so they can quickly look over the recommends to see what's needed.
When you run --recommends in slackware, you won't see missing package names listed because there's no support internally for slackpkg in recommends section, if you run that in say, arch, debian, ubuntu, or fedora, you will see those install names listed. Inxi would just spit them all out no matter what, it wasn't very 'smart' about that.
zakame, my initial look into the mojo toolkit appears negative, for example, I don't see an apt package for just Mojo::JSON module, only the full collection of mojo tools, which is serious overkill to get a single module installed. Both of the modules I picked do not I believe require further modules, but I'll confirm that. One of the core requirements I have for inxi/pinxi is to keep recommends and dependencies to an absolute barebones minimum.
I'll test on a few systems with barebones Perl installations, to see what either the Cpanel::JSON::XS or the XML::Dumper modules pull in, but to me, it looks like both are very lightweight and single modules without further dependencies. That would be a requirement for any suggested replacement as well, needless to say.
Yeah, Mojo is usually packaged as an all-in-one toolkit for most distros; whether that is overkill seems a matter of taste to me.
You could also look into Tiny modules like JSON::Tiny as well (that one cribs from Mojo::JSON, and probably even smaller enough that you can just inline or adapt the parts you use from it to pinxi too, since it is just pure perl, compared to XS solutions requiring a compiler,) and XML::Tiny (also small enough to be inlined.)
I'll take a look at both of those, thanks. Basically the output has to be perfect as it is with the json::xs stuff for a change to happen. the xml::tiny is more likely because I don't like XML::Dumper output. Mojo would be out of the question since the point is to avoid such large dependencies, that's why pinxi was written to work with only core modules for example, except for extra features like json export that very few users would use, and those who do, can easily install the module and go on their way.
I'll take a look at the source of those too, it would be nice to get rid of dependencies, but only if they are really reliable, since it's likely json output would be used by other software, so reliability and robustness would be more important than size etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.