#!/usr/bin/perl use File::Basename; use File::Path qw'remove_tree'; use constant { INSTALL_PATH => '/usr/local/i686-w64-mingw32/.' }; my @pkgs = qw' mingw64-i686-bzip2 mingw64-i686-headers mingw64-i686-libgcrypt mingw64-i686-libgpg-error mingw64-i686-runtime mingw64-i686-xz mingw64-i686-zlib '; open my $sshfd, '-|', '/usr/bin/ssh', '-n', 'sourceware.org', 'exec /home/cgf/bin/cygver', @pkgs; remove_tree('/tmp/mingw'); mkdir '/tmp/mingw' or die "$0: couldn't mkdir /tmp/mingw64 - $!\n"; chdir '/tmp/mingw' or die "$0: couldn't cd to /tmp/mingw64 - $!\n"; while (<$sshfd>) { m%/mingw64% or die "$0: unrecognized output from ssh - $!\n"; chomp; print basename($_), "\n"; if (!fork) { open STDIN, '-|', '/usr/bin/ssh', '-n', 'sourceware.org', "exec cat $_"; exec '/usr/bin/tar', '-xjf', '-'; } } close $sshfd or die "$0: ssh terminated with non-zero status\n"; 0 while wait > 0; remove_tree(glob INSTALL_PATH . '/*'); system('/bin/mv', glob('usr/i686-w64-mingw32/sys-root/mingw/*'), INSTALL_PATH) == 0 or exit 1; for my $host (qw'trixie cos') { system('rsync', '-a', '--partial', '--inplace', '--delete', '--force', INSTALL_PATH, "$host:" . INSTALL_PATH) == 0 or exit 1; }