Changeset 154


Ignore:
Timestamp:
Jan 17, 2018, 9:58:10 PM (3 years ago)
Author:
g7moreau
Message:
  • Begin make-author implementation
Location:
trunk/project-meta
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/project-meta/Makefile

    r152 r154  
    1818        @install -d -m 0755 -o root -g root $(DESTDIR)/$(SHAREDIR)
    1919        @install -d -m 0755 -o root -g root $(DESTDIR)/$(SHAREDIR)/licence.d
     20        @install -d -m 0755 -o root -g root $(DESTDIR)/$(SHAREDIR)/template.d
    2021        #@install -d -m 0755 -o root -g root $(DESTDIR)/$(MANDIR)
    2122
     
    2627        install    -m 0644 -o root -g root PROJECT-META.sample.yml $(DESTDIR)/$(SHAREDIR)
    2728        install    -m 0644 -o root -g root licence.d/*.txt $(DESTDIR)/$(SHAREDIR)/licence.d
     29        install    -m 0644 -o root -g root licence.d/*.tt  $(DESTDIR)/$(SHAREDIR)/template.d
    2830
    2931        #@install -d -m 0755 -o root -g root $(DESTDIR)/$(COMPDIR)
  • trunk/project-meta/project-meta

    r153 r154  
    1010use Getopt::Long();
    1111use Cwd();
     12use Template;
     13
    1214
    1315my ($verbose);
     
    8082
    8183   my $acronym     = $meta->{'project'}{'acronym'};
    82    my $current_dir = "/fsnet/project/coriolis/2014/14CARR" ; # Cwd::getcwd();
     84   my $current_dir = Cwd::getcwd();
    8385   my $dap_folder  = $meta->{'public-dap'}{'dap-folder'};
    8486
     
    106108   my $meta = YAML::Syck::LoadFile("PROJECT-META.yml");
    107109   my $acronym = $meta->{'project'}{'acronym'};
    108    my $current_dir = "/fsnet/project/coriolis/2014/14CARR" ; # Cwd::getcwd();
     110   my $current_dir = Cwd::getcwd();
    109111   my $dap_folder = $meta->{'public-dap'}{'dap-folder'};
    110112
     
    133135sub cmd_make_author {
    134136   my $meta = YAML::Syck::LoadFile("PROJECT-META.yml");
     137
     138   my $current_dir = Cwd::getcwd();
     139   my $template_author = "/usr/share/project-meta/template.d/AUTHORS.tt';
     140   
     141   my $acronym    = $meta->{'project'}{'acronym'};
     142   my $authors_list = $meta->{'project'}{'authors'};
     143   
     144   my $tt = Template->new(INCLUDE_PATH => '/usr/share/project-meta/template.d');
     145   my $msg_format = '';
     146   $tt->process('AUTHORS.tt',
     147      {
     148         acronym    => $acronym,
     149         authorlist => $authors_list,
     150      }, \$msg_format) || die $tt->error;
     151
     152   print "$msg_format\n\n";
    135153   }
    136154
     
    156174   copy("/usr/share/project-meta/licence.d/$licence.txt", "$current_dir/LICENCE.txt")
    157175      or die "Error: licence copy failed - $!";
     176
     177   print "Info: LICENCE.txt file create\n";
    158178   return;
    159179   }
Note: See TracChangeset for help on using the changeset viewer.