summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-12-03 17:27:25 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-12-03 17:27:25 (GMT)
commit4c180691b640ae416239f1bcd375ea513cf5d50b (patch)
tree8a11716b78358e5bdb976db99293f91f30dd0690
parentcb42bb3574fab1e761c6562c60ee3b5e3c8af09d (diff)
some cleanup
-rwxr-xr-xutils/rhrd-pool4
-rwxr-xr-xutils/rhrd-sanity-check12
-rwxr-xr-xutils/rhrd-schedules10
-rwxr-xr-xutils/rhrd-show8
-rwxr-xr-xutils/rhrd-user4
5 files changed, 19 insertions, 19 deletions
diff --git a/utils/rhrd-pool b/utils/rhrd-pool
index ada9b6f..7035902 100755
--- a/utils/rhrd-pool
+++ b/utils/rhrd-pool
@@ -181,7 +181,7 @@ sub remove
{
my ($ctx, $shortname, $force) = @_;
- if(defined($force) && $force ne "--force") {
+ if(defined $force && $force ne "--force") {
print_usage();
return 1;
}
@@ -213,7 +213,7 @@ sub clear
{
my ($ctx, $shortname, $force) = @_;
- if(defined($force) && $force ne "--force") {
+ if(defined $force && $force ne "--force") {
print_usage();
return 1;
}
diff --git a/utils/rhrd-sanity-check b/utils/rhrd-sanity-check
index 9507f6b..8faec2e 100755
--- a/utils/rhrd-sanity-check
+++ b/utils/rhrd-sanity-check
@@ -61,7 +61,7 @@ sub check_showids
}
my ($group, $status, $errorstring) = RHRD::rddb::get_show_group($ctx, $showid);
- unless(defined($group)) {
+ unless(defined $group) {
print " showid '" . $showid . "': has no dropbox assigned\n";
$errors++;
} else {
@@ -88,7 +88,7 @@ sub check_logs
}
for my $log (@logs) {
my ($log_exists, $status, $errorstring) = RHRD::rddb::check_log_exists($ctx, $log);
- if(!defined $log_exists) {
+ unless(defined $log_exists) {
print STDERR "$status: $errorstring";
return -1;
}
@@ -98,7 +98,7 @@ sub check_logs
}
(my $log_tab_exists, $status, $errorstring) = RHRD::rddb::check_log_table_exists($ctx, $log);
- if(!defined $log_tab_exists) {
+ unless(defined $log_tab_exists) {
print STDERR "$status: $errorstring";
return -1;
}
@@ -247,19 +247,19 @@ sub check_groups
print "groups:\n";
my ($shows_low_cart, $shows_high_cart, $shows_chunk_size) = RHRD::rddb::get_shows_cart_range($ctx);
- if(!$shows_low_cart) {
+ unless(defined $shows_low_cart) {
print "$shows_high_cart: $shows_chunk_size\n";
return -1;
}
my ($musicpools_low_cart, $musicpools_high_cart, $musicpools_chunk_size) = RHRD::rddb::get_musicpools_cart_range($ctx);
- if(!$musicpools_low_cart) {
+ unless(defined $musicpools_low_cart) {
print "$musicpools_high_cart: $musicpools_chunk_size\n";
return -1;
}
my ($jingles_low_cart, $jingles_high_cart, $jingles_chunk_size) = RHRD::rddb::get_jingles_cart_range($ctx);
- if(!$jingles_low_cart) {
+ unless(defined $jingles_low_cart) {
print "$jingles_high_cart: $jingles_chunk_size\n";
return -1;
}
diff --git a/utils/rhrd-schedules b/utils/rhrd-schedules
index 8f1c2fe..39546b0 100755
--- a/utils/rhrd-schedules
+++ b/utils/rhrd-schedules
@@ -143,7 +143,7 @@ sub show__day_entry
## TODO: handle `$show{'TYPE'}` (regular, re-run, and special)
my ($show, $status, $errorstring) = RHRD::rddb::get_show_info($ctx, $showid);
- if(!defined $show) {
+ unless(defined $show) {
print "$status: $errorstring\n";
return 1;
}
@@ -222,7 +222,7 @@ sub show__day
$errcnt += show__day_entry($ctx, $week, $dow, $duration, $start_short, $pvid, $showid, $title);
} elsif ($showid >= $mshowid_min && $showid <= $showid_max) {
my ($show, $status, $errorstring) = RHRD::rddb::get_multi_show_info($ctx, $showid);
- unless (defined $show) {
+ unless(defined $show) {
print "($showid) -> $status: $errorstring\n";
$errcnt++;
} else {
@@ -261,7 +261,7 @@ sub parse_rdweek
return (1, 2, 3, 4);
}
my ($w, undef, $hint) = RHRD::utils::cmdline_rdweek($week);
- unless(defined($w)) {
+ unless(defined $w) {
print "error parsing week: $week, " . $hint . " or ALL\n";
return ();
}
@@ -276,7 +276,7 @@ sub parse_dow
return (1, 2, 3, 4, 5, 6, 7);
}
my ($d, undef, $hint) = RHRD::utils::cmdline_dow($dow);
- unless(defined($d)) {
+ unless(defined $d) {
print "error parsing day of week: $dow, " . $hint . " or ALL\n";
return ();
}
@@ -437,7 +437,7 @@ sub orphans
if($shows{$showid} == 0) {
my ($show, $status, $errorstring) = RHRD::rddb::get_show_info($ctx, $showid);
- if(!defined $show) {
+ unless(defined $show) {
print "$status: $errorstring\n";
} elsif(${$show}{'TYPE'} ne 's') {
print "$showid: " . ${$show}{'TITLE'} . "\n";
diff --git a/utils/rhrd-show b/utils/rhrd-show
index daa3060..88f29ce 100755
--- a/utils/rhrd-show
+++ b/utils/rhrd-show
@@ -89,7 +89,7 @@ sub show
return 1;
}
my ($show, $status, $errorstring) = RHRD::rddb::get_show_info($ctx, $showid);
- unless (defined $show) {
+ unless(defined $show) {
print STDERR "$errorstring\n";
return 1;
}
@@ -418,7 +418,7 @@ sub multi_add
print " * creating multi-show: " . $title . "\n";
my $showref = multi__parse_shows($ctx, @_);
- unless(defined($showref)) {
+ unless(defined $showref) {
return 1;
}
my %shows = %{$showref};
@@ -450,7 +450,7 @@ sub multi_edit
print " * updating multi-show: " . $showid . "\n";
my $showref = multi__parse_shows($ctx, @_);
- unless(defined($showref)) {
+ unless(defined $showref) {
return 1;
}
my %shows = %{$showref};
@@ -470,7 +470,7 @@ sub multi_show
my ($ctx, $showid) = @_;
my ($show, $status, $errorstring) = RHRD::rddb::get_multi_show_info($ctx, $showid);
- unless (defined $show) {
+ unless(defined $show) {
print STDERR "$errorstring\n";
return 1;
}
diff --git a/utils/rhrd-user b/utils/rhrd-user
index 8aeacc9..4d613b6 100755
--- a/utils/rhrd-user
+++ b/utils/rhrd-user
@@ -105,7 +105,7 @@ sub is_grids
my ($ctx, $username) = @_;
my ($authorized, $status, $errorstring) = RHRD::rddb::is_musicgrid_user($ctx, $username);
- if(!defined $authorized) {
+ unless(defined $authorized) {
print STDERR "$status: $errorstring\n";
return 1;
}
@@ -117,7 +117,7 @@ sub set_grids
{
my ($ctx, $username, $value) = @_;
- unless(defined($value) && ($value == '0' || $value == '1')) {
+ unless(defined $value && ($value == '0' || $value == '1')) {
print_usage();
return 1;
}