Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
b5e472e7
D
Dak
项目概览
喜羊羊3508
/
Dak
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Dak
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b5e472e7
编写于
8月 05, 2008
作者:
J
Joerg Jaspert
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed ssh-move
上级
a74ba427
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
0 addition
and
128 deletion
+0
-128
scripts/debian/ssh-move
scripts/debian/ssh-move
+0
-128
未找到文件。
scripts/debian/ssh-move
已删除
100755 → 0
浏览文件 @
a74ba427
#! /usr/bin/perl -w
use
strict
;
use
IPC::
Open2
;
$ENV
{
LANG
}
=
"
C
";
# The protocol consists of repeated exchanges of the following:
#
# S: <filename>
# S: <each line of file, with dot-stuffing as in SMTP>
# S: .
# C: [writes file]
# C: <filename>
# S: [unlinks file]
my
$server
=
0
;
my
$verbose
=
0
;
my
$nonint
=
0
;
my
$sshidentity
;
my
$sshmovepath
=
'
ssh-move
';
my
$fromdir
;
my
$todir
;
while
(
@ARGV
)
{
local
$_
=
shift
@ARGV
;
if
(
/^--server$/
)
{
$server
=
1
;
}
elsif
(
/^--verbose$/
)
{
$verbose
=
1
;
}
elsif
(
/^--ssh-identity$/
)
{
$sshidentity
=
shift
@ARGV
;
}
elsif
(
/^--ssh-move-path$/
)
{
$sshmovepath
=
shift
@ARGV
;
}
elsif
(
/^--from-directory$/
)
{
$fromdir
=
shift
@ARGV
;
}
elsif
(
/^--to-directory$/
)
{
$todir
=
shift
@ARGV
;
}
elsif
(
/^--non-interactive$/
)
{
$nonint
=
1
;
}
else
{
unshift
@ARGV
,
$_
;
last
;
}
}
local
$|
=
1
;
my
(
$in
,
$out
)
=
(
*STDIN
,
*STDOUT
);
unless
(
$nonint
)
{
my
$servername
=
shift
@ARGV
;
local
(
*READER
,
*WRITER
);
my
@args
=
('
ssh
');
push
@args
,
'
-i
',
$sshidentity
if
defined
$sshidentity
;
push
@args
,
$servername
,
$sshmovepath
;
push
@args
,
'
--server
'
unless
(
$server
);
push
@args
,
'
--to-directory
',
$todir
if
(
defined
$todir
&&
$server
);
push
@args
,
'
--from-directory
',
$fromdir
if
(
defined
$fromdir
&&
!
$server
);
push
@args
,
'
--non-interactive
';
push
@args
,
map
quotemeta
,
@ARGV
unless
(
$server
);
my
$pid
=
open2
(
\
*READER
,
\
*WRITER
,
@args
);
(
$in
,
$out
)
=
(
*READER
,
*WRITER
);
}
sub
server
()
{
chdir
$fromdir
if
defined
$fromdir
;
my
@files
=
map
glob
,
@ARGV
;
for
my
$file
(
@files
)
{
print
$out
"
$file
\n
"
or
die
"
can't print to client: $!
";
open
FILE
,
"
<
$file
"
or
die
"
can't open
$file
: $!
\n
";
local
$_
;
while
(
<
FILE
>
)
{
chomp
;
$_
=
"
.
$_
"
if
/^\./
;
print
$out
"
$_
\n
"
or
die
"
can't print to client: $!
";
}
print
$out
"
.
\n
"
or
die
"
can't print to client: $!
";
my
$confirm
=
<
$in
>
;
chomp
$confirm
if
defined
$confirm
;
unlink
$file
if
defined
$confirm
and
$confirm
eq
$file
;
}
}
sub
client
()
{
chdir
$todir
if
defined
$todir
;
my
$file
;
while
(
defined
(
$file
=
<
$in
>
))
{
chomp
$file
;
print
STDERR
$file
if
$verbose
;
(
my
$tmpfile
=
$file
)
=~
s[.*/][]
;
$tmpfile
.=
"
.$$.tmp
";
# TODO: unlink $tmpfile if things go wrong
open
TMP
,
"
>
$tmpfile
"
or
die
"
can't open
$tmpfile
: $!
";
local
$_
;
while
(
<
$in
>
)
{
chomp
;
if
(
$_
eq
'
.
')
{
close
TMP
or
die
"
can't close
$tmpfile
: $!
";
rename
$tmpfile
,
$file
or
die
"
can't rename
$tmpfile
to
$file
: $!
";
print
$out
"
$file
\n
"
or
die
"
can't print to server: $!
";
last
;
}
else
{
s/^\.//
;
print
TMP
"
$_
\n
"
or
die
"
can't print to
$tmpfile
: $!
";
}
}
print
STDERR
"
ok
\n
"
if
$verbose
;
}
}
if
(
$server
)
{
server
();
}
else
{
client
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录