bug-stow
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-stow] problems with "/stow" as stow directory (fwd)


From: Klaus Stehle
Subject: [Bug-stow] problems with "/stow" as stow directory (fwd)
Date: Fri, 14 Jun 2002 10:51:06 +0200 (CEST)

Hallo,

There are some problems with stow (version 1.3.3) if the stow directory is
"/stow" so that the default target directory should be the root
directory "/".


1.)
  The subroutine &parent("/stow") returns an empty string instead of "/"
  so that my home directory is used as target directory.

  Changing the last line of the subroutine &parent will solve the problem:

    sub parent {
      local($path) = join('/', @_);
      local(@elts) = split(/\/+/, $path);
      pop(@elts);
      ($path = join('/', @elts)) ? $path : "/";
    }


2.)
  The next problem is more general. When unstowing, the whole target
  directory tree will be searched, and if this is the root directory it
  takes a very long time and stow failes while searching in directoriers
  like "/dev" or "/proc".

  The following suggestion may solve the problem: before recursing into a
  subdirectory, Unstow looks if that directory exists in one of the
  "Collections", and if it is not found that directory is skipped.
  This will make Unstow much faster with the cost that some "wild" links
  in the "wrong" directories would not be found.

  I have tried the following patches:

  a) A new function which looks for a directory path in the collections.
  It returns 1 if unstow should recurse into that directory

    sub FindStowPath {
      local($path) = @_;
      local($collection);
      foreach $collection (@Collections) {
        return 1 if (-d &JoinPaths($Stow, $collection, $path));
      }
      return 0;
    }


  b) In the subroutine "Unstow" one line is added near line 255 in stow.in
  after the "} elsif (-d &JoinPaths($Target, $targetdir, $content)) {"

    next if !&FindStowPath(&JoinPaths($targetdir, $content));


A compete patch file is added as attachment.

Cheers
Klaus

(address@hidden)

Attachment: stow.in.diff
Description: patch file


reply via email to

[Prev in Thread] Current Thread [Next in Thread]