A Perl tool for querying distribution repositories

Analysis Machine

Article from Issue 149/2013
Author(s):

A Perl script calls various plugins that sniff around on FTP and HTTP servers run by the major Linux distributions to discover when Fedora, Debian, and other distros update their packages.

The software in this Perl column is, to some extent, commissioned work: The editors of the German edition, Linux-Magazin, needed a tool that would crawl the update servers of major Linux distributions to find release dates for a cover story. Because Perl has a reputation of being good at complex queries and string manipulation, this article is totally devoted to a tool that supports that topic. The objective was a script that accepts a query passed in at the command line, searches different targets, filters out matching package names, collects the dates, and finally outputs a table with the results.

The difficulty is that Linux distributions offer their release information in different formats. For example, packages for Ubuntu and Debian reside on an FTP server – not all in one directory, but split up into subdirectories whose names consist of the first letter of the package name (Figure 1).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Perl: Log Chat Sessions

    The IRC (Internet Relay Chat) protocol lets you program bots as automatic helpers. In this month's column, we let a bot log a session and store the results in a database.

  • Perl: Elasticsearch

    The Elasticsearch full-text search engine quickly finds expressions even in huge text collections. With a few tricks, you can even locate photos that have been shot in the vicinity of a reference image.

  • Nagios Workshop

    Nagios monitors your network and provides early warning for problems with hosts and services.

  • Etch: Security Update No.7

    Corrections and security updates for the current stable Debian have been released.

  • Gimp Scripting

    Many users turn to GIMP for pictures in the window, but some may not realize GIMP also has scripting capabilities that allow you to automate recurring tasks. The Python scripting language is a useful alternative to the GIMP’s integrated Lisp dialect.

comments powered by Disqus