strip PORTSDIR from DESCR/README
This commit is contained in:
parent
0272dfee2a
commit
90bdea8e41
@ -1,7 +1,7 @@
|
||||
# $OpenBSD: Makefile,v 1.72 2018/09/04 12:41:51 espie Exp $
|
||||
# $OpenBSD: Makefile,v 1.73 2018/11/10 16:41:03 espie Exp $
|
||||
|
||||
CATEGORIES = databases
|
||||
V = 6.8
|
||||
V = 6.9
|
||||
DISTNAME = sqlports-$V
|
||||
DISTFILES =
|
||||
COMMENT = sqlite database of ports
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Var.pm,v 1.26 2018/05/26 14:20:43 espie Exp $
|
||||
# $OpenBSD: Var.pm,v 1.27 2018/11/10 16:41:03 espie Exp $
|
||||
#
|
||||
# Copyright (c) 2006-2010 Marc Espie <espie@openbsd.org>
|
||||
#
|
||||
@ -646,6 +646,8 @@ our @ISA = qw(FileVar);
|
||||
sub table() { 'Descr' }
|
||||
use File::Basename;
|
||||
|
||||
my $portsdir = $ENV{PORTSDIR} || '/usr/ports';
|
||||
|
||||
# README does not exist as an actual variable, but it's trivial
|
||||
# to add it as a subsidiary of DESCR when the file exists.
|
||||
|
||||
@ -659,9 +661,11 @@ sub new
|
||||
$readme .= $multi;
|
||||
}
|
||||
if (-e $readme) {
|
||||
$readme =~ s,^\Q$portsdir\E/,,;
|
||||
$path->{info}->create('README', $readme, $arch, $path);
|
||||
}
|
||||
|
||||
$value =~ s,^\Q$portsdir\E/,,;
|
||||
return $class->SUPER::new($var, $value, $arch, $path);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user