From: Alexey Tourbin <at@altlinux.ru>
To: devel@lists.altlinux.org
Subject: [devel] /usr/bin/crc32 (was: automated CPAN update: perl summary)
Date: Tue, 20 Jul 2010 19:23:43 +0400
Message-ID: <20100720152343.GX23050@altlinux.org> (raw)
In-Reply-To: <20100717123546.GA21193@dad.imath.kiev.ua>
[-- Attachment #1.1: Type: text/plain, Size: 490 bytes --]
On Sat, Jul 17, 2010 at 03:35:47PM +0300, Igor Vlasenko wrote:
> * cpan2rpm не умеет? паковать скрипты из %_bindir.
> у части пакетов в %_bindir действительно мусор,
> однако в вот этих %_bindir/* зря не упакован.
>
> perl-Module-CoreList corelist
> perl-Net-RBLClient spamalyze
> perl-Archive-Zip crc32
Скрипт crc32 не имеет не документации, ни даже опции --help.
Класть его в /usr/bin (в том числе по этим причинам) неохота.
> Стоило бы паковать, выглядит как баг.
[-- Attachment #1.2: crc32 --]
[-- Type: text/plain, Size: 709 bytes --]
#!/usr/bin/perl
# Computes and prints to stdout the CRC-32 values of the given files
use strict;
use lib qw( blib/lib lib );
use Archive::Zip;
use FileHandle;
my $totalFiles = scalar(@ARGV);
foreach my $file (@ARGV) {
if ( -d $file ) {
warn "$0: ${file}: Is a directory\n";
next;
}
my $fh = FileHandle->new();
if ( !$fh->open( $file, 'r' ) ) {
warn "$0: $!\n";
next;
}
binmode($fh);
my $buffer;
my $bytesRead;
my $crc = 0;
while ( $bytesRead = $fh->read( $buffer, 32768 ) ) {
$crc = Archive::Zip::computeCRC32( $buffer, $crc );
}
printf( "%08x", $crc );
print("\t$file") if ( $totalFiles > 1 );
print("\n");
}
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2010-07-20 15:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-17 12:35 [devel] automated CPAN update: perl summary Igor Vlasenko
2010-07-17 18:19 ` Sergey Y. Afonin
2010-07-20 15:23 ` Alexey Tourbin [this message]
2010-07-21 17:11 ` [devel] /usr/bin/crc32 (was: automated CPAN update: perl summary) Igor Vlasenko
2010-07-21 17:53 ` [devel] /usr/bin/crc32 Dmitry V. Levin
2010-07-21 18:24 ` Igor Vlasenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100720152343.GX23050@altlinux.org \
--to=at@altlinux.ru \
--cc=devel@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git