better namespace for make-plist internals, prepare to cut up check-lib-depends

This commit is contained in:
espie 2010-08-20 15:22:21 +00:00
parent c61100c7e6
commit 9b38b584e9
5 changed files with 15 additions and 43 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl
# $OpenBSD: check-lib-depends,v 1.1 2010/08/20 13:50:11 espie Exp $
# $OpenBSD: check-lib-depends,v 1.2 2010/08/20 15:22:21 espie Exp $
# Copyright (c) 2004-2010 Marc Espie <espie@openbsd.org>
#
# Permission to use, copy, modify, and distribute this software for any
@ -17,6 +17,11 @@
use strict;
use warnings;
my $ports1;
BEGIN {
$ports1 = $ENV{PORTSDIR} || '/usr/ports';
}
use lib "$ports1/infrastructure/lib";
use File::Spec;
use OpenBSD::PackingList;

View File

@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
# $OpenBSD: dpb,v 1.1 2010/08/20 13:42:29 espie Exp $
# $OpenBSD: dpb,v 1.2 2010/08/20 15:22:21 espie Exp $
#
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
#
@ -23,7 +23,6 @@ my $ports1;
BEGIN {
$ports1 = $ENV{PORTSDIR} || '/usr/ports';
}
$0 = 'dpb';
use lib "$ports1/infrastructure/lib";
use DPB::PkgPath;
use DPB::Core;

View File

@ -1,5 +1,5 @@
#! /usr/bin/perl
# $OpenBSD: make-plist,v 1.1 2010/08/20 13:50:11 espie Exp $
# $OpenBSD: make-plist,v 1.2 2010/08/20 15:22:21 espie Exp $
# Copyright (c) 2004-2008 Marc Espie <espie@openbsd.org>
#
# Permission to use, copy, modify, and distribute this software for any
@ -34,7 +34,7 @@ use OpenBSD::Subst;
use File::Basename;
use File::Compare;
use File::Temp;
use FS;
use OpenBSD::FS;
package OpenBSD::ReverseSubst;
our @ISA = (qw(OpenBSD::Subst));
@ -147,7 +147,7 @@ sub report
print STDERR $i->stringize;
} elsif ($i->isa("OpenBSD::PackingList")) {
print STDERR prettify($i);
} elsif ($i->isa("FS::File")) {
} elsif ($i->isa("OpenBSD::FS::File")) {
print STDERR $i->path;
}
} else {
@ -1015,7 +1015,7 @@ sub scan_for_files
parse_args();
print "Scanning destdir\n";
my $files = FS::get_files($destdir);
my $files = OpenBSD::FS::get_files($destdir);
print "Getting old lists\n";
my @l = grab_all_lists();

View File

@ -1,4 +1,4 @@
# $OpenBSD: FS.pm,v 1.1 2010/08/20 13:50:12 espie Exp $
# $OpenBSD: FS.pm,v 1.1 2010/08/20 15:22:22 espie Exp $
# Copyright (c) 2008 Marc Espie <espie@openbsd.org>
#
# Permission to use, copy, modify, and distribute this software for any
@ -16,7 +16,7 @@
use strict;
use warnings;
package FS::File;
package OpenBSD::FS::File;
sub new
{
@ -45,7 +45,7 @@ sub group
shift->{group};
}
package FS;
package OpenBSD::FS;
my $destdir;
use OpenBSD::Mtree;
@ -283,7 +283,7 @@ sub scan_destdir
my $path = undest($File::Find::name);
my ($uid, $gid) = (lstat $_)[4,5];
$path =~ s,^/etc/X11/app-defaults\b,/usr/local/lib/X11/app-defaults,;
$files{$path} = FS::File->new($path, $type,
$files{$path} = OpenBSD::FS::File->new($path, $type,
$uid_lookup->lookup($uid),
$gid_lookup->lookup($gid));
}, $destdir);

View File

@ -1,32 +0,0 @@
# $OpenBSD: Subpackage.pm,v 1.1 2010/08/20 13:50:12 espie Exp $
# Copyright (c) 2008 Marc Espie <espie@openbsd.org>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
use strict;
use warnings;
package SubPackage;
sub new
{
my ($class, $sub) = @_;
bless {name => $sub}, $class;
}
sub name
{
my $self = shift;
return $self->{name};
}
1;