Changeset 1515


Ignore:
Timestamp:
May 10, 2012, 12:47:51 PM (7 years ago)
Author:
bruno
Message:

r4760@localhost: bruno | 2012-05-10 11:48:21 +0200

  • pb.conf: sudo does not pass through the DEBIAN_FRONTEND variable; use env to make sure it is set. Also change from --force-yes to --allow-unauthenticated (Eric Anderson)
  • Base.pm: Provide a better error message for failures of pb_mkdir_p (Eric Anderson)
  • Distribution.pm: Make sure to apply the ftp/http proxy when installing dependencies. Also add hack to try the install twice if it fails the first time. That may be unnecessary with the DEBIAN_FRONTEND fix, but doesn't hurt. (Eric Anderson)
Location:
devel/pb-modules
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/etc/pb.conf

    r1507 r1515  
    214214
    215215# Command to update the distribution to latest state
    216 osupd du = sudo /usr/bin/apt-get update; export DEBIAN_FRONTEND="noninteractive"; sudo /usr/bin/apt-get --quiet -y --force-yes dist-upgrade
     216osupd du = sudo /usr/bin/apt-get update; sudo env DEBIAN_FRONTEND="noninteractive" /usr/bin/apt-get --quiet -y --force-yes dist-upgrade
    217217osupd gen = sudo /usr/bin/emerge --update --deep world; sudo /usr/bin/revdep-rebuild
    218218osupd rpm = sudo /usr/bin/yum clean all; sudo /usr/bin/yum -y update
     
    225225# Chaining the commands allow to only test for what is able to be installed,
    226226# not the update of the repo which may well be unaccessible if too old
    227 osins du = sudo /usr/bin/apt-get update ; sudo /usr/bin/apt-get -y --force-yes install
     227osins du = sudo /usr/bin/apt-get update ; sudo env DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get -y --allow-unauthenticated install
    228228osins gen = sudo /usr/bin/emerge
    229229osins rpm = sudo /usr/bin/yum clean all; sudo /usr/bin/yum -y update ; sudo /usr/bin/yum -y install
  • devel/pb-modules/lib/ProjectBuilder/Base.pm

    r1513 r1515  
    1414use strict;
    1515use lib qw (lib);
    16 use Carp 'cluck';
     16use Carp qw/confess cluck/;
    1717use Cwd;
    1818use File::Path;
     
    109109sub pb_mkdir_p {
    110110my @dir = @_;
    111 my $ret = mkpath(@dir, 0, 0755);
     111my $ret = eval { mkpath(@dir, 0, 0755) };
     112confess "pb_mkdir_p @dir failed in ".getcwd().": $@" if ($@);
    112113return($ret);
    113114}
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r1514 r1515  
    1010use strict;
    1111use Data::Dumper;
     12use Carp 'confess';
    1213use ProjectBuilder::Version;
    1314use ProjectBuilder::Base;
     
    303304my $deps = shift || undef;
    304305
     306my $ftp_proxy = pb_distro_get_param($pbos,pb_conf_get_if("ftp_proxy"));
     307my $http_proxy = pb_distro_get_param($pbos,pb_conf_get_if("http_proxy"));
     308
     309# We do not overwrite shell settings
     310$ENV{ftp_proxy} ||= $ftp_proxy;
     311$ENV{http_proxy} ||= $http_proxy;
     312
    305313# Protection
    306314return if (not defined $pbos->{'install'});
     
    313321# This may not be // proof. We should test for availability of repo and sleep if not
    314322my $cmd = "$pbos->{'install'} $deps";
    315 pb_system($cmd,"Installing dependencies ($cmd)");
     323my $ret = pb_system($cmd, "Installing dependencies ($cmd)", undef, 1);
     324# Try to accomodate deficient proxies
     325if ($ret != 0) {
     326    pb_system($cmd, "Re-trying installing dependencies ($cmd)");
     327}
    316328}
    317329
Note: See TracChangeset for help on using the changeset viewer.