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, '/opt/clearscm/lib';
34 $FindBin::Script { -verbose } { -debug } { -usage }
41 "verbose" => sub { set_verbose },
42 "debug" => sub { set_debug },
43 "usage" => sub { Usage },
46 my $userid = $ENV{MAPS_USERNAME} ? $ENV{MAPS_USERNAME} : $ENV{USER};
51 my $statement = "select domain from list where userid=\"$userid\" and type=\"null\" and pattern is null";
53 my $need_requence = 0;
55 foreach my $domain (sort (&MAPSDB::GetRows ($statement))) {
56 verbose "Processing domain $domain";
57 $statement = "select sequence from list where userid = \"$userid\" and domain = \"$domain\" and type = \"null\" and pattern is not null";
59 foreach my $sequence (MAPSDB::GetRows $statement) {
60 display "Deleting $domain ($sequence)";
62 DeleteList "null", $sequence;
67 verbose "Resequencing null list...";
68 ResequenceList $userid, "null";