diff options
Diffstat (limited to 'ci/profiles.perl')
-rwxr-xr-x | ci/profiles.perl | 66 |
1 files changed, 2 insertions, 64 deletions
diff --git a/ci/profiles.perl b/ci/profiles.perl index e18f01fa..6f90a0e4 100755 --- a/ci/profiles.perl +++ b/ci/profiles.perl @@ -5,69 +5,7 @@ eval 'exec perl -wS $0 ${1+"$@"}' # no shebang if 0; # running under some shell use v5.12; -our ($ID, $PRETTY_NAME, $VERSION_ID); # same vars as os-release(5) -my ($release, $version); # from uname -if ($^O eq 'linux') { # try using os-release(5) - for my $f (qw(/etc/os-release /usr/lib/os-release)) { - next unless -f $f; - my @echo = map { - qq{echo "\$"$_" = qq[\$$_];"; } - } qw(ID PRETTY_NAME VERSION_ID); - # rely on sh(1) to handle interpolation and such: - my $vars = `sh -c '. $f; @echo'`; - die "sh \$?=$?" if $?; - eval $vars; - die $@ if $@; - $VERSION_ID //= ''; - $ID //= ''; - if ($ID eq 'debian') { - if ($PRETTY_NAME =~ m!/sid\z!) { - $VERSION_ID = 'sid'; - } else { - open my $fh, '<', $f or die "open($f): $!"; - my $msg = do { local $/; <$fh> }; - die <<EOM; -ID=$ID, but no VERSION_ID -==> $f <== -$msg -EOM - } - } - last if $ID ne '' && $VERSION_ID ne ''; - } - $ID = 'linux' if $ID eq ''; # cf. os-release(5) -} elsif ($^O =~ m!\A(?:free|net|open)bsd\z!) { # TODO: net? dragonfly? - $ID = $^O; - require POSIX; - (undef, undef, $release, $version) = POSIX::uname(); - $VERSION_ID = lc $release; - $VERSION_ID =~ s/[^0-9a-z\.\_\-]//sg; # cf. os-release(5) -} else { # only support POSIX-like and Free systems: - die "$^O unsupported"; -} -$VERSION_ID //= 0; # numeric? could be 'sid', actually... -my %MIN_VER = (freebsd => v11, openbsd => v7.3, netbsd => v9.3); - -if (defined(my $min_ver = $MIN_VER{$^O})) { - my $vid = $VERSION_ID; - $vid =~ s/-.*\z//s; # no dashes in v-strings - my $vstr = eval "v$vid"; - die "can't convert VERSION_ID=$VERSION_ID to v-string" if $@; - die <<EOM if $vstr lt $min_ver; -ID=$ID VERSION_ID=$VERSION_ID release=$release ($version) too old to support -EOM -} -my $PKG_FMT = do { - if ($ID eq 'freebsd') { 'pkg' } - # *shrug*, as long as the (Net|Open)BSD names don't conflict w/ FreeBSD - elsif ($ID eq 'netbsd') { 'pkgin' } - elsif ($ID eq 'openbsd') { 'pkg_add' } - elsif ($ID =~ m!\A(?:debian|ubuntu)\z!) { 'deb' } - elsif ($ID =~ m!\A(?:centos|redhat|fedora)\z!) { 'rpm' } - else { die "PKG_FMT undefined for ID=$ID" } -}; - -# these package group names and '-' syntax are passed to ci/deps.perl +BEGIN { require './install/os.perl' } my $TASKS = do { if ($ID =~ /\A(?:free|net|open)bsd\z/) { <<EOM all devtest Xapian- @@ -92,5 +30,5 @@ EOM } else { die "TODO: support ID=$ID VERSION_ID=$VERSION_ID" } }; -$TASKS =~ s/^/$PKG_FMT /gms; +# this output is read by ci/run.sh and fed to install/deps.perl: print $TASKS; |