BVB Source Codes

Gource Show build_tar.pl Source code

Return Download Gource: download build_tar.pl Source code - Download Gource Source code - Type:.pl
  1. #!/usr/bin/perl
  2. #copy stuff we want to go into the gource source tar ball
  3.  
  4. use strict;
  5. use warnings;
  6.  
  7.  
  8. use FindBin;
  9. use File::Path;
  10. use File::Copy;
  11. use Date::Format;
  12. use Getopt::Long qw(GetOptions);
  13. use Cwd;
  14.  
  15. sub gource_version {
  16.     my $version = `cat $FindBin::Bin/../../src/gource_settings.h | grep GOURCE_VERSION`;
  17.     $version =~ /"([^"]+)"/ or die("could not determine version\n");
  18.     $version = $1;
  19.     return $version;
  20. }
  21.  
  22. my $VERSION = gource_version();
  23.  
  24. my @exclusions = (
  25.     qr{^/autogen\.sh$},
  26.     qr{^/backup/},
  27.     qr{^/confs/},
  28.     qr{^/cmd/},
  29.     qr{^/resources/},
  30.     qr{^/tests/},
  31.     qr{^/scripts/},
  32.     qr{^/contrib/},
  33.     qr{^/config.status$},
  34.     qr{^/config.log$},
  35.     qr{^/gource$},
  36.     qr{^/dev/},
  37.     qr{^/logs/},
  38.     qr{/\.},
  39.     qr{Makefile$},
  40.     qr{\.o$},
  41.     qr{^/todo.txt$},
  42.     qr{^/build-stamp$},
  43.     qr{^/autom4te},
  44.     qr{^/src/core/README$},
  45.     qr{^/src/core/ui/},
  46.     qr{\.d$},
  47. );
  48.  
  49. my @inclusions = (
  50.     qr{^/gource\.win32\.cbp$},
  51.     qr{^/ChangeLog$},
  52.     qr{^/THANKS$},
  53.     qr{^/COPYING$},
  54.     qr{^/INSTALL$},
  55.     qr{^/README$},
  56.     qr{/Makefile\.(?:am|in)$},
  57.     qr{^/aclocal\.m4$},
  58.     qr{^/m4/.+\.m4$},
  59.     qr{^/configure(?:\.ac)?$},
  60.     qr{^/src/.+\.(?:cpp|h|cc|hh)$},
  61.     qr{^/data/file\.png$},
  62.     qr{^/data/user\.png$},
  63.     qr{^/data/beam\.png$},
  64.     qr{^/data/bloom\.tga$},
  65.     qr{^/data/bloom_alpha\.tga$},
  66.     qr{^/data/cursor\.png$},
  67.     qr{^/data/fonts/FreeSans\.ttf$},
  68.     qr{^/data/gource\.1$},
  69.     qr{^/data/gource\.style$},
  70.     qr{^/data/fonts/README$},
  71.     qr{^/data/shaders/bloom\.(?:vert|frag)$},
  72.     qr{^/data/shaders/shadow\.(?:vert|frag)$},
  73.     qr{^/data/shaders/text\.(?:vert|frag)$},
  74.     qr{^/build-aux/(?:compile|config.(?:guess|sub)|depcomp|install-sh|missing)$},
  75. );
  76.  
  77. my $tmp_path = "/var/tmp/gource-$VERSION";
  78.  
  79. system("rm -r $tmp_path") if -d $tmp_path;
  80. mkpath($tmp_path) or die("failed to make temp folder $tmp_path");
  81.  
  82. chdir("$FindBin::Bin/../../");
  83.  
  84. my @files = `find .`;
  85.  
  86. #check configure.ac has been updated
  87. unless(`cat configure.ac` =~ /AC_INIT\(Gource, $VERSION,/) {
  88.     die("configure.ac does not mention current version number\n");
  89. }
  90.  
  91. #check ChangeLog has been updated
  92. unless(`cat ChangeLog` =~ /^$VERSION:/) {
  93.     die("ChangeLog does not mention current version number\n");
  94. }
  95.  
  96. #if Makefile exists, do distclean
  97. if(-e 'Makefile') {
  98.     if(system("make distclean") != 0) {
  99.         die("make distclean failed: $!\n");
  100.     }
  101. }
  102.  
  103. #reconfigure
  104. if(system("autoreconf -f -i -v") != 0) {
  105.     die("autoreconf failed: $!\n");
  106. }
  107.  
  108. foreach my $file (@files) {
  109.     $file =~ s/[\r\n]+//;
  110.     $file =~ s/^\.//;
  111.  
  112.     (my $relfile = $file) =~ s{^/}{};
  113.     (my $dir = $file)    =~ s{[^/]+$}{/};
  114.  
  115.     next if $file =~ /^\s*$/;
  116.     next if -d $relfile;
  117.  
  118.     next if grep { $file =~ $_ } @exclusions;
  119.  
  120.     unless(grep { $file =~ $_ } @inclusions) {
  121.         warn "WARNING: nothing known about $file\n";
  122.         next;
  123.     }
  124.  
  125.     mkpath("$tmp_path/$dir");
  126.     if(system("cp", "$relfile", "$tmp_path/$relfile") != 0) {
  127.         die("error copying $file to $tmp_path/$relfile: $? $!\n");
  128.     }
  129. }
  130.  
  131. my $current_dir = cwd;
  132. chdir("/var/tmp/");
  133.  
  134. my $archive = "gource-$VERSION.tar.gz";
  135.  
  136. if(system("tar -czf $archive gource-$VERSION") !=0) {
  137.     die("failed to make archive $archive");
  138. }
  139.  
  140. unlink("$FindBin::Bin/../builds/$archive");
  141.  
  142. my $builds_dir = "$FindBin::Bin/../builds/";
  143.  
  144. system('mkdir', '-p', $builds_dir);
  145.  
  146. unlink("$builds_dir/$archive") if -e "$builds_dir/$archive";
  147.  
  148. move("$archive", $builds_dir);
  149. system("rm -r $tmp_path");
  150.  
  151. print "Built $archive\n";
  152.  
downloadbuild_tar.pl Source code - Download Gource Source code
Related Source Codes/Software:
FDFullscreenPopGesture - A UINavigationController's category to enable full... 2017-01-10
node-style-guide - A guide for styling your node.js / JavaScript code... 2017-01-09
ImageOptim - GUI image optimizer for Mac htt... 2017-01-09
falcon - Falcon is a low-level, high-performance Python fra... 2017-01-09
prerender - Node server that uses phantomjs to render a javasc... 2017-01-09
che - Eclipse Che: Next-generation Eclipse IDE. Open sou... 2017-01-10
notepad-plus-plus - Notepad++ official repository h... 2017-01-10
waterline - An adapter-based ORM for Node.js with support for ... 2017-01-10
Workerman - An asynchronous event driven PHP framework for eas... 2017-01-10
structor - An advanced visual editor for React components ... 2017-01-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top