source: projects/vine-spec-skeleton/tags/release-0.4/lib/VineLinux/VSS/ConfigLoader.pm @ 492

Revision 492, 583 bytes checked in by iwaim, 14 years ago (diff)

vine-spec-skeleton: YAML形式の設定ファイルからパッケージャの情報を追加する機能を実装

Line 
1package VineLinux::VSS::ConfigLoader;
2
3use strict;
4use warnings;
5
6use YAML;
7
8sub new {
9    my $class = shift;
10    bless {}, $class;
11}
12
13sub load {
14    my ($class, $file, $vss) = @_;
15
16    my $config;
17    if ((!ref($file)) || (-e $file && -r $file)) {
18        $config = YAML::LoadFile($file);
19    }
20
21    if ($config->{packager_name}) {
22        $vss->packager_name($config->{packager_name});
23    }
24    if ($config->{packager_fullname}) {
25        $vss->packager_fullname($config->{packager_fullname});
26    }
27    if ($config->{packager_email}) {
28        $vss->packager_email($config->{packager_email});
29    }
30}
31
32
33
341;
Note: See TracBrowser for help on using the repository browser.