Skip to content

juanje/debsfromrepos

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DebsFromRepos

Debian packages availables at a spcific repository

<img src=“https://secure.travis-ci.org/juanje/debsfromrepos.png” />

Description

This is a small lib to get the names and descriptions for the availables packages at specific (or group of them) Debian/Ubuntu repository.

The description can be obtained in a specific language.

Installation

(sudo) gem install debsfromrepos

Usage

You have a example of how the library works at the examples/ directory:

examples/repo2json.rb

Basicaly you require the lib

require 'debsfromrepos'

and ask for the right Packages.gz url for a specific Debian/Ubuntu server

server = "http://us.archive.ubuntu.com/ubuntu"
suite = "oneiric"
component = "main"
language = "es"
repository = DebsFromRepos::ListUrl.new(server, suite, component, language)
packages_url = repository.get_packages_url
# => "http://us.archive.ubuntu.com/ubuntu/dists/oneiric/main/binary-i386/Packages.gz"
translations_url = repository.get_translations_url
# => "http://us.archive.ubuntu.com/ubuntu/dists/oneiric/main/i18n/Translation-es.gz"

you also can change the suite or component

repository.component = 'universe'
# => "http://us.archive.ubuntu.com/ubuntu/dists/oneiric/universe/binary-i386/Packages.gz"

or ask for another language

repository.get_translations_url('it')
# => "http://us.archive.ubuntu.com/ubuntu/dists/oneiric/main/i18n/Translation-it.gz"

and then get all the packages’ names and descriptions on that component of that suite of that repository:

pkgs = DebsFromRepos::Packages.new(packages_url, translations_url)
pkgs.packages['zlib1g']
# => "Biblioteca de compresión, ejecutables"

Tests

The features are documented and tested using Cucumber and it can be cheched at the features directory.

To test the features just type:

rake

License and Author

Author

Juanje Ojeda (<jojeda@emergya.com>)

Copyright 2011 Junta de Andalucía

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Get names and descriptions from Debian packages on a remote repository

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%