Module: RPM

Defined in:
lib/rpm.rb,
ext/rpm/rpm.c,
lib/rpm/version.rb

Defined Under Namespace

Classes: CallbackData, Changelog, Conflict, DB, Dependency, File, Icon, MatchIterator, Obsolete, Package, Patch, Problem, Provide, Require, Source, Spec, Transaction, Version

Constant Summary

PROB_FILER_FORCE =
INT2NUM(RPMPROB_FILTER_REPLACEPKG
| RPMPROB_FILTER_REPLACENEWFILES
| RPMPROB_FILTER_REPLACEOLDFILES)
PROB_FILER_REPLACEFILES =
INT2NUM(RPMPROB_FILTER_REPLACENEWFILES
| RPMPROB_FILTER_REPLACEOLDFILES)
PROB_FILER_IGNORESIZE =
INT2NUM(RPMPROB_FILTER_DISKSPACE
| RPMPROB_FILTER_DISKNODES)
BUILD__UNTIL_PREP =
INT2NUM(RPMBUILD_PREP)
BUILD__UNTIL_BUILD =
INT2NUM(RPMBUILD_PREP
| RPMBUILD_BUILD)
BUILD__UNTIL_INSTALL =
INT2NUM(RPMBUILD_PREP
| RPMBUILD_BUILD
| RPMBUILD_INSTALL)
BUILD__BINARY_PACKAGE =
INT2NUM(RPMBUILD_PREP
| RPMBUILD_BUILD
| RPMBUILD_INSTALL
| RPMBUILD_PACKAGEBINARY
| RPMBUILD_CLEAN)
BUILD__SOURCE_PACKAGE =
INT2NUM(RPMBUILD_PREP
| RPMBUILD_BUILD
| RPMBUILD_INSTALL
| RPMBUILD_PACKAGESOURCE
| RPMBUILD_CLEAN)
BUILD__ALL_PACKAGE =
INT2NUM(RPMBUILD_PREP
| RPMBUILD_BUILD
| RPMBUILD_INSTALL
| RPMBUILD_PACKAGEBINARY
| RPMBUILD_PACKAGESOURCE
| RPMBUILD_CLEAN)
BUILD__CHECK_FILELIST =
INT2NUM(RPMBUILD_PREP
| RPMBUILD_BUILD
| RPMBUILD_INSTALL
| RPMBUILD_FILECHECK)
PKG_NAME =
'ruby-rpm'
VERSION =
'1.3.1'

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (String) []



# File 'ext/rpm/rpm.c'

static VALUE
m_aref(VALUE m, VALUE name)
{
char  buf[BUFSIZ];
char* tmp;
VALUE val;

if (TYPE(name) != T_STRING) {
    rb_raise(rb_eTypeError, "illegal argument type");
}

+ (Object) []=

Setup a macro



# File 'ext/rpm/rpm.c'

static VALUE
m_aset(VALUE m, VALUE name, VALUE val)
{
if (TYPE(name) != T_STRING
    || (val != Qnil && TYPE(val) != T_STRING)) {
    rb_raise(rb_eTypeError, "illegal argument type(s)");
}

+ (Object) expand

+ (Object) init_macros

+ (Object) readrc

Read configuration files



# File 'ext/rpm/rpm.c'

static VALUE
m_readrc(int argc, VALUE* argv, VALUE m)
{
register int i;
char buf[BUFSIZ];

if (argc == 0) {
    rb_raise(rb_eArgError, "too few argument(>= 1)");
}

+ (Number) verbosity



# File 'ext/rpm/rpm.c'

static VALUE
m_get_verbosity(VALUE m)
{
    return INT2NUM(rpm_verbosity);
}

+ (Object) verbosity=

Sets the verbosity level



# File 'ext/rpm/rpm.c'

static VALUE
m_set_verbosity(VALUE m, VALUE verbosity)
{
int v = NUM2INT(rb_Integer(verbosity));
switch (v) {
case RPMLOG_EMERG: case RPMLOG_ALERT:
case RPMLOG_CRIT: case RPMLOG_ERR:
case RPMLOG_WARNING: case RPMLOG_NOTICE:
case RPMLOG_INFO: case RPMLOG_DEBUG:
    break;

default:
    rb_raise(rb_eArgError, "invalid verbosity");
}

Instance Method Details

- (Object) vercmp(ver1, ver2)



36
37
38
39
40
41
# File 'lib/rpm.rb', line 36

def vercmp(ver1, ver2)
  unless String === ver1 and String === ver2 then
    raise TypeError, 'illegal argument type'
  end
  RPM::Version.new(ver1) <=> RPM::Version.new(ver2)
end