From: Daniel M. <dm...@us...> - 2007-05-31 00:59:33
|
Update of /cvsroot/fink/fink/perlmod/Fink In directory sc8-pr-cvs17:/tmp/cvs-serv9124 Modified Files: ChangeLog Engine.pm PkgVersion.pm Log Message: Support conditionals in the ConfFiles field Index: PkgVersion.pm =================================================================== RCS file: /cvsroot/fink/fink/perlmod/Fink/PkgVersion.pm,v retrieving revision 1.593 retrieving revision 1.594 diff -u -d -r1.593 -r1.594 --- PkgVersion.pm 31 May 2007 00:36:55 -0000 1.593 +++ PkgVersion.pm 31 May 2007 00:56:38 -0000 1.594 @@ -3754,7 +3754,6 @@ my $self = shift; my $do_splitoff = shift || 0; my ($ddir, $destdir, $control); - my ($conffiles, $listfile); my ($daemonicname, $daemonicfile); my ($cmd); @@ -4259,21 +4258,27 @@ ### config file list - if ($self->has_param("conffiles")) { - $listfile = "$destdir/DEBIAN/conffiles"; - $conffiles = join("\n", grep {$_} split(/\s+/, $self->param("conffiles"))); - $conffiles = &expand_percent($conffiles, $self->{_expand}, $self->get_info_filename." \"conffiles\"")."\n"; + if ($self->has_param('ConfFiles')) { + my $files = $self->param_expanded('ConfFiles'); + $files =~ s/\s+/ /g; # Make it one line + $files = $self->conditional_space_list($files, + "ConfFiles of ".$self->get_fullname()." in ".$self->get_info_filename + ); - print "Writing conffiles list...\n"; + if ($files =~ /\S/) { + # we actually have something + print "Writing conffiles list...\n"; - if ( open(SCRIPT,">$listfile") ) { - print SCRIPT $conffiles; - close(SCRIPT) or die "can't write conffiles list file for ".$self->get_fullname().": $!\n"; - chmod 0644, $listfile; - } else { - my $error = "can't write conffiles list file for ".$self->get_fullname().": $!"; - $notifier->notify(event => 'finkPackageBuildFailed', description => $error); - die $error . "\n"; + my $listfile = "$destdir/DEBIAN/conffiles"; + if ( open my $scriptFH, '>', $listfile ) { + print $scriptFH map "$_\n", split /\s+/, $files; + close $scriptFH or die "can't write conffiles list file for ".$self->get_fullname().": $!\n"; + chmod 0644, $listfile; + } else { + my $error = "can't write conffiles list file for ".$self->get_fullname().": $!"; + $notifier->notify(event => 'finkPackageBuildFailed', description => $error); + die $error . "\n"; + } } } Index: Engine.pm =================================================================== RCS file: /cvsroot/fink/fink/perlmod/Fink/Engine.pm,v retrieving revision 1.406 retrieving revision 1.407 diff -u -d -r1.406 -r1.407 --- Engine.pm 17 May 2007 13:36:02 -0000 1.406 +++ Engine.pm 31 May 2007 00:56:38 -0000 1.407 @@ -2361,7 +2361,7 @@ } elsif ($_ =~ /^source(\d*rename|directory|\d+extractdir)$/ or $_ =~ /^tar\d*filesrename$/ or $_ =~ /^update(configguess|libtool)indirs$/ or - $_ =~ /^set/ or $_ =~ /^(jar|doc|conf)files$/ or + $_ =~ /^set/ or $_ =~ /^(jar|doc)files$/ or $_ =~ /^patch(|file|file-md5)$/ or $_ eq 'appbundles' or $_ eq 'infodocs' or $_ =~ /^daemonicname$/ ) { @@ -2384,6 +2384,17 @@ ); printf "%s: %s\n", $_, $value if length $value; } + } elsif ($_ eq 'conffiles') { + # singleline fields start on the same line, have + # embedded newlines removed, and are not wrapped + # need conditionals processing + if ($pkg->has_param($_)) { + my $value = $pkg->conditional_space_list( + $pkg->param_expanded("ConfFiles"), + "ConfFiles of ".$pkg->get_fullname()." in ".$pkg->get_info_filename + ); + printf "%s: %s\n", $_, $value if length $value; + } } elsif ($_ eq 'shlibs') { # multiline field with specific accessor my $value = $pkg->get_shlibs_field(); Index: ChangeLog =================================================================== RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v retrieving revision 1.1463 retrieving revision 1.1464 diff -u -d -r1.1463 -r1.1464 --- ChangeLog 18 May 2007 02:46:24 -0000 1.1463 +++ ChangeLog 31 May 2007 00:56:38 -0000 1.1464 @@ -1,3 +1,7 @@ +2007-05-30 Daniel Macks <dm...@ne...> + + * Engine.pm, PkgVersion.pm: Support conditionals for ConfFiles + 2007-05-17 Daniel Macks <dm...@ne...> * SelfUpdate.pm, SelfUpdate/rsync.pm: only clear old metadata when |