summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/detect.pm
blob: abc6f2bc7a44feb1b1d8f0b07bbc9f47732ca3f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Diffstat (limited to 'po/pt.po')
-rw-r--r--po/pt.po135
1 files changed, 50 insertions, 85 deletions
diff --git a/po/pt.po b/po/pt.po
index c1604f1b..3319dca7 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -1,3 +1,4 @@
+# translation of urpmi.po to português
# translation of urpmi-pt.po to Potuguês
# translation of pt.po to português
#
@@ -18,12 +19,12 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: urpmi-pt\n"
+"Project-Id-Version: urpmi\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2004-10-15 17:05+0200\n"
-"PO-Revision-Date: 2004-10-06 00:12+0100\n"
-"Last-Translator: José Melo <mmodem00@netvisao.pt>\n"
-"Language-Team: Português <pt@li.org>\n"
+"PO-Revision-Date: 2004-10-15 21:08+0200\n"
+"Last-Translator: Jose Jorge <jjorge@free.fr>\n"
+"Language-Team: português <pt@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -139,8 +140,7 @@ msgstr "a média \"%s\" está a tentar usar um hdlist já usado, média ignorada
#: ../urpm.pm:194
#, c-format
msgid "medium \"%s\" trying to use an already used list, medium ignored"
-msgstr ""
-"a média \"%s\" está a tentar usar um ficheiro lista já usado, média ignorada"
+msgstr "a média \"%s\" está a tentar usar um ficheiro lista já usado, média ignorada"
#: ../urpm.pm:207 ../urpm.pm:1211 ../urpm.pm:1221
#, c-format
@@ -319,9 +319,9 @@ msgid "medium \"%s\" already exists"
msgstr "a média \"%s\" já existe"
#: ../urpm.pm:624
-#, fuzzy, c-format
+#, c-format
msgid "virtual medium needs to be local"
-msgstr "a média virtual \"%s\" não é local, média ignorada"
+msgstr "o média virtual tem de ser local"
#: ../urpm.pm:662
#, c-format
@@ -572,7 +572,7 @@ msgstr "a construir o hdlist [%s]"
msgid ""
"Unable to build synthesis file for medium \"%s\". Your hdlist file may be "
"corrupted."
-msgstr ""
+msgstr "Incapaz de construir um ficheiro synthesis para o média \"%s\". O seu ficheiro hdlist pode estar corrupto."
#: ../urpm.pm:1838 ../urpm.pm:1873 ../urpmi:356
#, c-format
@@ -720,10 +720,8 @@ msgstr "a usar o processo %d para executar a transacção"
#: ../urpm.pm:2825
#, c-format
-msgid ""
-"created transaction for installing on %s (remove=%d, install=%d, upgrade=%d)"
-msgstr ""
-"transacção criada para instalar em %s (remove=%d, instala=%d, actualiza=%d)"
+msgid "created transaction for installing on %s (remove=%d, install=%d, upgrade=%d)"
+msgstr "transacção criada para instalar em %s (remove=%d, instala=%d, actualiza=%d)"
#: ../urpm.pm:2828
#, c-format
@@ -845,23 +843,19 @@ msgstr " --help - mostra esta mensagem de ajuda.\n"
#: ../urpme:42 ../urpmi:80
#, c-format
msgid " --auto - automatically select a package in choices.\n"
-msgstr ""
-" --auto - selecciona automaticamente um pacote nas escolhas.\n"
+msgstr " --auto - selecciona automaticamente um pacote nas escolhas.\n"
#: ../urpme:43 ../urpmi:121
#, c-format
-msgid ""
-" --test - verify if the installation can be achieved correctly.\n"
+msgid " --test - verify if the installation can be achieved correctly.\n"
msgstr ""
" --test - verifica se a instalação pode ser conseguida "
"correctamente.\n"
#: ../urpme:44 ../urpmi:94 ../urpmq:63
#, c-format
-msgid ""
-" --force - force invocation even if some packages do not exist.\n"
-msgstr ""
-" --force - força a execução mesmo se alguns pacotes não existirem.\n"
+msgid " --force - force invocation even if some packages do not exist.\n"
+msgstr " --force - força a execução mesmo se alguns pacotes não existirem.\n"
#: ../urpme:45 ../urpmi:99 ../urpmq:64
#, c-format
@@ -923,8 +917,7 @@ msgstr "A efecturar verificação para remover os seguintes pacotes"
#: ../urpme:106
#, c-format
msgid "To satisfy dependencies, the following packages will be removed (%d MB)"
-msgstr ""
-"Para resolver as dependências, os seguintes pacotes serão apagados (%d MB)"
+msgstr "Para resolver as dependências, os seguintes pacotes serão apagados (%d MB)"
#: ../urpme:108 ../urpmi:488 ../urpmi:653
#, c-format
@@ -965,19 +958,16 @@ msgstr " --update - usa apenas a média de actualização.\n"
#: ../urpmf:34 ../urpmi:76 ../urpmq:45
#, c-format
msgid " --media - use only the given media, separated by comma.\n"
-msgstr ""
-" --media - usa apenas as médias indicadas, separadas por vírgulas.\n"
+msgstr " --media - usa apenas as médias indicadas, separadas por vírgulas.\n"
#: ../urpmf:35 ../urpmi:77 ../urpmq:46
#, c-format
msgid " --excludemedia - do not use the given media, separated by comma.\n"
-msgstr ""
-" --excludemedia - não usa as média indicadas, separadas por vírgulas.\n"
+msgstr " --excludemedia - não usa as média indicadas, separadas por vírgulas.\n"
#: ../urpmf:36 ../urpmi:78 ../urpmq:47
#, c-format
-msgid ""
-" --sortmedia - sort media according to substrings separated by comma.\n"
+msgid " --sortmedia - sort media according to substrings separated by comma.\n"
msgstr ""
" --sortmedia - organiza as médias de acordo com as substrings separadas "
"por virgulas.\n"
@@ -985,8 +975,7 @@ msgstr ""
#: ../urpmf:37 ../urpmq:48
#, c-format
msgid " --synthesis - use the synthesis given instead of urpmi db.\n"
-msgstr ""
-" --synthesis - usa a síntese indicada em vez da base dados urpmi.\n"
+msgstr " --synthesis - usa a síntese indicada em vez da base dados urpmi.\n"
#: ../urpmf:38
#, c-format
@@ -1075,8 +1064,7 @@ msgstr " --provides - mostra o que a marca fornece: tudo fornecido.\n"
#: ../urpmf:54
#, c-format
msgid " --requires - print tag requires: all requires.\n"
-msgstr ""
-" --requires - mostra os requeridos da marca: todos os requeridos.\n"
+msgstr " --requires - mostra os requeridos da marca: todos os requeridos.\n"
#: ../urpmf:55
#, c-format
@@ -1091,8 +1079,7 @@ msgstr " --conflicts - mostra os conflitos da marca: todos os conflitos.\n"
#: ../urpmf:57
#, c-format
msgid " --obsoletes - print tag obsoletes: all obsoletes.\n"
-msgstr ""
-" --obsoletes - mostra os absoletos da marca: todos os absoletos.\n"
+msgstr " --obsoletes - mostra os absoletos da marca: todos os absoletos.\n"
#: ../urpmf:58 ../urpmi:114 ../urpmq:73
#, c-format
@@ -1106,14 +1093,12 @@ msgstr ""
#: ../urpmf:60
#, c-format
msgid " -i - ignore case distinctions in every pattern.\n"
-msgstr ""
-" -i - ignora a diferenças de capitalização em todos os padrões.\n"
+msgstr " -i - ignora a diferenças de capitalização em todos os padrões.\n"
#: ../urpmf:61 ../urpmq:79
#, c-format
msgid " -f - print version, release and arch with name.\n"
-msgstr ""
-" -f - mostra a versão, a saida e a arquitectura com o nome.\n"
+msgstr " -f - mostra a versão, a saida e a arquitectura com o nome.\n"
#: ../urpmf:62
#, c-format
@@ -1122,16 +1107,14 @@ msgstr " -e - inclui o código perl directamente como perl -e.\n"
#: ../urpmf:63
#, c-format
-msgid ""
-" -a - binary AND operator, true if both expression are true.\n"
+msgid " -a - binary AND operator, true if both expression are true.\n"
msgstr ""
" -a - operador binário AND, verdadeiro se as duas expressões "
"são verdadeiras.\n"
#: ../urpmf:64
#, c-format
-msgid ""
-" -o - binary OR operator, true if one expression is true.\n"
+msgid " -o - binary OR operator, true if one expression is true.\n"
msgstr ""
" -o - operador binário OR, verdadeiro se uma expressão é "
"verdadeira.\n"
@@ -1139,20 +1122,17 @@ msgstr ""
#: ../urpmf:65
#, c-format
msgid " ! - unary NOT, true if expression is false.\n"
-msgstr ""
-" ! - operador unário NOT, verdadeiro se a expressão é falsa.\n"
+msgstr " ! - operador unário NOT, verdadeiro se a expressão é falsa.\n"
#: ../urpmf:66
#, c-format
msgid " ( - left parenthesis to open group expression.\n"
-msgstr ""
-" ( - parêntesis esquerdo para abrir um grupo de expressões.\n"
+msgstr " ( - parêntesis esquerdo para abrir um grupo de expressões.\n"
#: ../urpmf:67
#, c-format
msgid " ) - right parenthesis to close group expression.\n"
-msgstr ""
-" ) - parêntesis direito para fechar um grupo de expressões.\n"
+msgstr " ) - parêntesis direito para fechar um grupo de expressões. # lists of existing hosts by pinging the broadcast addresses for existing # hosts and then scanning only them, which is much faster) my @hostips = getIPsInLocalNetworks(); return () if $#hostips < 0; my $hostlist = join " ", @hostips; # Scan network for printers, the timeout settings are there to avoid # delays caused by machines blocking their ports with a firewall local *F; open F, ($::testing ? "" : "chroot $::prefix/ ") . "/bin/sh -c \"export LC_ALL=C; nmap -r -P0 --host_timeout 400 --initial_rtt_timeout 200 -p $portlist $hostlist\" |" or return @res; my ($host, $ip, $port, $modelinfo) = ("", "", "", ""); while (my $line = <F>) { chomp $line; # head line of the report of a host with the ports in question open #if ($line =~ m/^\s*Interesting\s+ports\s+on\s+(\S*)\s*\(([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\)\s*:\s*$/i) { if ($line =~ m/^\s*Interesting\s+ports\s+on\s+(\S*)\s*\((\S+)\)\s*:\s*$/i) { ($host, $ip) = ($1, $2); $host = $ip if $host eq ""; $port = ""; undef $modelinfo; } elsif ($line =~ m/^\s*(\d+)\/\S+\s+open\s+/i) { next if $ip eq ""; $port = $1; # Now we have all info for one printer # Store this auto-detection result in the data structure # Determine the protocol by the port number # SMB/Windows if ($port eq "139") { my @shares = getSMBPrinterShares($ip); foreach my $share (@shares) { push @res, { port => "smb://$host/$share->{name}", val => { CLASS => 'PRINTER', MODEL => N("Unknown Model"), MANUFACTURER => "", DESCRIPTION => $share->{description}, SERIALNUMBER => "" } }; } } else { if (!defined($modelinfo)) { # SNMP request to auto-detect model $modelinfo = getSNMPModel($ip); } if (defined($modelinfo)) { push @res, { port => "socket://$host:$port", val => $modelinfo }; } } } } close F; @res; } sub getIPsInLocalNetworks { # subroutine determines the list of all hosts reachable in the local # networks by means of pinging the broadcast addresses. # Return an empty list if no network is running return () unless network_running(); # Read the output of "ifconfig" to determine the broadcast addresses of # the local networks my $dev_is_localnet = 0; my @local_bcasts; my $current_bcast = ""; local *IFCONFIG_OUT; open IFCONFIG_OUT, ($::testing ? "" : "chroot $::prefix/ ") . "/bin/sh -c \"export LC_ALL=C; ifconfig\" |" or return (); while (my $readline = <IFCONFIG_OUT>) { # New entry ... if ($readline =~ /^(\S+)\s/) { my $dev = $1; # ... for a local network (eth = ethernet, # vmnet = VMWare, # ethernet card connected to ISP excluded)? $dev_is_localnet = $dev =~ /^eth/ || $dev =~ /^vmnet/; # delete previous address $current_bcast = ""; } # Are we in the important line now? if ($readline =~ /\sBcast:([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\s/) { # Rip out the broadcast IP address $current_bcast = $1; # Are we in an entry for a local network? if ($dev_is_localnet == 1) { # Store current IP address push @local_bcasts, $current_bcast; } } } close(IFCONFIG_OUT); my @addresses; # Now ping all broadcast addresses and additionally "nmblookup" the # networks (to find Windows servers which do not answer to ping) foreach my $bcast (@local_bcasts) { local *F; open F, ($::testing ? "" : "chroot $::prefix/ ") . "/bin/sh -c \"export LC_ALL=C; ping -w 1 -b -n $bcast | cut -f 4 -d ' ' | sed s/:// | egrep '^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+' | uniq | sort\" |" or next; local $_; while (<F>) { chomp; push @addresses, $_ } close F; if (-x "/usr/bin/nmblookup") { local *F; open F, ($::testing ? "" : "chroot $::prefix/ ") . "/bin/sh -c \"export LC_ALL=C; nmblookup -B $bcast \\* | cut -f 1 -d ' ' | egrep '^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+' | uniq | sort\" |" or next; local $_; while (<F>) { chomp; push @addresses, $_ if !(member($_,@addresses)); } } } @addresses; } sub getSMBPrinterShares { my ($host) = @_; # SMB request to auto-detect shares local *F; open F, ($::testing ? "" : "chroot $::prefix/ ") . "/bin/sh -c \"export LC_ALL=C; smbclient -N -L $host\" |" or return (); my $insharelist = 0; my @shares; while (my $l = <F>) { chomp $l; if ($l =~ /^\s*Sharename\s+Type\s+Comment\s*$/i) { $insharelist = 1; } elsif ($l =~ /^\s*Server\s+Comment\s*$/i) { $insharelist = 0; } elsif ($l =~ /^\s*(\S+)\s+Printer\s*(.*)$/i && $insharelist) { my $name = $1; my $description = $2; $description =~ s/^(\s*)//; push @shares, { name => $name, description => $description }; } } close F; return @shares; } sub getSNMPModel { my ($host) = @_; my $manufacturer = ""; my $model = ""; my $description = ""; my $serialnumber = ""; # SNMP request to auto-detect model local *F; open F, ($::testing ? $::prefix : "chroot $::prefix/ ") . "/bin/sh -c \"scli -1 -c 'show printer info' $host\" |" or return { CLASS => 'PRINTER', MODEL => N("Unknown Model"), MANUFACTURER => "", DESCRIPTION => "", SERIALNUMBER => "" }; while (my $l = <F>) { chomp $l; if ($l =~ /^\s*Manufacturer:\s*(\S.*)$/i && $l =~ /^\s*Vendor:\s*(\S.*)$/i) { $manufacturer = $1; $manufacturer =~ s/Hewlett[-\s_]Packard/HP/; $manufacturer =~ s/HEWLETT[-\s_]PACKARD/HP/; } elsif ($l =~ /^\s*Model:\s*(\S.*)$/i) { $model = $1; } elsif ($l =~ /^\s*Description:\s*(\S.*)$/i) { $description = $1; $description =~ s/Hewlett[-\s_]Packard/HP/; $description =~ s/HEWLETT[-\s_]PACKARD/HP/; } elsif ($l =~ /^\s*Serial\s*Number:\s*(\S.*)$/i) { $serialnumber = $1; } } close F; # Was there a manufacturer and a model in the output? # If not, get them from the description if ($manufacturer eq "" || $model eq "") { if ($description =~ /^\s*(\S*)\s+(\S.*)$/) { $manufacturer = $1 if $manufacturer eq ""; $model = $2 if $model eq ""; } # No description field? Make one out of manufacturer and model. } elsif ($description eq "") { $description = "$manufacturer $model"; } # We couldn't determine a model $model = N("Unknown Model") if $model eq ""; # Remove trailing spaces $manufacturer =~ s/(\S+)\s+$/$1/; $model =~ s/(\S+)\s+$/$1/; $description =~ s/(\S+)\s+$/$1/; $serialnumber =~ s/(\S+)\s+$/$1/; # Now we have all info for one printer # Store this auto-detection result in the data structure return { CLASS => 'PRINTER', MODEL => $model, MANUFACTURER => $manufacturer, DESCRIPTION => $description, SERIALNUMBER => $serialnumber }; } sub network_running { # If the network is not running return 0, otherwise 1. local *F; open F, ($::testing ? $::prefix : "chroot $::prefix/ ") . "/bin/sh -c \"export LC_ALL=C; /sbin/ifconfig\" |" or die "Could not run \"ifconfig\"!"; while (my $line = <F>) { if ($line !~ /^lo\s+/ && # The loopback device can have been # started by the spooler's startup script $line =~ /^(\S+)\s+/) { # In this line starts an entry for a # running network close F; return 1; } } close F; return 0; } sub parport_addr { # auto-detect the parallel port addresses my ($device) = @_; $device =~ m!^/dev/lp(\d+)$! or $device =~ m!^/dev/printers/(\d+)$!; my $portnumber = $1; my $parport_addresses = `cat /proc/sys/dev/parport/parport$portnumber/base-addr`; my $address_arg; if ($parport_addresses =~ /^\s*(\d+)\s+(\d+)\s*$/) { $address_arg = sprintf(" -base 0x%x -basehigh 0x%x", $1, $2); } elsif ($parport_addresses =~ /^\s*(\d+)\s*$/) { $address_arg = sprintf(" -base 0x%x", $1); } else { $address_arg = ""; } return $address_arg; } 1;