ALT Linux Bugzilla
– Attachment 8686 Details for
Bug 38269
Надо использовать настройки прокси-сервера
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Поиск proxy в apt
apt-repo.diff (text/plain), 1.88 KB, created by
Sergey Y. Afonin
on 2020-03-27 16:28:38 MSK
(
hide
)
Description:
Поиск proxy в apt
Filename:
MIME Type:
Creator:
Sergey Y. Afonin
Created:
2020-03-27 16:28:38 MSK
Size:
1.88 KB
patch
obsolete
>--- apt-repo.orig 2019-05-21 11:59:43.000000000 +0400 >+++ apt-repo 2020-03-27 17:00:08.599329966 +0400 >@@ -29,6 +29,8 @@ > my $new_format_parts = 2; > my $dry_run = 0; > >+my $proxy = get_proxy(); >+ > if( grep( /^--dry-run$/, @ARGV) ) { > $dry_run = 1; > @ARGV = map( /^--dry-run$/ ? () : $_, @ARGV); >@@ -121,6 +123,22 @@ > 'sisyphus' > ); > >+sub get_proxy { >+ >+ my @res=`apt-config dump | grep -i "http::proxy"`; >+ >+ if (scalar @res > 1) { >+ print "Too many proxy found. You should check the apt's configuration."; >+ } >+ >+ if ( $res[0] =~ /.*Proxy "(.*)";/ ) { >+ #print "$1\n"; >+ return "--proxy $1"; >+ } >+ >+ return ""; >+} >+ > # Show usage information > sub show_usage { > print <<"HELP"; >@@ -210,7 +228,7 @@ > > die "Task $task is unknown or still building" if ! task_exists( $task ); > >- open P, '-|', "curl -s http://git.altlinux.org/tasks/$task/plan/add-bin | cut -f1 | egrep -v '\\-(devel.*|debuginfo)\$' | sort -u"; >+ open P, '-|', "curl $proxy -s http://git.altlinux.org/tasks/$task/plan/add-bin | cut -f1 | egrep -v '\\-(devel.*|debuginfo)\$' | sort -u"; > @out = <P>; > close P; > return @out; >@@ -221,7 +239,7 @@ > my $task = shift; > my @out = (); > >- open P, '-|', "curl -s -w '%{http_code}' http://git.altlinux.org/tasks/$task/plan/add-bin"; >+ open P, '-|', "curl $proxy -s -w '%{http_code}' http://git.altlinux.org/tasks/$task/plan/add-bin"; > @out = <P>; > close P; > return ( (pop @out) eq "200" and (scalar @out) != 0); >@@ -234,7 +252,7 @@ > > die "Missing or wrong task number" if ! defined $task or ! $task=~ /^(\d+)$/; > >- open P, '-|', "curl -s -w '%{http_code}' http://git.altlinux.org/tasks/$task/plan/arepo-add-x86_64-i586"; >+ open P, '-|', "curl $proxy -s -w '%{http_code}' http://git.altlinux.org/tasks/$task/plan/arepo-add-x86_64-i586"; > @out = <P>; > close P; > return ( (pop @out) eq "200" and (scalar @out) != 0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 38269
:
8686
|
8689