use new interface to Locator

This commit is contained in:
espie 2005-09-13 20:48:41 +00:00
parent 35eec0722f
commit 388edd407a
3 changed files with 26 additions and 20 deletions

View File

@ -1,5 +1,5 @@
#! /usr/bin/perl
# $OpenBSD: check-manpages,v 1.4 2004/11/13 11:49:48 espie Exp $
# $OpenBSD: check-manpages,v 1.5 2005/09/13 20:48:41 espie Exp $
#
# Copyright (c) 2004 Marc Espie <espie@openbsd.org>
#
@ -56,6 +56,8 @@ for my $pkgname (@ARGV) {
}
}
$true_package->close();
$true_package->wipe_info();
$plist->forget();
}
print STDERR "Running makewhatis in ", join(' ', keys(%mandirs)), "\n";

View File

@ -1,6 +1,6 @@
#!/usr/bin/perl
# $OpenBSD: check-newlib-depends,v 1.10 2005/09/10 09:48:54 espie Exp $
# $OpenBSD: check-newlib-depends,v 1.11 2005/09/13 20:48:41 espie Exp $
# Copyright (c) 2004 Marc Espie <espie@openbsd.org>
#
# Permission to use, copy, modify, and distribute this software for any
@ -254,7 +254,7 @@ sub do_pkg
my $plist = OpenBSD::PackingList->fromfile($dir.CONTENTS);
analyze($plist, $db, $true_package);
$true_package->close();
rmtree($dir);
$true_package->wipe_info();
$plist->forget();
return 1;
}

View File

@ -1,6 +1,6 @@
#! /usr/bin/perl
# $OpenBSD: find-plist-issues,v 1.2 2005/09/05 14:39:57 espie Exp $
# $OpenBSD: find-plist-issues,v 1.3 2005/09/13 20:48:41 espie Exp $
# Copyright (c) 2000-2005
# Marc Espie. All rights reserved.
# Redistribution and use in source and binary forms, with or without
@ -302,16 +302,10 @@ my $db = {};
my $mtree = {};
our ($opt_d, $opt_v, $opt_C, $opt_D);
sub handle_file
sub handle_plist
{
my $filename = shift;
my $plist = OpenBSD::PackingList->fromfile($filename);
if (!defined $plist) {
print STDERR "Error reading $filename\n";
return;
}
print "$filename -> ", $plist->pkgname(), "\n" if $opt_v;
my $plist = shift;
print $plist->pkgname(), "\n" if $opt_v;
$plist->forget();
if ($opt_C) {
$conflicts->{$plist->pkgname()} =
@ -323,6 +317,18 @@ sub handle_file
}
}
sub handle_file
{
my $filename = shift;
my $plist = OpenBSD::PackingList->fromfile($filename);
if (!defined $plist) {
print STDERR "Error reading $filename\n";
return;
}
handle_plist($plist);
}
set_usage('find-all-conflicts [-vCD] [-d plist_dir] [pkgname ...]');
try {
getopts('d:vCD');
@ -360,16 +366,14 @@ if ($opt_d) {
@ARGV=(<*.tgz>);
}
push(@available, map { s,.*/,,; s/\.tgz$//; } @ARGV);
my @pkgs = @ARGV;
push(@available, map { s,.*/,,; s/\.tgz$//; } @pkgs);
for my $pkgname (@ARGV) {
print STDERR "$pkgname\n";
my $true_package = OpenBSD::PackageLocator->find($pkgname);
next unless $true_package;
my $dir = $true_package->info();
$true_package->close();
handle_file($dir.CONTENTS);
rmtree($dir);
my $plist = OpenBSD::PackageLocator->grabPlist($pkgname);
next unless $plist;
handle_plist($plist);
}
print "File problems:\n";