- Timestamp:
- Jun 23, 2010, 4:26:59 PM (14 years ago)
- Location:
- devel/mr
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/mr/Makefile.PL
r2650 r2659 9 9 VERSION => 'PBVER', 10 10 INST_SCRIPT => 'blib/bin', 11 INSTALLDIRS => ' perl',11 INSTALLDIRS => 'vendor', 12 12 PREREQ_PM => { 13 13 #HTTP::Headers => 1.59, … … 61 61 $target = "/usr/local"; 62 62 if (not defined $confdir) { 63 $confdir = "/usr/local/etc"; 63 $confdir = "$target/etc"; 64 } 65 if (not defined $cachedir) { 66 $cachedir = "$target/var/cache"; 64 67 } 65 68 } else { 66 $sharedir = $sharedir || "$target/share";67 $mandir = $mandir || "$sharedir/man";68 69 $cachedir = $cachedir || "$target/var/cache"; 69 70 if (not defined $confdir) { 70 71 die "CONFDIR should be defined if PREFIX is defined"; 71 72 } 73 if (not defined $cachedir) { 74 die "CACHEDIR should be defined if PREFIX is defined"; 75 } 72 76 } 77 $sharedir = $sharedir || "$target/share"; 78 $mandir = $mandir || "$sharedir/man"; 73 79 74 80 my $conff = "etc/PBPROJ.conf"; … … 83 89 mr_install_dir default = $target 84 90 # 85 #86 91 # conf dir 87 92 # … … 95 100 # 96 101 mr_share_dir default = $sharedir/PBPROJ 102 # 103 # version 104 # 105 mr_version default = PBVER-rPBREV 97 106 EOF 98 107 close(CONF); … … 102 111 103 112 $text .= "install ::\n"; 104 $text .= "\t".'@echo PBPKG PBVER- PBREV will be installed under $(DESTDIR)'."\n";113 $text .= "\t".'@echo PBPKG PBVER-rPBREV will be installed under $(DESTDIR)'."\n"; 105 114 $text .= "\t".'install -m 755 -d $(DESTDIR)'."$confdir/PBPROJ".' $(DESTDIR)'."$cachedir/PBPROJ".' $(DESTDIR)'."$sharedir/PBPROJ\n"; 106 115 $text .= "\t".'cp etc/PBPROJ.conf $(DESTDIR)'."$confdir/PBPROJ/PBPROJ.conf.dist ; install -m 755 -d ".' $(DESTDIR)'."$mandir/man5 ; pod2man etc/PBPROJ.conf > ".'$(DESTDIR)'."$mandir/man5/PBPROJ.conf.5\n"; 107 116 $text .= "\t".'md5sum $(DESTDIR)'."$confdir/PBPROJ/PBPROJ.conf.dist > ".'$(DESTDIR)'."$confdir/PBPROJ/PBPROJ.conf.dist.md5\n"; 108 $text .= "\t".'cp lib/MondoRescue/DynConf.pm $(DESTDIR)/$(INST_LIBDIR)/'."\n"; 109 $text .= "\t".'md5sum $(DESTDIR)'."$confdir/PBPROJ/PBPROJ.conf.dist > ".'$(DESTDIR)'."$confdir/PBPROJ/PBPROJ.conf.dist.md5\n"; 110 #$text .= "\t".'if [ -f etc/PBKG.conf ]; then cp etc/PBPKG.conf $(DESTDIR)'."$confdir/PBPROJ/PBKG.conf.dist ; install -m 755 -d ".' $(DESTDIR)'."$mandir/man5 ; pod2man etc/PBPKG.conf > ".'$(DESTDIR)'."$mandir/man5/PBPKG.conf.5 ; fi\n"; 111 #$text .= "\t".'md5sum $(DESTDIR)'."$confdir/PBPROJ/PBPKG.conf.dist > ".'$(DESTDIR)'."$confdir/PBPROJ/PBPKG.conf.dist.md5\n"; 117 $text .= "\t".'cp lib/MondoRescue/DynConf.pm $(DESTDIR)/$(VENDORLIBEXP)/MondoRescue/'."\n"; 112 118 113 119 # Now generate a perl module used by every other one in the project … … 152 158 153 159 This function returns all the installation PATH info needed by the project 154 It takes no parameter and returns 3values160 It takes no parameter and returns 2 values 155 161 First value is the conf dir 156 162 Second value is the project name … … 159 165 160 166 sub mr_dynconf_init { 161 return( $confdir,PBPROJ);167 return("$confdir/PBPROJ","PBPROJ"); 162 168 } 163 169 1; -
devel/mr/etc/mondorescue.conf
r2650 r2659 20 20 mr_fstab default = /etc/fstab 21 21 22 # 23 # Interface to burner 24 # 25 mr_burn_cmd default = /usr/bin/wodim 26 #mr_burn_cmd default = /usr/bin/cdrecord 27 28 mr_burn_opt default = -v 22 29 # 23 30 # LVM commands and conf files -
devel/mr/lib/MondoRescue/Base.pm
r2650 r2659 25 25 use Exporter; 26 26 27 # Global hash for configuration params of mr 28 my %mr; 29 our $mr = \%mr; 30 27 31 # Export, by default, all the functions into the namespace of 28 32 # any code which uses this module. 29 33 30 34 our @ISA = qw(Exporter); 31 our @EXPORT = qw(mr_init mr_exit );35 our @EXPORT = qw(mr_init mr_exit mr_conf_get $mr); 32 36 33 37 =pod … … 71 75 # 72 76 # Conf files Management 73 # the $ MRMINI_CONF/mondorescue.conf.dist is delivered as part of the project and77 # the $etcdir/mondorescue.conf.dist is delivered as part of the project and 74 78 # its checksum is verified as we need good default values that we can trust 75 79 # … … 106 110 exit($code); 107 111 } 112 113 =item B<mr_conf_get> 114 115 This function get parameters in configuration files and returns from the least significant level (default) to the emost significant level (application name), passing by the project name. 116 It takes a list of parameters to find and returns the values corresponding 117 118 =cut 119 120 121 sub mr_conf_get { 122 my @params = @_; 123 my @ptr = (); 124 my $ptr; 125 126 pb_log(2,"Entering mr_conf_get\n"); 127 my @args1 = pb_conf_get_if(@params); 128 my $proj = $ENV{'PBPROJ'}; 129 $ENV{'PBPROJ'} = $ENV{'PBPKG'}; 130 my @args2 = pb_conf_get_if(@params); 131 foreach my $i (0..$#args1) { 132 $ptr = undef; 133 # Process from least important to more important 134 $ptr = $args1[$i]->{'default'}; 135 $ptr[$i] = $ptr if (defined $ptr); 136 $ptr = $args1[$i]->{$ENV{'PBPROJ'}}; 137 $ptr[$i] = $ptr if (defined $ptr); 138 $ptr = $args2[$i]->{$ENV{'PBPKG'}}; 139 $ptr[$i] = $ptr if (defined $ptr); 140 $ptr[$i] = "Undefined" if (not defined $ptr[$i]); 141 pb_log(2,"Found parameter $params[$i] with value $ptr[$i]\n"); 142 } 143 $ENV{'PBPROJ'} = $proj; 144 return(@ptr); 145 }
Note:
See TracChangeset
for help on using the changeset viewer.