#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgCreate.pm,v 1.184 2022/11/01 17:41:19 espie Exp $
+# $OpenBSD: PkgCreate.pm,v 1.185 2023/01/25 13:25:07 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
my $name = $plist->fullpkgpath;
$name =~ s,/,.,g;
- my $fname = "$dir/$name";
+ my $oldfname = "$dir/$name";
+ my $fname = "$oldfname.lru";
# if we have history, we record the order of checksums
my $known = {};
$known->{$_} //= $.;
}
close($f);
+ } elsif (open(my $f2, '<', $oldfname)) {
+ while (<$f2>) {
+ chomp;
+ $known->{$_} //= $.;
+ }
+ close($f2);
}
my $todo = [];
close($f);
rename($name2, $fname) or
$state->fatal("Can't rename #1->#2: #3", $name2, $fname, $!);
+ unlink($oldfname);
# even with no former history, it's a good idea to save chunks
# for instance: packages like texlive will not change all that
# fast, so there's a good chance the end chunks will be ordered
-.\" $OpenBSD: pkg_create.1,v 1.127 2022/11/09 10:10:53 espie Exp $
+.\" $OpenBSD: pkg_create.1,v 1.128 2023/01/25 13:25:07 espie Exp $
.\"
.\" Documentation and design originally from FreeBSD. All the code has
.\" been rewritten since. We keep the documentation's notice:
.\" [jkh] Took John's changes back and made some additional extensions for
.\" better integration with FreeBSD's new ports collection.
.\"
-.Dd $Mdocdate: November 9 2022 $
+.Dd $Mdocdate: January 25 2023 $
.Dt PKG_CREATE 1
.Os
.Sh NAME
(mandatory).
.It Cm HISTORY_DIR
Record checksums of files in permanent location
-.Pa ${HISTORY_DIR}/${FULLPKGPATH:S,/,./g} .
+.Pa ${HISTORY_DIR}/${FULLPKGPATH:S,/,./g}.lru .
.It Cm FTP
Set to the port's Makefile
.Va PERMIT_PACKAGE_FTP .