|
6 days ago | |
---|---|---|
css | 6 days ago | |
etc/apt | 1 week ago | |
usr | 2 months ago | |
var/lib/dpkg | 2 months ago | |
.gitignore | 1 month ago | |
README.adoc | 1 month ago | |
debtree-query.sh | 1 month ago | |
file-query.sh | 1 month ago | |
package-query.sh | 1 month ago | |
policy-query.sh | 1 month ago | |
update.sh | 1 month ago | |
whatsit.conf | 1 month ago |
This is a CGI application to provide package information using apt.
Currently available at https://pkginfo.devuan.org/cgi-bin/policy-query.xml
The Web interface includes a "search box" for filling in an argument
for an apt-cache policy
run in an apt
runtime context that
includes all current Devuan source points. The result of that run is
presented as given and including links for a package version detail
lookup using apt-cache show
.
The package detail view includes links to perform new pacakge-query
lookups for related (dependent) packages, as well as for manually
downloading the deb
file concerned. There is also a button to
trigger a debtree
run for the (unversioned) package name to get the
resulting diagram presented as an inline svg image.
Note that debtree
is not strong in handling package versions and it
simply shows a graph involving the "latest" of everything rather than
a graph relating to the original (versioned) package view.
Thus, the CGI application runs three command lines:
|
The command outputs are further filtered into bespoke XML 1.0 representations that become the bases for the views that browsers typically render by applying the nominated XSL 3.0 stylesheets.
In other words, a request handling flow is as follows:
The request is first translated into its servicing script by means
of a link from the interface name (e.g., package-query.xml) to the
actual script (e.g., package-query.sh). As per the normal
CGI 1.1 Specification the query
string is given to the script via the environment variable
QUERY_STRING
.
The servicing script runs the actual command with its argument
provided as detail for the q
parameter in the query string, and
decorates the command output to make up an XML object tree that
includes a stylesheet link for the applicable stylesheet (e.g.
css/package-query.xsl
).
The browser upon receiving the XML file discovers the XSL association, and therefore loads and processes the associated XSL stylesheet. This transforms the bespoke XML into an HTML 4.01 document according to the XSL transformation rules. By design, the HTML document is a bare structure of plains element with bespoke identities and class assignments in support of a CSS 2.1 programming for layout particulars and looks.
The browser upon processing the HTML document discovers the CSS associations and therefore loads and processes the associated CSS stylesheets.
Eventually the browser will map the rendered result to the display for the user to view.
The scripts use a local apt
environment which consists of a special
purpose configuration file whatis.conf
that in particular nominates
a RootDir
that is the root directory for the pathnames to other
configuration files and working directories. Especially the
etc/apt/sources.list.d/
directory that contains the lists files of
source points for package collections.
The CGI application includes a background job (./update.sh
) to keep
the local configuration up to date with the source points. This is
simply a regular apt-get update
run in the local apt
environment.
Last updated 2021-01-19 19:05:25 UTC