2 ################################################################################
4 # File: $RCSfile: domains,v $
5 # Revision: $Revision: 1.1 $
6 # Description: Display entries from the list table where there is at least one
7 # entry with a null pattern (nuke the domain) and yet still other
8 # entries with the same domain name but having a pattern. We may
9 # want to eliminate the other entries since we're nuking the
10 # whole domain anyway.
11 # Author: Andrew@DeFaria.com
12 # Created: Sat Oct 20 23:28:19 MST 2007
13 # Modified: $Date: 2013/06/12 14:05:47 $
16 # (c) Copyright 2007, Andrew@DeFaria.com, all rights reserved.
18 ################################################################################
25 use lib "$FindBin::Bin/../lib", '/opt/clearscm/lib';
32 $FindBin::Script { -verbose } { -debug } { -usage }
39 "verbose" => sub { set_verbose },
40 "debug" => sub { set_debug },
41 "usage" => sub { Usage },
44 my $userid = $ENV{MAPS_USERNAME} ? $ENV{MAPS_USERNAME} : $ENV{USER};
49 my $statement = "select domain from list where userid=\"$userid\" and type=\"null\" and pattern is null";
51 my $need_resequence = 0;
53 for my $domain (sort (GetRows($statement))) {
54 verbose "Processing domain $domain";
55 $statement = "select sequence from list where userid = \"$userid\" and domain = \"$domain\" and type = \"null\" and pattern is not null";
57 for my $sequence (GetRows $statement) {
58 display "Deleting $domain ($sequence)";
60 DeleteList "null", $sequence;
64 if ($need_resequence) {
65 verbose "Resequencing null list...";
66 ResequenceList $userid, "null";