[Mew-dist 08431] Re: immv msgs 'all' means all messages but move one message
SAKAI Kiyotaka
ksakai at example.com
1999年 4月 2日 (金) 13:18:03 JST
>> In article <19990402092438I.mac at example.com>, のだまさひで/Masahide NODA <mac at example.com> writes:
> 現象だけですいません. im-113 ですが, immv で all を指定しても 1 通だけし
> か mv されませでした. --debug をつけてみたところ
すいません、このパッチでいいと思います。
--
酒井 清隆 (E-mail: ksakai at example.com)
-------------- next part --------------
Index: immv.in
===================================================================
RCS file: /home/ksakai/cvsroot/im-113/immv.in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 immv.in
--- immv.in 1999/04/02 01:11:40 1.1.1.1
+++ immv.in 1999/04/02 03:51:55
@@ -154,7 +154,8 @@
sub local2local($$$) {
my ($src, $dsts, $msgs) = @_;
- foreach (@$msgs) {
+ my @msg_paths = get_impath($src, @$msgs);
+ foreach (@msg_paths) {
refile_one($src, $dsts, $_);
}
}
@@ -183,12 +184,8 @@
sub refile_one ($$$) {
my ($src, $dsts, $msg) = @_;
- my ($src_path, $dst, $dst_path, $link_it);
+ my ($dst, $dst_path, $link_it);
- if ($src ne "") {
- $src_path = get_impath($src, ($msg));
- }
-
foreach $dst (@{$dsts}) {
if ($NewMsgCache{$dst}){
$NewMsgCache{$dst} =~ s|([^/]+)$|$1+1|e; # increment cache
@@ -197,7 +194,7 @@
$dst_path = $NewMsgCache{$dst} = get_impath($dst, 'new');
}
if ($opt_link && $src ne "") {
- im_link($src_path, $dst_path) || die $@;
+ im_link($msg, $dst_path) || die $@;
} elsif ($link_it) {
im_link($link_it, $dst_path) || die $@;
} else {
@@ -207,14 +204,11 @@
im_warn("can't store msg to $dst folder.\n");
}
} else {
- im_rename($src_path, $dst_path) || die $@;
+ im_rename($msg, $dst_path) || die $@;
}
$link_it = $dst_path;
}
touch_folder($dst_path) unless ($opt_noharm);
- }
- if (!$opt_link && !$link_it) {
- im_unlink($src_path);
}
}
Index: imrm.in
===================================================================
RCS file: /home/ksakai/cvsroot/im-113/imrm.in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 imrm.in
--- imrm.in 1999/04/02 01:11:40 1.1.1.1
+++ imrm.in 1999/04/02 04:01:27
@@ -149,7 +149,8 @@
sub local2local($$$) {
my ($src, $dsts, $msgs) = @_;
- foreach (@$msgs) {
+ my @msg_paths = get_impath($src, @$msgs);
+ foreach (@msg_paths) {
refile_one($src, $dsts, $_);
}
}
@@ -178,12 +179,8 @@
sub refile_one ($$$) {
my ($src, $dsts, $msg) = @_;
- my ($src_path, $dst, $dst_path, $link_it);
+ my ($dst, $dst_path, $link_it);
- if ($src ne "") {
- $src_path = get_impath($src, ($msg));
- }
-
foreach $dst (@{$dsts}) {
if ($NewMsgCache{$dst}){
$NewMsgCache{$dst} =~ s|([^/]+)$|$1+1|e; # increment cache
@@ -200,13 +197,12 @@
im_warn("can't store msg to $dst folder.\n");
}
} else {
- im_rename($src_path, $dst_path) || die $@;
+ im_rename($msg, $dst_path) || die $@;
}
$link_it = $dst_path;
}
touch_folder($dst_path) unless ($opt_noharm);
}
- im_unlink($src_path) unless ($link_it);
}
sub local2imap ($$$) {
Mew-dist メーリングリストの案内