mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 06:01:15 +00:00
18 lines
393 B
Perl
18 lines
393 B
Perl
|
use strict;
|
||
|
|
||
|
# Make inode number, link info and mtime consistent in order to get a consistent hash.
|
||
|
#
|
||
|
# Author: Alexander Kjeldaas <ak@formalprivacy.com>
|
||
|
|
||
|
use Archive::Cpio;
|
||
|
|
||
|
my $cpio = Archive::Cpio->new;
|
||
|
my $IN = \*STDIN;
|
||
|
my $ino = 1;
|
||
|
$cpio->read_with_handler($IN, sub {
|
||
|
my ($e) = @_;
|
||
|
$e->{mtime} = 1;
|
||
|
$cpio->write_one(\*STDOUT, $e);
|
||
|
});
|
||
|
$cpio->write_trailer(\*STDOUT);
|