View | Details | Raw Unified | Return to bug 38269
Collapse All | Expand All

(-)apt-repo.orig (-3 / +21 lines)
Lines 29-34 Link Here
29
my $new_format_parts = 2;
29
my $new_format_parts = 2;
30
my $dry_run = 0;
30
my $dry_run = 0;
31
31
32
my $proxy = get_proxy();
33
32
if( grep( /^--dry-run$/, @ARGV) ) {
34
if( grep( /^--dry-run$/, @ARGV) ) {
33
    $dry_run = 1;
35
    $dry_run = 1;
34
    @ARGV = map( /^--dry-run$/ ? () : $_, @ARGV);
36
    @ARGV = map( /^--dry-run$/ ? () : $_, @ARGV);
Lines 121-126 Link Here
121
    'sisyphus'
123
    'sisyphus'
122
);
124
);
123
125
126
sub get_proxy {
127
128
    my @res=`apt-config dump | grep -i "http::proxy"`;
129
130
    if (scalar @res > 1) {
131
	print "Too many proxy found. You should check the apt's configuration.";
132
    }
133
134
    if ( $res[0] =~ /.*Proxy "(.*)";/ ) {
135
	#print "$1\n";
136
	return "--proxy $1";
137
    }
138
139
    return "";
140
}
141
124
# Show usage information
142
# Show usage information
125
sub show_usage {
143
sub show_usage {
126
	print <<"HELP";
144
	print <<"HELP";
Lines 210-216 Link Here
210
228
211
        die "Task $task is unknown or still building" if ! task_exists( $task );
229
        die "Task $task is unknown or still building" if ! task_exists( $task );
212
230
213
	open P, '-|', "curl -s http://git.altlinux.org/tasks/$task/plan/add-bin | cut -f1 | egrep -v '\\-(devel.*|debuginfo)\$' | sort -u";
231
	open P, '-|', "curl $proxy -s http://git.altlinux.org/tasks/$task/plan/add-bin | cut -f1 | egrep -v '\\-(devel.*|debuginfo)\$' | sort -u";
214
	@out = <P>;
232
	@out = <P>;
215
	close P;
233
	close P;
216
	return @out;
234
	return @out;
Lines 221-227 Link Here
221
        my $task = shift;
239
        my $task = shift;
222
        my @out = ();
240
        my @out = ();
223
241
224
        open P, '-|', "curl -s  -w '%{http_code}' http://git.altlinux.org/tasks/$task/plan/add-bin";
242
        open P, '-|', "curl $proxy -s  -w '%{http_code}' http://git.altlinux.org/tasks/$task/plan/add-bin";
225
        @out = <P>;
243
        @out = <P>;
226
        close P;
244
        close P;
227
        return ( (pop @out) eq "200" and (scalar @out) != 0);
245
        return ( (pop @out) eq "200" and (scalar @out) != 0);
Lines 234-240 Link Here
234
252
235
	die "Missing or wrong task number" if ! defined $task or ! $task=~ /^(\d+)$/;
253
	die "Missing or wrong task number" if ! defined $task or ! $task=~ /^(\d+)$/;
236
254
237
	open P, '-|', "curl -s  -w '%{http_code}' http://git.altlinux.org/tasks/$task/plan/arepo-add-x86_64-i586";
255
	open P, '-|', "curl $proxy -s  -w '%{http_code}' http://git.altlinux.org/tasks/$task/plan/arepo-add-x86_64-i586";
238
	@out = <P>;
256
	@out = <P>;
239
	close P;
257
	close P;
240
	return ( (pop @out) eq "200" and (scalar @out) != 0);
258
	return ( (pop @out) eq "200" and (scalar @out) != 0);

Return to bug 38269