Fix inconsistencies in coding style.

This commit is contained in:
Adam Spiers 2011-11-17 14:17:24 +00:00
parent 6ee8747c9b
commit 85f1f8619c
2 changed files with 85 additions and 115 deletions

32
stow.in
View file

@ -164,7 +164,6 @@ if ( not caller() ) {
# Comments : checks @ARGV for valid package names
#============================================================================
sub process_options {
get_defaults();
#$,="\n"; print @ARGV,"\n"; # for debugging rc file
@ -278,7 +277,6 @@ sub debug {
# : hacked in so that Emil and I could set different preferences).
#=============================================================================
sub get_defaults {
my @defaults = ();
for my $file ($ENV{'HOME'}.'/.stowrc', '.stowrc') {
if (-r $file) {
@ -341,7 +339,7 @@ OPTIONS:
-V, --version Show stow version number
-h, --help Show this help
EOT
exit( $msg ? 1 : 0 );
exit $msg ? 1 : 0;
}
#===== SUBROUTINE ===========================================================
@ -354,7 +352,6 @@ EOT
# Comments : This sets the current working directory to $Option{target}
#============================================================================
sub set_stow_path {
# Changing dirs helps a lot when soft links are used
# Also prevents problems when 'stow_dir' or 'target' are
# supplied as relative paths (FIXME: examples?)
@ -404,7 +401,6 @@ sub set_stow_path {
# : $path is used for folding/unfolding trees as necessary
#============================================================================
sub stow_contents {
my ($path, $target, $source) = @_;
debug(2, "Stowing contents of $path");
@ -445,7 +441,6 @@ sub stow_contents {
# : $path is used for folding/unfolding trees as necessary
#============================================================================
sub stow_node {
my ($path, $target, $source) = @_;
debug(2, "Stowing $path");
@ -547,7 +542,6 @@ sub stow_node {
# : Here we traverse the target tree, rather than the source tree.
#============================================================================
sub unstow_contents_orig {
my ($path, $target) = @_;
# don't try to remove anything under a stow directory
@ -587,7 +581,6 @@ sub unstow_contents_orig {
# Comments : unstow_node() and unstow_contents() are mutually recursive
#============================================================================
sub unstow_node_orig {
my ($path, $target) = @_;
debug(2, "Unstowing $target");
@ -649,7 +642,6 @@ sub unstow_node_orig {
# : Here we traverse the target tree, rather than the source tree.
#============================================================================
sub unstow_contents {
my ($path, $target) = @_;
# don't try to remove anything under a stow directory
@ -692,7 +684,6 @@ sub unstow_contents {
# Comments : unstow_node() and unstow_contents() are mutually recursive
#============================================================================
sub unstow_node {
my ($path, $target) = @_;
debug(2, "Unstowing $path");
@ -784,7 +775,6 @@ sub unstow_node {
# : we could put more logic under here for multiple stow dirs
#============================================================================
sub find_stowed_path {
my ($target, $source) = @_;
# evaluate softlink relative to its target
@ -829,7 +819,6 @@ sub find_stowed_path {
# : it anyway
#=============================================================================
sub cleanup_invalid_links {
my ($dir) = @_;
if (not -d $dir) {
@ -881,7 +870,6 @@ sub cleanup_invalid_links {
# : that is, it can be used as the source for a replacement symlink
#============================================================================
sub foldable {
my ($target) = @_;
debug(3, "--- Is $target foldable?");
@ -947,7 +935,6 @@ sub foldable {
# Comments : only called iff foldable() is true so we can remove some checks
#============================================================================
sub fold_tree {
my ($target, $source) = @_;
debug(3, "--- Folding tree: $target => $source");
@ -997,7 +984,6 @@ sub conflict {
# Comments : none
#=============================================================================
sub ignore {
my ($path) = @_;
for my $suffix (@{$Option{'ignore'}}) {
@ -1015,7 +1001,6 @@ sub ignore {
# Comments : none
#=============================================================================
sub defer {
my ($path) = @_;
for my $prefix (@{$Option{'defer'}}) {
@ -1033,7 +1018,6 @@ sub defer {
# Comments : none
#=============================================================================
sub override {
my ($path) = @_;
for my $regex (@{$Option{'override'}}) {
@ -1059,7 +1043,6 @@ sub override {
# : an action is set to 'skip' if it is found to be redundant
#============================================================================
sub process_tasks {
debug(2, "Processing tasks...");
# strip out all tasks with a skip action
@ -1126,9 +1109,7 @@ sub process_tasks {
sub is_a_link {
my ($path) = @_;
if (exists $Link_Task_For{$path}) {
my $action = $Link_Task_For{$path}->{'action'};
if ($action eq 'remove') {
@ -1215,7 +1196,6 @@ sub is_a_node {
my ($path) = @_;
if (exists $Link_Task_For{$path}) {
my $action = $Link_Task_For{$path}->{'action'};
if ($action eq 'remove') {
@ -1230,7 +1210,6 @@ sub is_a_node {
}
if (exists $Dir_Task_For{$path}) {
my $action = $Dir_Task_For{$path}->{'action'};
if ($action eq 'remove') {
@ -1270,7 +1249,6 @@ sub is_a_node {
# Comments : none
#============================================================================
sub read_a_link {
my ($path) = @_;
if (exists $Link_Task_For{$path}) {
@ -1304,11 +1282,9 @@ sub read_a_link {
# Comments : cleans up operations that undo previous operations
#============================================================================
sub do_link {
my ($oldfile, $newfile) = @_;
if (exists $Dir_Task_For{$newfile}) {
my $task_ref = $Dir_Task_For{$newfile};
if ($task_ref->{'action'} eq 'create') {
@ -1329,7 +1305,6 @@ sub do_link {
}
if (exists $Link_Task_For{$newfile}) {
my $task_ref = $Link_Task_For{$newfile};
if ($task_ref->{'action'} eq 'create') {
@ -1383,7 +1358,6 @@ sub do_link {
# Comments : will remove an existing planned link
#============================================================================
sub do_unlink {
my ($file) = @_;
if (exists $Link_Task_For{$file}) {
@ -1444,7 +1418,6 @@ sub do_mkdir {
my ($dir) = @_;
if (exists $Link_Task_For{$dir}) {
my $task_ref = $Link_Task_For{$dir};
if ($task_ref->{'action'} eq 'create') {
@ -1463,7 +1436,6 @@ sub do_mkdir {
}
if (exists $Dir_Task_For{$dir}) {
my $task_ref = $Dir_Task_For{$dir};
if ($task_ref->{'action'} eq 'create') {
@ -1562,7 +1534,6 @@ sub do_rmdir {
# Comments : none
#=============================================================================
sub strip_quotes {
my ($string) = @_;
if ($string =~ m{\A\s*'(.*)'\s*\z}) {
@ -1584,7 +1555,6 @@ sub strip_quotes {
# : '//' => '/' and 'a/b/../c' => 'a/c'
#============================================================================
sub join_paths {
my @paths = @_;
# weed out empty components and concatenate