Changeset 155 for trunk


Ignore:
Timestamp:
Jan 17, 2018, 10:08:49 PM (6 years ago)
Author:
g7moreau
Message:
  • Small bug in AUTHORS.txt generation
Location:
trunk/project-meta
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/project-meta/Makefile

    r154 r155  
    2727        install    -m 0644 -o root -g root PROJECT-META.sample.yml $(DESTDIR)/$(SHAREDIR)
    2828        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
     29        install    -m 0644 -o root -g root template.d/*.tt $(DESTDIR)/$(SHAREDIR)/template.d
    3030
    3131        #@install -d -m 0755 -o root -g root $(DESTDIR)/$(COMPDIR)
  • trunk/project-meta/project-meta

    r154 r155  
    22#
    33# 2018/01/17 Gabriel Moreau
     4#
     5# apt-get install libyaml-syck-perl libtemplate-perl
    46
    57use strict;
     
    137139
    138140   my $current_dir = Cwd::getcwd();
    139    my $template_author = "/usr/share/project-meta/template.d/AUTHORS.tt';
    140    
     141   my $template_author = '/usr/share/project-meta/template.d/AUTHORS.tt';
     142
    141143   my $acronym    = $meta->{'project'}{'acronym'};
    142144   my $authors_list = $meta->{'project'}{'authors'};
    143    
     145
     146   if (-f "$current_dir/AUTHORS.txt") {
     147      print "Warning: AUTHORS.txt already exists\n";
     148      return;
     149      }
     150
    144151   my $tt = Template->new(INCLUDE_PATH => '/usr/share/project-meta/template.d');
    145152   my $msg_format = '';
     
    150157      }, \$msg_format) || die $tt->error;
    151158
    152    print "$msg_format\n\n";
     159   open my $fh,  '>', "$current_dir/AUTHORS.txt" or die $!;
     160   print $fh "$msg_format\n\n";
     161   close $fh;
    153162   }
    154163
Note: See TracChangeset for help on using the changeset viewer.