summaryrefslogtreecommitdiffstats
path: root/mdkonline.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-08-09 08:00:25 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-08-09 08:00:25 +0000
commitdc25d214b33eb747272fc3b7a4640251b471a2ee (patch)
treee394b4bfec1396627d51eac8c9238a28f501b6ca /mdkonline.pm
parent0943af348f240e34cfdad6427e3ab97b1be43a16 (diff)
downloadmgaonline-dc25d214b33eb747272fc3b7a4640251b471a2ee.tar
mgaonline-dc25d214b33eb747272fc3b7a4640251b471a2ee.tar.gz
mgaonline-dc25d214b33eb747272fc3b7a4640251b471a2ee.tar.bz2
mgaonline-dc25d214b33eb747272fc3b7a4640251b471a2ee.tar.xz
mgaonline-dc25d214b33eb747272fc3b7a4640251b471a2ee.zip
perl_checker cleanups
Diffstat (limited to 'mdkonline.pm')
-rw-r--r--mdkonline.pm24
1 files changed, 11 insertions, 13 deletions
diff --git a/mdkonline.pm b/mdkonline.pm
index 2be4c45b..66f999da 100644
--- a/mdkonline.pm
+++ b/mdkonline.pm
@@ -20,7 +20,7 @@ sub get_release() {
sub get_from_URL {
my ($link, $agent_name) = @_;
my $ua = LWP::UserAgent->new;
- $ua->agent("$agent_name" . $ua->agent);
+ $ua->agent($agent_name . $ua->agent);
$ua->env_proxy;
my $request = HTTP::Request->new(GET => $link);
my $response = $ua->request($request);
@@ -54,25 +54,23 @@ sub header { "
* $_[0]
********************************************************************************";
}
-open (my $FILE,"> $file") || die "Couldn't open $file : $!";
-map { chomp; print $FILE "$_\n" }
+ouput($file, map { chomp; "$_\n" }
header("partitions"), cat_("/proc/partitions"),
header("cpuinfo"), cat_("/proc/cpuinfo"),
header("fstab"), cat_("/etc/fstab"),
header("/etc/modules.conf"), cat_("/etc/modules.conf"),
- header("rpm -qa"), join ('', sort `rpm -qa`),
- header("mandrake version"), cat_('/etc/mandrake-release');
-close($FILE);
-`/usr/bin/bzip2 \\\-f $file`;
-open (my $F, "$file" . ".bz2") or die "Cannot open file : $!";
+ header("rpm -qa"), join('', sort `rpm -qa`),
+ header("mandrake version"), cat_('/etc/mandrake-release'));
+system("/usr/bin/bzip2 -f $file");
+open(my $F, $file . ".bz2") or die "Cannot open file : $!";
my ($chunk, $buffer);
while (read($F, $chunk, 60*57)) {
$buffer .= $chunk;
}
-close ($F);
-open (my $OUT, "> $file" . ".bz2.uue") or die "Cannot open file : $!";
+close($F);
+open(my $OUT, "> $file" . ".bz2.uue") or die "Cannot open file : $!";
print $OUT encode_base64($buffer);
-close ($OUT);
+close($OUT);
}
sub send_config {
@@ -92,13 +90,13 @@ sub send_config {
sub mv_files {
my ($source, $dest) = @_;
- -e $source and system("mv","$source","$dest");
+ -e $source and system("mv", $source, $dest);
}
sub automated_upgrades {
my ($conffile, $login, $passwd, $boxname, $key, $country, $auto) = @_;
my ($r) = get_release();
- output "$conffile",
+ output $conffile,
qq(# automatically generated file. Please don't edit
LOGIN=$login
PASS=$passwd