Refactor Perlcritic advices
This commit is contained in:
@@ -30,6 +30,7 @@ sub saywarning
|
|||||||
my $msg = shift;
|
my $msg = shift;
|
||||||
say STDERR "WARNING: $msg";
|
say STDERR "WARNING: $msg";
|
||||||
syslog( LOG_WARNING, "$msg" );
|
syslog( LOG_WARNING, "$msg" );
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# display a message only if verbose flag is used
|
# display a message only if verbose flag is used
|
||||||
@@ -38,6 +39,7 @@ sub saydebug
|
|||||||
my $msg = shift;
|
my $msg = shift;
|
||||||
say STDERR "DEBUG: $msg" if $verbose;
|
say STDERR "DEBUG: $msg" if $verbose;
|
||||||
syslog( LOG_INFO, "$msg" );
|
syslog( LOG_INFO, "$msg" );
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# display a message before exiting with status 2
|
# display a message before exiting with status 2
|
||||||
@@ -175,6 +177,7 @@ sub mount_mfs
|
|||||||
} else {
|
} else {
|
||||||
saydebug("mount_mfs done on $impermanence_home");
|
saydebug("mount_mfs done on $impermanence_home");
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Linux: mount the destination with a ramdisk only if not currently mounted
|
# Linux: mount the destination with a ramdisk only if not currently mounted
|
||||||
@@ -192,6 +195,7 @@ sub mount_tmpfs
|
|||||||
} else {
|
} else {
|
||||||
saydebug("tmpfs done on $impermanence_home");
|
saydebug("tmpfs done on $impermanence_home");
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# create the symbolic links listed in the yml file into the ramdisk destination
|
# create the symbolic links listed in the yml file into the ramdisk destination
|
||||||
@@ -232,6 +236,7 @@ sub create_skeleton
|
|||||||
saydebug("Create directory $dir");
|
saydebug("Create directory $dir");
|
||||||
make_path( $dir, { chmod => 0750, owner => $user } );
|
make_path( $dir, { chmod => 0750, owner => $user } );
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub call_chezmoi
|
sub call_chezmoi
|
||||||
@@ -243,6 +248,7 @@ sub call_chezmoi
|
|||||||
} else {
|
} else {
|
||||||
saydebug("chezmoi finished successfully");
|
saydebug("chezmoi finished successfully");
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub get_uid
|
sub get_uid
|
||||||
@@ -256,6 +262,7 @@ sub get_uid
|
|||||||
} else {
|
} else {
|
||||||
trap_error("ERROR: userinfo did not return uid");
|
trap_error("ERROR: userinfo did not return uid");
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub main
|
sub main
|
||||||
@@ -362,7 +369,7 @@ sub main
|
|||||||
populate_ramdisk( $data, $persist_home, $impermanence_home, $opts{u} );
|
populate_ramdisk( $data, $persist_home, $impermanence_home, $opts{u} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
openlog( "impermanence", 'ndelay', LOG_DAEMON );
|
openlog( "impermanence", 'ndelay', LOG_DAEMON );
|
||||||
|
Reference in New Issue
Block a user