aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorMathieu Arnold <mat@FreeBSD.org>2004-05-04 15:33:14 +0000
committerMathieu Arnold <mat@FreeBSD.org>2004-05-04 15:33:14 +0000
commit3dc797a22f41bd1c3d2175606801f5e0f73ca928 (patch)
tree316fdbcbf679919831838fab2c481db38755e624 /sysutils
parenta7dff1b52abe4e799560a47bed1e122568f4888f (diff)
downloadports-3dc797a22f41bd1c3d2175606801f5e0f73ca928.tar.gz
ports-3dc797a22f41bd1c3d2175606801f5e0f73ca928.zip
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/pkg_cutleaves/Makefile2
-rw-r--r--sysutils/pkg_cutleaves/src/pkg_cutleaves50
2 files changed, 34 insertions, 18 deletions
diff --git a/sysutils/pkg_cutleaves/Makefile b/sysutils/pkg_cutleaves/Makefile
index 2dd7c0e51378..efef10c6f367 100644
--- a/sysutils/pkg_cutleaves/Makefile
+++ b/sysutils/pkg_cutleaves/Makefile
@@ -8,7 +8,7 @@
#
PORTNAME= pkg_cutleaves
-PORTVERSION= 20040207
+PORTVERSION= 20040414
CATEGORIES= sysutils
MASTER_SITES= # none
DISTFILES= # none
diff --git a/sysutils/pkg_cutleaves/src/pkg_cutleaves b/sysutils/pkg_cutleaves/src/pkg_cutleaves
index 8c3507a06eee..d27b8116489f 100644
--- a/sysutils/pkg_cutleaves/src/pkg_cutleaves
+++ b/sysutils/pkg_cutleaves/src/pkg_cutleaves
@@ -64,6 +64,8 @@ sub get_excl_pattern {
chomp($exclude);
# Ignore comments and empty lines, add others as regular expressions
unless (($exclude =~ m/(^ *#)|(^ *$)/)) {
+ # Escape any '+' that isn't already escaped
+ $exclude =~ s/(?<!\\)(\+|\.)/\\$1/g;
$exclude = "^" . $exclude . ".*";
push @excludes, $exclude;
}
@@ -156,28 +158,26 @@ if ($opt_listonly) {
}
}
} else {
+ my %leaves;
my %leavestokeep;
my %leavestocut;
my @cutleaves;
- my ($nleaves, $i);
+ my ($nleaves, $i, $again);
+
+ # Get list of leaf packages and put them into a hash
+ %leaves = get_leaves($dbdir, $exclpattern);
+ # Any leaves to work with?
+ $nleaves = keys %leaves;
+ if ($nleaves > 0) {
+ $again = "y";
+ } else {
+ # If not, don't go on, there's nothing to do.
+ print "** Didn't find any leaves to work with, exiting.\n";
+ print "** If this is unexpected, check your exclude file, please.\n";
+ $again = "n";
+ }
# Loop while the user wants to
- my $again = "y";
ROUND: while($again eq "y") {
- # Get list of leaf packages and put them into a hash
- my %leaves = get_leaves($dbdir, $exclpattern);
- # Ignore all leaves the user already told us to keep
- foreach my $leaf (keys %leavestokeep) {
- if ($leaves{$leaf}) {
- delete $leaves{$leaf};
- }
- }
- # Any leaves left?
- $nleaves = keys %leaves;
- if ($nleaves == 0) {
- # If not, don't go on, there's nothing left to do.
- print "Didn't find any new leaves, exiting.\n";
- last ROUND;
- }
# Always start with an empty list of leaves to cut
%leavestocut = ();
# Initialize counter for progress status
@@ -237,6 +237,22 @@ if ($opt_listonly) {
}
}
+ # Get new list of leaf packages and put them into a hash
+ %leaves = get_leaves($dbdir, $exclpattern);
+ # Ignore all leaves the user already told us to keep
+ foreach my $leaf (keys %leavestokeep) {
+ if ($leaves{$leaf}) {
+ delete $leaves{$leaf};
+ }
+ }
+ # Any leaves left?
+ $nleaves = keys %leaves;
+ if ($nleaves == 0) {
+ # If not, don't go on, there's nothing left to do.
+ print "** Didn't find any new leaves to work with, exiting.\n";
+ last ROUND;
+ }
+
print "Go on with new leaf packages ((y)es/[no])? ";
# Get first character of input, without leading whitespace
($again) = (lc(<STDIN>) =~ m/(\S)/);