rpm
5.4.10
|
Ruby bindings for spec file access. More...
#include "system.h"
#include "rpm-rb.h"
#include "spec-rb.h"
#include "rpmmc-rb.h"
#include "package-rb.h"
#include <stdio.h>
#include <rpmtag.h>
#include <rpmtypes.h>
#include <rpmio.h>
#include <rpmbuild.h>
#include <rpmspec.h>
#include <rpmmacro.h>
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE |
#define | _RPMTS_INTERNAL |
#define | _RPMFI_INTERNAL |
Functions | |
static void | _spec_free (Spec spec) |
C destructor for the Spec class. More... | |
static Spec | _spec_get_spec (VALUE self) |
Returns the wrapped Spec structure. More... | |
static rpmts | _spec_get_ts (VALUE self) |
Returns the hiddenly associated transaction set. More... | |
static VALUE | _spec_get_sources (VALUE self, int flags) |
A helper routine that returns a Ruby array containing all sources that match a specific set of OR'ed flags. More... | |
static VALUE | spec_get_sources (VALUE self) |
Returns an array of all sources defined in the spec file. More... | |
static VALUE | spec_get_patches (VALUE self) |
Returns an array of all patches defined in the spec file. More... | |
static VALUE | spec_get_packages (VALUE self) |
Returns all packages associated with the spec file. More... | |
static VALUE | spec_get_macros (VALUE self) |
Returns the macro context of the spec file. More... | |
static VALUE | spec_build (VALUE argc, VALUE *argv, VALUE self) |
Builds a part of the spec file. More... | |
VALUE | spec_wrap (Spec spec) |
Wraps an already existing Spec_s structure in a Ruby class. More... | |
void | Init_spec (void) |
Initializes the Ruby class. More... | |
Variables | |
VALUE | specClass |
The Ruby class representation of the Spec_s structure and methods. More... | |
Ruby bindings for spec file access.
Definition in file spec-rb.c.
|
static |
C destructor for the Spec class.
Definition at line 38 of file spec-rb.c.
References freeSpec().
Referenced by spec_wrap().
|
static |
A helper routine that returns a Ruby array containing all sources that match a specific set of OR'ed flags.
Definition at line 73 of file spec-rb.c.
References _spec_get_spec(), Source::flags, Source::fullSource, Source::next, and Spec_s::sources.
Referenced by spec_get_patches(), and spec_get_sources().
|
static |
Returns the wrapped Spec structure.
Definition at line 48 of file spec-rb.c.
Referenced by _spec_get_sources(), spec_build(), spec_get_macros(), and spec_get_packages().
|
static |
Returns the hiddenly associated transaction set.
Definition at line 60 of file spec-rb.c.
Referenced by spec_build().
void Init_spec | ( | void | ) |
Initializes the Ruby class.
Definition at line 217 of file spec-rb.c.
References rpmModule, spec_build(), spec_get_macros(), spec_get_packages(), spec_get_patches(), spec_get_sources(), and specClass.
Referenced by Init_rpm().
|
static |
Builds a part of the spec file.
This method will call buildSpec() to build parts of the spec file. Its mode of operation is determined by the constants in rpmBuildFlags_e, which are mapped in the RPM Ruby module. Will throw an exception if the build fails.
call-seq: RPM::Spec::build(flags, test = false) -> RPM::Spec
flags | A combination of flags that control the build. |
test | If set to true, the scriptlets won't actually be run. |
Definition at line 176 of file spec-rb.c.
References _spec_get_spec(), _spec_get_ts(), buildSpec(), and rpm_rb_raise().
Referenced by Init_spec().
|
static |
Returns the macro context of the spec file.
call-seq: RPM::Spec::macros -> RPM::Mc
Definition at line 153 of file spec-rb.c.
References _spec_get_spec(), Spec_s::macros, and rpmmc_wrap().
Referenced by Init_spec().
|
static |
Returns all packages associated with the spec file.
This returns all packages that are the result of the spec file would it be built. It serves as a factory method creating RPM::Package classes.
call-seq: RPM::Spec::packages -> Array
Definition at line 131 of file spec-rb.c.
References _spec_get_spec(), Package_s::next, packageClass, and Spec_s::packages.
Referenced by Init_spec().
|
static |
Returns an array of all patches defined in the spec file.
call-seq: RPM::Spec::patches -> Array
Definition at line 112 of file spec-rb.c.
References _spec_get_sources(), and RPMFILE_PATCH.
Referenced by Init_spec().
|
static |
Returns an array of all sources defined in the spec file.
call-seq: RPM::Spec::sources -> Array
Definition at line 97 of file spec-rb.c.
References _spec_get_sources(), and RPMFILE_SOURCE.
Referenced by Init_spec().
VALUE spec_wrap | ( | Spec | spec | ) |
Wraps an already existing Spec_s structure in a Ruby class.
Definition at line 210 of file spec-rb.c.
References _spec_free(), and specClass.
Referenced by rpmts_parse_spec().
VALUE specClass |
The Ruby class representation of the Spec_s structure and methods.
This is the RPM::Spec class. It is generated from an existing transaction set via RPM::Ts::parse_spec. Instances of RPM::Spec provide access to information about the spec file itself (such as a list of sources and patches, or access to the macro context associated with the spec file), and also allow building the spec file.
Raise exceptions on build failures.
Definition at line 31 of file spec-rb.c.
Referenced by Init_spec(), and spec_wrap().