Changeset 2254 in ProjectBuilder for devel


Ignore:
Timestamp:
Aug 30, 2017, 5:07:34 PM (7 years ago)
Author:
Bruno Cornec
Message:

Automatically modify v0 filter files into v1 format

Location:
devel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/Conf.pm

    r2253 r2254  
    3030 
    3131our @ISA = qw(Exporter);
    32 our @EXPORT = qw(pb_conf_init pb_conf_add pb_conf_read pb_conf_read_if pb_conf_write pb_conf_get pb_conf_get_if pb_conf_get_all pb_conf_get_hash pb_conf_cache);
    33 ($VERSION,$REVISION) = pb_version_init();
     32our @EXPORT = qw(pb_conf_init pb_conf_add pb_conf_read pb_conf_read_if pb_conf_write pb_conf_get pb_conf_get_if pb_conf_get_all pb_conf_get_hash pb_conf_cache pb_conf_update_v0);
     33($VERSION,$REVISION,$PBCONFVER) = pb_version_init();
    3434
    3535# Global hash of conf files
     
    9292
    9393  $ cat $HOME/.pbrc.yml
    94   ---
     94  --- %YAML 1.0
    9595    pbver:
    9696      - pb: 3
  • devel/pb-modules/lib/ProjectBuilder/VCS.pm

    r2202 r2254  
    492492=item B<pb_vcs_add_if_not_in>
    493493
    494 This function adds to a VCS content from a local directory if the content wasn't already managed under th VCS.
     494This function adds to a VCS content from a local directory if the content wasn't already managed under the VCS.
    495495The first parameter is the schema of the VCS systems (svn, cvs, svn+ssh, ...)
    496496The second parameter is a list of directory/file to add.
  • devel/pb/lib/ProjectBuilder/Filter.pm

    r2253 r2254  
    2424use ProjectBuilder::Distribution;
    2525use ProjectBuilder::Changelog;
     26use ProjectBuilder::VCS;
    2627
    2728# Inherit from the "Exporter" module which handles exporting functions.
     
    6566
    6667my @ffiles;
     68my @ffilestoconvert;
    6769my $pbpkg = shift || die "No package specified";
    6870my $pbos = shift;
     
    7981    foreach my $file_basename (@file_basenames) {
    8082        my $path = "$dir/${file_basename}.yml";
    81         push(@ffiles, $path) if -f $path;
    82     }
    83 }
     83        if (-f $path) {
     84            push(@ffiles, $path);
     85        } else {
     86            my $path2 = "$dir/${file_basename}.pbf";
     87            push(@ffilestoconvert, $path2) if (-f $path2);
     88        }
     89    }
     90}
     91
     92# Convert all old filter files into new ones
     93if (@ffilestoconvert) {
     94    foreach my $f (@ffilestoconvert) {
     95        my $fyml = $f;
     96        $fyml =~ s/\.pbf/.yml/;
     97        pb_update_conf_v0($f,$fyml);
     98        my ($pburl) = pb_conf_get("pburl");
     99        my ($scheme, $account, $host, $port, $path) = pb_get_uri($pburl->{$ENV{'PBPROJ'}});
     100        pb_vcs_add_if_not_in($scheme,$fyml);
     101        push(@ffiles, $fyml);
     102    }
    84103
    85104if (@ffiles) {
Note: See TracChangeset for help on using the changeset viewer.