From 3cdf7de0331ca55e0acc77ce3fd793b728f577ab Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Mon, 27 Sep 2010 01:45:24 +0000 Subject: [PATCH] Support properly running the check for a running ssh-agent on git repository URLs of the form user@git.kde.org:/path/to/repo.git Reported by Eike Hein. CCMAIL:hein@kde.org svn path=/trunk/KDE/kdesdk/scripts/kdesrc-build; revision=1180114 --- kdesrc-build | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/kdesrc-build b/kdesrc-build index 47d35e5..d599728 100755 --- a/kdesrc-build +++ b/kdesrc-build @@ -4510,23 +4510,33 @@ sub split_url # be controlled with the disable-agent-check parameter. sub check_for_ssh_agent { - my @servers = map { - if (module_scm_type($_) eq 'svn') { - get_option($_, 'svn-server'); - } - else { - get_option($_, 'repository'); - } - } (@update_list); - # Don't bother with all this if the user isn't even using SSH. return 1 if pretending; + my @svnServers = grep { + module_scm_type($_) eq 'svn'; + } (@update_list); + + my @gitServers = grep { + module_scm_type($_) eq 'git'; + } (@update_list); + my @sshServers = grep { - my ($proto, $host) = split_url($_); - $proto =~ /ssh/; - } @servers; + my ($proto, $host) = split_url(get_option($_, 'svn-server')); + + # Check if ssh is explicitly used in the proto, or if the host is the + # developer main svn. + (defined $proto && $proto =~ /ssh/) || (defined $host && $host =~ /^svn\.kde\.org/); + } @svnServers; + + push @sshServers, grep { + # Check for git+ssh:// or user@git.kde.org:/path/etc. + my $repo = get_option($_, 'repository'); + info "\t\tChecking repo g[b[", $repo, "]"; + ($repo =~ /^git\+ssh:\/\//) || ($repo =~ /^[a-zA-Z0-9_.]+@.*:\//); + } @gitServers; + whisper "\tChecking for SSH Agent" if (scalar @sshServers); return 1 if (not @sshServers) or get_option('global', 'disable-agent-check'); # We're using ssh to download, see if ssh-agent is running.