diff options
author | Christian Pointner <equinox@spreadspace.org> | 2015-10-09 17:03:10 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2015-10-09 17:03:10 (GMT) |
commit | c6c891b3921dce1cb3575e67a6f45f0fb24f722d (patch) | |
tree | a2f747eea6c2f51ceea679a93c2f3740aefa2ff7 /utils | |
parent | 91a5a9072f82cef110535917a4601f14ddd9fa31 (diff) |
improved show deletion
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/rhrd-sanity-check | 1 | ||||
-rwxr-xr-x | utils/rhrd-show | 18 |
2 files changed, 18 insertions, 1 deletions
diff --git a/utils/rhrd-sanity-check b/utils/rhrd-sanity-check index 93d933e..6cfb2d7 100755 --- a/utils/rhrd-sanity-check +++ b/utils/rhrd-sanity-check @@ -79,6 +79,7 @@ sub check_groups__check_show_group } if(scalar @carts == 0) { print " group '" . $group . "': carts are not used by any show\n"; + $errors++; } my ($nownext, $traffic, $music) = RHRD::rddb::get_group_reports($ctx, $group); diff --git a/utils/rhrd-show b/utils/rhrd-show index 7cb8422..f2a6aed 100755 --- a/utils/rhrd-show +++ b/utils/rhrd-show @@ -181,14 +181,30 @@ sub remove { my ($ctx, $show_id) = @_; + my ($group, $status, $errorstring) = RHRD::rddb::get_show_group($ctx, $show_id); + unless(defined $group) { + print STDERR $status . ": " . $errorstring . "\n"; + return 1; + } + my @results = RHRD::rddb::remove_show($ctx, $show_id); if(!defined $results[0] && defined $results[2]) { - print STDERR "$results[2]\n"; + print STDERR $results[1] . ": " . $results[2] . "\n"; return 1; } for my $href (@results) { print int($href->{cnt}) . " " . $href->{name} . " deleted\n"; } + + my @carts = RHRD::rddb::get_show_group_carts_used($ctx, $group); + if(!defined $carts[0] && defined $carts[1]) { + print STDERR $carts[1] . ": " . $carts[2] . "\n"; + return 1; + } + if(scalar @carts == 0) { + print "group '" . $group . "' is now empty .. you should probably remove it!\n"; + } + return 0; } |