2018-02-05 13:38:02 +01:00
|
|
|
#!/usr/bin/env perl
|
2012-10-06 13:10:25 +02:00
|
|
|
###########################################################################
|
|
|
|
# scandeps.pl
|
|
|
|
# ---------------------
|
|
|
|
# begin : October 2010
|
|
|
|
# copyright : (C) 2010 by Juergen E. Fischer
|
|
|
|
# email : jef at norbit dot de
|
|
|
|
###########################################################################
|
|
|
|
# #
|
|
|
|
# This program is free software; you can redistribute it and/or modify #
|
|
|
|
# it under the terms of the GNU General Public License as published by #
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or #
|
|
|
|
# (at your option) any later version. #
|
|
|
|
# #
|
|
|
|
###########################################################################
|
2010-10-31 21:08:41 +00:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
2014-07-15 09:10:09 +02:00
|
|
|
my @dists;
|
|
|
|
open I, "debian/rules";
|
|
|
|
while(<I>) {
|
|
|
|
if( /ifneq \(\$\(DISTRIBUTION\),\$\(findstring \$\(DISTRIBUTION\),"(.*)"\)\)/ ) {
|
|
|
|
for my $d (split / /, $1) {
|
|
|
|
next if $d =~ /oracle/;
|
|
|
|
push @dists, $d;
|
|
|
|
}
|
|
|
|
push @dists, "sid";
|
|
|
|
last;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close I;
|
|
|
|
|
|
|
|
die "no dists" unless @dists;
|
|
|
|
|
2010-10-31 21:08:41 +00:00
|
|
|
open I, "doc/linux.t2t";
|
|
|
|
open O, ">doc/linux.t2t.new";
|
|
|
|
while(<I>) {
|
|
|
|
last if /^\|\| Distribution \| install command for packages \|\n$/;
|
|
|
|
print O;
|
|
|
|
}
|
|
|
|
|
|
|
|
print O "|| Distribution | install command for packages |\n";
|
|
|
|
|
2014-07-15 09:10:09 +02:00
|
|
|
for my $dist (@dists) {
|
|
|
|
system("git checkout debian/control" )==0 or die "git checkout failed: $!";
|
|
|
|
system("make -f debian/rules DISTRIBUTION=$dist cleantemplates templates" )==0 or die "make failed: $!";
|
2010-10-31 21:08:41 +00:00
|
|
|
|
2014-07-15 09:10:09 +02:00
|
|
|
open F, "debian/control";
|
2010-10-31 21:08:41 +00:00
|
|
|
while(<F>) {
|
|
|
|
chop;
|
|
|
|
last if /^Build-Depends:/i;
|
|
|
|
}
|
|
|
|
|
|
|
|
s/^Build-Depends:\s*//;
|
|
|
|
my $deps = $_;
|
|
|
|
|
|
|
|
while(<F>) {
|
|
|
|
chop;
|
|
|
|
last if /^\S/;
|
|
|
|
$deps .= $_;
|
|
|
|
}
|
2017-11-02 20:28:37 +01:00
|
|
|
|
|
|
|
while(<F>) {
|
|
|
|
chop;
|
|
|
|
last if /^Package: python-qgis/;
|
|
|
|
}
|
|
|
|
|
|
|
|
while(<F>) {
|
|
|
|
chop;
|
|
|
|
last if /^Depends:/;
|
|
|
|
}
|
|
|
|
|
|
|
|
s/^Depends:\s*//;
|
|
|
|
$deps .= ",$_";
|
|
|
|
|
|
|
|
while(<F>) {
|
|
|
|
chop;
|
|
|
|
last if /^\S/;
|
|
|
|
$deps .= $_;
|
|
|
|
}
|
|
|
|
|
2014-07-15 09:10:09 +02:00
|
|
|
close F;
|
2017-11-02 20:28:37 +01:00
|
|
|
|
2014-07-15 09:10:09 +02:00
|
|
|
system("git checkout debian/control" )==0 or die "git checkout failed: $!";
|
2010-10-31 21:08:41 +00:00
|
|
|
|
2018-05-11 01:43:43 +02:00
|
|
|
$deps .= ",cmake-curses-gui,ccache,expect,qt5-default,libyaml-tiny-perl,python-autopep8";
|
2017-11-02 20:28:37 +01:00
|
|
|
|
2010-10-31 21:08:41 +00:00
|
|
|
my @deps;
|
2016-10-17 15:56:52 +02:00
|
|
|
my %deps;
|
2010-10-31 21:08:41 +00:00
|
|
|
foreach my $p (split /,/, $deps) {
|
|
|
|
$p =~ s/^\s+//;
|
|
|
|
$p =~ s/\s+.*$//;
|
2017-11-02 20:28:37 +01:00
|
|
|
next if $p =~ /\$|qgis/;
|
2010-10-31 21:08:41 +00:00
|
|
|
next if $p =~ /^(debhelper|subversion|python-central)$/;
|
2016-10-17 15:56:52 +02:00
|
|
|
push @deps, $p if not exists $deps{$p};
|
|
|
|
$deps{$p} = 1;
|
2010-10-31 21:08:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
my $dep="";
|
|
|
|
my @dep;
|
|
|
|
foreach my $p (sort @deps) {
|
|
|
|
if( length("$dep $p") > 60 ) {
|
|
|
|
push @dep, $dep;
|
|
|
|
$dep = $p;
|
|
|
|
} else {
|
|
|
|
$dep .= " $p";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-02 20:28:37 +01:00
|
|
|
push @dep, $dep if $dep ne "";
|
2010-10-31 21:08:41 +00:00
|
|
|
|
2011-04-04 07:25:27 +00:00
|
|
|
print O "| $dist | ``apt-get install" . join( " ", @dep ) . "`` |\n";
|
2010-10-31 21:08:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
while(<I>) {
|
|
|
|
last if /^$/;
|
|
|
|
}
|
|
|
|
|
|
|
|
print O;
|
|
|
|
|
|
|
|
while(<I>) {
|
|
|
|
print O;
|
|
|
|
}
|
|
|
|
|
|
|
|
close O;
|
|
|
|
close I;
|
|
|
|
|
|
|
|
rename "doc/linux.t2t", "doc/linux.t2t.orig";
|
|
|
|
rename "doc/linux.t2t.new", "doc/linux.t2t";
|
2015-06-17 12:30:28 +02:00
|
|
|
my $time = time;
|
|
|
|
utime $time, $time, "doc/INSTALL.t2t";
|