Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
39700ab0
提交
39700ab0
authored
6月 06, 2017
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-10372: [Build-System,fs-utils] #resolve
上级
ab631fdc
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
119 行增加
和
21 行删除
+119
-21
filebug.pl
support-d/utils/filebug.pl
+30
-0
fixbug.pl
support-d/utils/fixbug.pl
+89
-21
没有找到文件。
support-d/utils/filebug.pl
浏览文件 @
39700ab0
...
@@ -148,6 +148,20 @@ if ($opts{bug}) {
...
@@ -148,6 +148,20 @@ if ($opts{bug}) {
printf
"%d file%s attached.\n"
,
scalar
@ARGV
,
scalar
@ARGV
==
1
?
""
:
"s"
;
printf
"%d file%s attached.\n"
,
scalar
@ARGV
,
scalar
@ARGV
==
1
?
""
:
"s"
;
}
}
if
(
$opts
{
versions_array
})
{
$input
=
{
update
=>
{
fixVersions
=>
[
{
set
=>
$opts
{
versions_array
}}
]
}
};
$jira
->
PUT
(
"/issue/"
.
$opts
{
bug
},
undef
,
$input
);
}
exit
;
exit
;
}
}
...
@@ -227,6 +241,22 @@ if ($opts{debug}) {
...
@@ -227,6 +241,22 @@ if ($opts{debug}) {
$issue
=
$jira
->
POST
(
'/issue'
,
undef
,
$input
)
or
die
"Issue was not created:"
;
$issue
=
$jira
->
POST
(
'/issue'
,
undef
,
$input
)
or
die
"Issue was not created:"
;
print
"Issue Posted: "
.
$issue
->
{
key
};
print
"Issue Posted: "
.
$issue
->
{
key
};
if
(
$opts
{
versions_array
})
{
$input
=
{
update
=>
{
fixVersions
=>
[
{
set
=>
$opts
{
versions_array
}}
]
}
};
$jira
->
PUT
(
"/issue/"
.
$issue
->
{
key
},
undef
,
$input
);
print
"Fix versions updated for issue "
.
$issue
->
{
key
};;
}
if
(
$opts
{
attach
})
{
if
(
$opts
{
attach
})
{
$jira
->
attach_files
(
$issue
->
{
key
},
@ARGV
);
$jira
->
attach_files
(
$issue
->
{
key
},
@ARGV
);
printf
"%d file%s attached.\n"
,
scalar
@ARGV
,
scalar
@ARGV
==
1
?
""
:
"s"
;
printf
"%d file%s attached.\n"
,
scalar
@ARGV
,
scalar
@ARGV
==
1
?
""
:
"s"
;
...
...
support-d/utils/fixbug.pl
浏览文件 @
39700ab0
...
@@ -3,22 +3,55 @@
...
@@ -3,22 +3,55 @@
use
XML::
Simple
;
use
XML::
Simple
;
use
Data::
Dumper
;
use
Data::
Dumper
;
use
Getopt::
Long
qw(GetOptions)
;
use
Getopt::
Long
qw(GetOptions)
;
use
Term::
ReadKey
;
use
JIRA::
REST
;
my
%
opts
;
my
%
opts
;
sub
getpass
{
ReadMode
(
"noecho"
);
print
"Password: "
;
chomp
(
my
$pwd
=
<
STDIN
>
);
ReadMode
(
"original"
);
return
$pwd
;
}
sub
getfield
{
my
$prompt
=
shift
;
my
$default
=
shift
;
print
$prompt
.
(
$default
?
"[$default]: "
:
""
);
chomp
(
my
$data
=
<
STDIN
>
);
if
(
!
$data
)
{
$data
=
$default
;
}
return
$data
;
}
GetOptions
(
GetOptions
(
'bug=s'
=>
\
$opts
{
bug
},
'bug=s'
=>
\
$opts
{
bug
},
'msg=s'
=>
\
$opts
{
msg
},
'msg=s'
=>
\
$opts
{
msg
},
'user=s'
=>
\
$opts
{
user
},
'pass=s'
=>
\
$opts
{
pass
},
'debug'
=>
\
$opts
{
debug
},
'debug'
=>
\
$opts
{
debug
},
'noresolve'
=>
\
$opts
{
noresolve
},
'noresolve'
=>
\
$opts
{
noresolve
},
'append=s'
=>
\
$opts
{
append
},
'append=s'
=>
\
$opts
{
append
},
'comment=s'
=>
\
$opts
{
comment
},
'comment=s'
=>
\
$opts
{
comment
},
'author=s'
=>
\
$opts
{
author
}
'versions=s'
=>
\
$opts
{
versions
},
)
or
die
"Usage: $0 -bug <bug-id> [-m [edit|<msg>]] [-append <msg>] [-debug] <files>\n"
;
'author=s'
=>
\
$opts
{
author
},
'auth'
=>
\
$opts
{
auth
}
)
or
die
"Usage: $0 -bug <bug-id> [--auth] [-m [edit|<msg>]] [--append <msg>] [--debug] <files>\n"
;
$opts
{
bug
}
or
$opts
{
bug
}
=
shift
;
$opts
{
bug
}
or
$opts
{
bug
}
=
shift
;
if
(
$opts
{
versions
})
{
$opts
{
auth
}
=
1
;
$opts
{
versions_array
}
=
[
map {{nam
e
=>
$_
}}
split
(
" "
,
$opts
{
versions
})];
}
my
$url
=
"https://freeswitch.org/jira/si/jira.issueviews:issue-xml/$opts{bug}/$opts{bug}.xml"
;
my
$url
=
"https://freeswitch.org/jira/si/jira.issueviews:issue-xml/$opts{bug}/$opts{bug}.xml"
;
my
$cmd
;
my
$cmd
;
my
$prog
=
`which curl`
||
`which wget`
;
my
$prog
=
`which curl`
||
`which wget`
;
...
@@ -27,38 +60,73 @@ my $post = " \#resolve";
...
@@ -27,38 +60,73 @@ my $post = " \#resolve";
chomp
$prog
;
chomp
$prog
;
$prog
||
die
"missing url fetch program, install curl or wget"
;
if
(
$opts
{
auth
})
{
if
(
!
$opts
{
user
})
{
$opts
{
user
}
=
getfield
(
"User: "
);
}
if
(
!
$opts
{
pass
}
&&
!
$opts
{
debug
})
{
$opts
{
pass
}
=
getpass
();
print
"\n"
;
}
$jira
=
JIRA::
REST
->
new
(
'https://freeswitch.org/jira'
,
$opts
{
user
},
$opts
{
pass
})
or
die
"login incorrect:"
;
$issue
=
$jira
->
GET
(
"/issue/FS-7985"
)
or
die
"login incorrect:"
;
my
$issue
=
$jira
->
GET
(
"/issue/"
.
$opts
{
bug
});
$component
=
join
(
","
,
map {$_->{nam
e
}}
@
{
$issue
->
{
fields
}
->
{
components
}});
$summary
=
$issue
->
{
fields
}
->
{
summary
};
if
(
$opts
{
versions_array
})
{
$input
=
{
update
=>
{
fixVersions
=>
[
{
set
=>
$opts
{
versions_array
}}
]
}
};
$jira
->
PUT
(
"/issue/"
.
$opts
{
bug
},
undef
,
$input
);
}
if
(
$prog
=~
/wget/
)
{
$cmd
=
"$prog -O -"
;
}
else
{
}
else
{
$cmd
=
$prog
;
$prog
||
die
"missing url fetch program, install curl or wget"
;
}
my
$xml
=
`$cmd $url 2>/dev/null`
;
if
(
$prog
=~
/wget/
)
{
if
(
$opts
{
debug
})
{
$cmd
=
"$prog -O -"
;
print
"URL $url\n"
;
}
else
{
print
$xml
;
$cmd
=
$prog
;
}
}
my
$xs
=
new
XML::
Simple
;
my
$xml
=
`$cmd $url 2>/dev/null`
;
my
$r
=
$xs
->
XMLin
(
$xml
);
if
(
$opts
{
debug
})
{
print
"URL $url\n"
;
print
$xml
;
}
my
$sum
=
$r
->
{
channel
}
->
{
item
}
->
{
summary
}
;
my
$xs
=
new
XML::
Simple
;
$sum
=~
s/\"/\\"/g
;
my
$r
=
$xs
->
XMLin
(
$xml
)
;
my
$component
=
$r
->
{
channel
}
->
{
item
}
->
{
component
};
my
$sum
=
$r
->
{
channel
}
->
{
item
}
->
{
summary
};
$sum
=~
s/\"/\\"/g
;
if
(
ref
(
$component
)
eq
'ARRAY'
)
{
my
$component
=
$r
->
{
channel
}
->
{
item
}
->
{
component
};
$component
=
join
(
","
,
@
{
$component
});
}
$component
=~
s/\"/\\"/g
;
if
(
ref
(
$component
)
eq
'ARRAY'
)
{
$component
=
join
(
","
,
@
{
$component
});
}
$component
=~
s/\"/\\"/g
;
}
if
(
$opts
{
noresolve
})
{
if
(
$opts
{
noresolve
})
{
$post
=
""
;
$post
=
""
;
}
}
if
(
$opts
{
msg
}
eq
"edit"
)
{
if
(
$opts
{
msg
}
eq
"edit"
)
{
$auto
=
0
;
$auto
=
0
;
$opts
{
msg
}
=
undef
;
$opts
{
msg
}
=
undef
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论