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.

  • Perl: Zeitgeist

    Many Ubuntu users are blissfully unaware that the Zeitgeist daemon is shoulder surfing them and logging their desktop actions. Several Perl scripts can help sanitize the sniffer report and reveal interesting facts about a user's habits.

  • Perl: Tracking Online Orders

    A distributed database based on the distributed Git version control system relies on a Perl script to help users track Internet orders. When the goods arrive, purchasers update their stock counts, wherever they may be at the time.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News