[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Stow-devel] commit
From: |
Gaël Roualland |
Subject: |
Re: [Stow-devel] commit |
Date: |
Wed, 09 Jan 2002 02:30:53 +0100 |
Guillaume Morin a écrit :
>
> Since the commit notification did not work, I post the changes I've made
> to the CVS repository :
Same problem ;-(
I commited addition of the '--ignore' and '--force' options (rewrote my
patch) as follows. Next one, the '.nostow' stuff (if needed).
Index: ChangeLog
===================================================================
RCS file: /cvsroot/stow/stow/ChangeLog,v
retrieving revision 1.11
diff -u -r1.11 ChangeLog
--- ChangeLog 8 Jan 2002 22:04:15 -0000 1.11
+++ ChangeLog 9 Jan 2002 01:24:01 -0000
@@ -1,3 +1,9 @@
+Wed Jan 9 02:20:15 2002 Gaël Roualland <address@hidden>
+
+ * stow.in: added the '--ignore' and '--force' options.
+ * stow.texi,stow.8: documented '--ignore' and '--force'.
+ * TODO: removed reference to '--ignore' like feature.
+
Tue Jan 08 23:00:29 2002 Guillaume Morin <address@hidden>
* stow.in: added the '--subdir' option.
Index: TODO
===================================================================
RCS file: /cvsroot/stow/stow/TODO,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 TODO
--- TODO 24 Dec 2001 14:57:46 -0000 1.1.1.1
+++ TODO 9 Jan 2002 01:24:01 -0000
@@ -4,11 +4,6 @@
* Fix empty-dir problem (see "Known bugs" in the manual)
-* Continue after conflicts.
-
-When detecting a conflict, affected subparts of the Stow traversal can
-be skipped while continuing with other subparts.
-
* Traverse links in the target tree?
From e-mail with address@hidden:
Index: stow.8
===================================================================
RCS file: /cvsroot/stow/stow/stow.8,v
retrieving revision 1.3
diff -u -r1.3 stow.8
--- stow.8 8 Jan 2002 22:04:15 -0000 1.3
+++ stow.8 9 Jan 2002 01:24:02 -0000
@@ -181,6 +181,20 @@
might arise from an actual Stow operation. As with `-n', however,
false conflicts might be reported (see ``Conflicts'' in the info
manual).
.TP
+.I -i
+.TP
+.I --ignore
+Do not exit immediatly when a conflict is encountered, but continue
+processing the package.
+.TP
+.I -f
+.TP
+.I --force
+Try to override conflicts by removing conflicting links. This will
+only remove links to other packages in the stow directory. Other
+links or files will not be removed (it will be similar to `-i' in
+that case).
+.TP
.I "-d DIR"
.TP
.I --dir=DIR
Index: stow.in
===================================================================
RCS file: /cvsroot/stow/stow/stow.in,v
retrieving revision 1.9
diff -u -r1.9 stow.in
--- stow.in 8 Jan 2002 22:04:15 -0000 1.9
+++ stow.in 9 Jan 2002 01:24:02 -0000
@@ -39,6 +39,7 @@
$Stow = undef;
$Target = undef;
$Restow = 0;
+$Force = 0;
@Subdirs = ();
@@ -55,6 +56,11 @@
} elsif ($opt =~ /^c(o(n(f(l(i(c(ts?)?)?)?)?)?)?)?$/i) {
$Conflicts = 1;
$NotReally = 1;
+ } elsif ($opt =~ /^i(g(n(o(r(e?)?)?)?)?)$/i) {
+ $Conflicts = 1;
+ } elsif ($opt =~ /^f(o(r(c(e?)?)?)?)$/i) {
+ $Force = 1;
+ $Conflicts = 1;
} elsif ($opt =~ /^dir?/i) {
$remainder = $';
if ($remainder =~ /^=/) {
@@ -103,6 +109,11 @@
} elsif ($_ eq 'c') {
$Conflicts = 1;
$NotReally = 1;
+ } elsif ($_ eq 'i') {
+ $Conflicts = 1;
+ } elsif ($_ eq 'f') {
+ $Force = 1;
+ $Conflicts = 1;
} elsif ($_ eq 'd') {
$Stow = (join('', @opts) || shift);
@opts = ();
@@ -434,23 +445,27 @@
$linktarget))
|| (&Conflict($file, $subfile), return);
if (-e &JoinPaths($Stow, $stowsubfile)) {
- (&Conflict($file, $subfile), return)
- unless ($stowsubfile eq $file);
- warn sprintf("%s already points to %s\n",
- &JoinPaths($Target, $subfile),
- &JoinPaths($Stow, $file))
- if ($Verbose > 2);
- } else {
- &DoUnlink(&JoinPaths($Target, $subfile));
- &DoLink(&JoinPaths($stow, $file),
- &JoinPaths($Target, $subfile));
+ if ($stowsubfile eq $file) {
+ warn sprintf("%s already points to %s\n",
+ &JoinPaths($Target, $subfile),
+ &JoinPaths($Stow, $file))
+ if ($Verbose > 2);
+ return;
+ } else {
+ &Conflict($file, $subfile);
+ return unless $Force;
+ warn "OVERRIDING link to ". &JoinPaths($Stow, $stowsubfile) . "\n"
+ if $Verbose;
+ }
}
+ &DoUnlink(&JoinPaths($Target, $subfile));
} elsif (-e &JoinPaths($Target, $subfile)) {
&Conflict($file, $subfile);
- } else {
- &DoLink(&JoinPaths($stow, $file),
- &JoinPaths($Target, $subfile));
+ return;
}
+
+ &DoLink(&JoinPaths($stow, $file),
+ &JoinPaths($Target, $subfile));
}
sub DoUnlink {
@@ -544,6 +559,8 @@
print <<EOT;
-n, --no Do not actually make changes
-c, --conflicts Scan for conflicts, implies -n
+ -i, --ignore Ignore conflicts.
+ -f, --force Try to override conflicts.
-d DIR, --dir=DIR Set stow dir to DIR (default is current dir)
-t DIR, --target=DIR Set target to DIR (default is parent of stow
dir)
-s DIR:DIR,
Index: stow.texi
===================================================================
RCS file: /cvsroot/stow/stow/stow.texi,v
retrieving revision 1.5
diff -u -r1.5 stow.texi
--- stow.texi 8 Jan 2002 22:04:15 -0000 1.5
+++ stow.texi 9 Jan 2002 01:24:03 -0000
@@ -241,6 +241,18 @@
arise from an actual Stow operation. As with @samp{-n}, however,
false conflicts might be reported (@pxref{Conflicts}).
address@hidden -i
address@hidden --ignore
+Do not exit immediatly when a conflict is encountered, but continue
+processing the package.
+
address@hidden -f
address@hidden --force
+Try to override conflicts by removing conflicting links. This will
+only remove links to other packages in the stow directory. Other
+links or files will not be removed (it will be similar to @samp{-i} in
+that case).
+
@item -d @var{dir}
@itemx address@hidden
Set the stow directory to @var{dir} instead of the current directory.
@@ -697,8 +709,8 @@
is harmless to install a package that has already been installed.)
A conflict causes Stow to exit immediately and print a warning
-(unless @samp{-c} is given), even if that means aborting an
installation
-in mid-package.
+(unless @samp{-c}, @samp{-i} or @samp{-f} are given), even if that
means
+aborting an installation in mid-package.
@cindex false conflict
When running Stow with the @samp{-n} or @samp{-c} options, no actual
--
Gaël Roualland -+- address@hidden