File: make_qupak

package info (click to toggle)
hxtools 20251011-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,468 kB
  • sloc: ansic: 4,384; perl: 3,467; sh: 1,664; cpp: 353; makefile: 90
file content (20 lines) | stat: -rwxr-xr-x 457 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl
# SPDX-License-Identifier: MIT
use Getopt::Long;
use strict;
use warnings;
my $strip;
&Getopt::Long::Configure(qw(bundling));
&GetOptions("strip=s" => \$strip);
$strip += 0;
my $dsize = scalar(@ARGV) * 64;
my $ofs = 12 + $dsize;
print "PACK", pack("VV", 12, $dsize);
for (@ARGV) {
	my $n = $_;
	$n =~ s{^/}{};
	for (my $i = 0; $i < $strip && $n =~ s{^[^/]+/}{}; ++$i) {}
	print pack("Z56VV", $n, $ofs, -s $_);
	$ofs += -s _;
}
print for <>;