Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
59c8caa9
Commit
59c8caa9
authored
Jun 18, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use LWP to download changelog
parent
7cb07c3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
APT.pm
PVE/API2/APT.pm
+23
-3
No files found.
PVE/API2/APT.pm
View file @
59c8caa9
...
...
@@ -4,7 +4,10 @@ use strict;
use
warnings
;
use
File::
stat
();
use
LWP::
UserAgent
;
use
PVE::
Tools
qw(extract_param)
;
use
PVE::
Cluster
;
use
PVE::
SafeSyslog
;
use
PVE::
INotify
;
use
PVE::
Exception
qw(raise_param_exc)
;
...
...
@@ -343,10 +346,27 @@ __PACKAGE__->register_method({
my
$data
=
"";
# fixme: proxy?
my
$dccfg
=
PVE::Cluster::
cfs_read_file
('
datacenter.cfg
');
my
$proxy
=
$dccfg
->
{
http_proxy
};
my
$ua
=
LWP::
UserAgent
->
new
;
$ua
->
agent
("
PVE/1.0
");
$ua
->
timeout
(
10
);
$ua
->
max_size
(
1024
*
1024
);
if
(
$proxy
)
{
$ua
->
proxy
(['
http
'],
$proxy
);
}
else
{
$ua
->
env_proxy
;
}
my
$response
=
$ua
->
get
(
$url
);
my
$cmd
=
['
wget
',
'
-T
',
10
,
'
-O-
',
$url
];
PVE::Tools::
run_command
(
$cmd
,
outfunc
=>
sub
{
$data
.=
shift
.
"
\n
";
});
if
(
$response
->
is_success
)
{
$data
=
$response
->
decoded_content
;
}
else
{
die
$response
->
status_line
;
}
return
$data
;
}});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment