Name: rpmout
Owner: Biological Informatics CoE @ Agriculture and Agri-Food Canada
Owner: Biological Informatics CoE @ Agriculture and Agri-Food Canada
Description: List RPMs on a system & generate JSON, HTML, LaTeX, and CSV
Created: 2013-04-23 11:43:14.0
Updated: 2016-03-09 14:25:03.0
Pushed: 2016-05-02 21:16:37.0
Size: 10528
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
rpmout is a utility for extracting RPM packages and (optionally) R packages that are installed on a Linux system. It is written in Go.
It extracts the RPM tag info (using the rpm command) and optionally, R packages, and produces simple text output (default), JSON, LaTeX and at Exhibit HTML page with associated JSON file.o It can be restricted to the RPMS that are implicated in a particular set of directories.
The LaTeX version creates three indexes of packages:
The LaTeX version creates table of counts by license, useful for auditing purposes.
My use is to produce a list of bioinformatics applications installed as RPMS on a Rocks cluster http://en.wikipedia.org/wiki/Rocks_Cluster_Distribution
For example: users want to know what is installed in the bioinformatics install dir /opt/bioinformatics, and 'rpmout' generates (by default) an HTML fragment made up of a list of rpms and their useful attributes.
This fragment is meant to be embedded into a static HTML page that wraps it with the appropriate local style, titles it, etc.
Usage of ./rpmout:
./rpmout <args> <rootDir0>...<rootDirN>
default <rootDir>: /
:
=false: Find R packages
eader="Installed Software": gggg
="rpmoutOut": Base path and name for output file(s); only used by outputFormat=exhibit; all other outputs are to stdout
utputFormat="txt": Values: json|txt|latex|exhibit
ple: ./rpmout -outputFormat=json /opt /usr/local
that the 'rpm' program (http://www.rpm.org/max-rpm/rpm.8.html) needs to be in your path
Exhibit offers a faceted interface to information. In this case, the RPM packages, and optionally, R packages, can be displayed. The facets offered are:
Exhibit also allows for the full-text filter search of the fields in the JSON, and grouping of results by various fields.
Here is an example screenshot of the Exhibit output.
Here is a live example.
It's difficult to manipulate the output in JSON, HTML, and PDF formats. You can convert the JSON output to a CSV file using the provided python script: json2csv.py .
ple: Generate the list of RPMs in JSON and convert it to a CSV file
./rpmout outputFormat=json /opt > rpms.json
python json2csv.py -i rpms.json -o rpms.csv
To generate a PDF from the LaTeX output: Right now, for the LaTeX file produced by rpmout, rpmoutlatex2pdf.sh, and rpmout.R all need to be in the same directory (to be fixed):
# generate LaTeX for all RPMs and all R packages system:
$ ./rpmout -R -outputFormat=latex > sample.tex
# generate PDF (takes a minute or so...)
$ ./rpmoutlatex2pdf.sh sample.tex
# display PDF file
$ acroread all.pdf
rpmoutlatex2pdf.sh
needs a reasonable modern instance of 'tex/LaTeX' installedNB: The splitindex's splitnindex.pl
needs to be in the PATH
.
rpmout is a 64bit compiled on Fedora 18 binary, go version go1.3 linux/amd64
sample.tex.gz is an example, from running 'rpmout -R -outputFormat=latex /' on my Fedora 18 laptop. As it is looking for all rpms, it is a big document. The PDF is sample.pdf.gz, has 545 pages and is ~1.8MB
The original single threaded Ruby version I prototyped takes about 4 1/2 minutes to run. This naively written Go implementation takes <22 seconds to do the same thing.
The reason for creating rpmout
is to generate a list of packages for the Rocks cluster I manage at Agriculture and Agri-Food Canada.
Exhibit
title should be settable; right now is fixed at Installed Software
Output file names for Exhibit output should be settable; right now: rpmout.html and allSoftware.js
Source for Exhibit library should be settable; right now: “http://trunk.simile-widgets.org/exhibit/api/exhibit-api.js”
Should be able to set order of facets (right now Type, Group, License?
Move to Go package html/template, and allow the user to supply an arbitrary template for HTML output
testing
more idiomatic Go
user selection of rpm tags, beyond the defaults?
list dependencies?
list provides?
show location of any executables?
show location of any libraries?
rpmout is a utility for extracting RPM packages and (optionally) R packages that are installed on a Linux system. It is written in Go.
It extracts the RPM tag info (using the rpm command) and optionally, R packages, and produces simple text output (default), JSON, LaTeX and at Exhibit HTML page with associated JSON file.o It can be restricted to the RPMS that are implicated in a particular set of directories.
The LaTeX version creates three indexes of packages:
The LaTeX version creates table of counts by license, useful for auditing purposes.
My use is to produce a list of bioinformatics applications installed as RPMS on a Rocks cluster http://en.wikipedia.org/wiki/Rocks_Cluster_Distribution
For example: users want to know what is installed in the bioinformatics install dir /opt/bioinformatics, and 'rpmout' generates (by default) an HTML fragment made up of a list of rpms and their useful attributes.
This fragment is meant to be embedded into a static HTML page that wraps it with the appropriate local style, titles it, etc.
Usage of ./rpmout:
./rpmout <args> <rootDir0>...<rootDirN>
default <rootDir>: /
:
=false: Find R packages
eader="Installed Software": gggg
="rpmoutOut": Base path and name for output file(s); only used by outputFormat=exhibit; all other outputs are to stdout
utputFormat="txt": Values: json|txt|latex|exhibit
ple: ./rpmout -outputFormat=json /opt /usr/local
that the 'rpm' program (http://www.rpm.org/max-rpm/rpm.8.html) needs to be in your path
Exhibit offers a faceted interface to information. In this case, the RPM packages, and optionally, R packages, can be displayed. The facets offered are:
Exhibit also allows for the full-text filter search of the fields in the JSON, and grouping of results by various fields.
Here is an example screenshot of the Exhibit output.
Here is a live example.
It's difficult to manipulate the output in JSON, HTML, and PDF formats. You can convert the JSON output to a CSV file using the provided python script: json2csv.py .
ple: Generate the list of RPMs in JSON and convert it to a CSV file
./rpmout outputFormat=json /opt > rpms.json
python json2csv.py -i rpms.json -o rpms.csv
To generate a PDF from the LaTeX output: Right now, for the LaTeX file produced by rpmout, rpmoutlatex2pdf.sh, and rpmout.R all need to be in the same directory (to be fixed):
# generate LaTeX for all RPMs and all R packages system:
$ ./rpmout -R -outputFormat=latex > sample.tex
# generate PDF (takes a minute or so...)
$ ./rpmoutlatex2pdf.sh sample.tex
# display PDF file
$ acroread all.pdf
rpmoutlatex2pdf.sh
needs a reasonable modern instance of 'tex/LaTeX' installedNB: The splitindex's splitnindex.pl
needs to be in the PATH
.
rpmout is a 64bit compiled on Fedora 18 binary, go version go1.3 linux/amd64
sample.tex.gz is an example, from running 'rpmout -R -outputFormat=latex /' on my Fedora 18 laptop. As it is looking for all rpms, it is a big document. The PDF is sample.pdf.gz, has 545 pages and is ~1.8MB
The original single threaded Ruby version I prototyped takes about 4 1/2 minutes to run. This naively written Go implementation takes <22 seconds to do the same thing.
The reason for creating rpmout
is to generate a list of packages for the Rocks cluster I manage at Agriculture and Agri-Food Canada.
Exhibit
title should be settable; right now is fixed at Installed Software
Output file names for Exhibit output should be settable; right now: rpmout.html and allSoftware.js
Source for Exhibit library should be settable; right now: “http://trunk.simile-widgets.org/exhibit/api/exhibit-api.js”
Should be able to set order of facets (right now Type, Group, License?
Move to Go package html/template, and allow the user to supply an arbitrary template for HTML output
testing
more idiomatic Go
user selection of rpm tags, beyond the defaults?
list dependencies?
list provides?
show location of any executables?
show location of any libraries?