Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
b5e1c7e8
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,发现更多精彩内容 >>
提交
b5e1c7e8
编写于
9月 27, 2001
作者:
J
James Troup
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Options cleanup. Create lock and new-ack files if they don't exist, rather than dieing
上级
5646e901
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
51 addition
and
35 deletion
+51
-35
katie
katie
+51
-35
未找到文件。
katie
浏览文件 @
b5e1c7e8
...
...
@@ -2,7 +2,7 @@
#
Installs
Debian
packaes
#
Copyright
(
C
)
2000
,
2001
James
Troup
<
james
@
nocrew
.
org
>
#
$
Id
:
katie
,
v
1.
59
2001
-
09
-
13
23
:
56
:
29
troup
Exp
$
#
$
Id
:
katie
,
v
1.
60
2001
-
09
-
27
14
:
39
:
06
troup
Exp
$
#
This
program
is
free
software
;
you
can
redistribute
it
and
/
or
modify
#
it
under
the
terms
of
the
GNU
General
Public
License
as
published
by
...
...
@@ -70,20 +70,50 @@ orig_tar_location = "";
legacy_source_untouchable
=
{};
Subst
=
{};
nmu
=
None
;
katie_version
=
"$Revision: 1.60 $"
;
###############################################################################
def
init
():
global
Cnf
,
Options
;
apt_pkg
.
init
();
Cnf
=
apt_pkg
.
newConfiguration
();
apt_pkg
.
ReadConfigFileISC
(
Cnf
,
utils
.
which_conf_file
());
Arguments
=
[(
'a'
,
"automatic"
,
"Dinstall::Options::Automatic"
),
(
'h'
,
"help"
,
"Dinstall::Options::Help"
),
(
'k'
,
"ack-new"
,
"Dinstall::Options::Ack-New"
),
(
'm'
,
"manual-reject"
,
"Dinstall::Options::Manual-Reject"
,
"HasArg"
),
(
'n'
,
"no-action"
,
"Dinstall::Options::No-Action"
),
(
'p'
,
"no-lock"
,
"Dinstall::Options::No-Lock"
),
(
's'
,
"no-mail"
,
"Dinstall::Options::No-Mail"
),
(
'u'
,
"override-distribution"
,
"Dinstall::Options::Override-Distribution"
,
"HasArg"
),
(
'V'
,
"version"
,
"Dinstall::Options::Version"
)];
for
i
in
[
"automatic"
,
"help"
,
"ack-new"
,
"manual-reject"
,
"no-action"
,
"no-lock"
,
"no-mail"
,
"override-distribution"
,
"version"
]:
Cnf
[
"Dinstall::Options::%s"
%
(
i
)]
=
""
;
changes_files
=
apt_pkg
.
ParseCommandLine
(
Cnf
,
Arguments
,
sys
.
argv
);
Options
=
Cnf
.
SubTree
(
"Dinstall::Options"
)
return
changes_files
;
#########################################################################################
def
usage
(
exit_code
):
def
usage
(
exit_code
=
0
):
print
"""Usage: dinstall [OPTION]... [CHANGES]...
-a, --automatic automatic run
-D, --debug=VALUE turn on debugging
-h, --help show this help and exit.
-k, --ack-new acknowledge new packages !! for cron.daily only !!
-m, --manual-reject=MSG manual reject with `msg'
-n, --no-action don't do anything
-p, --no-lock don't check lockfile !! for cron.daily only !!
-s, --no-mail don't send any mail
-u, --distribution=DIST override distribution to `dist'
-
v
, --version display the version number and exit"""
-
V
, --version display the version number and exit"""
sys
.
exit
(
exit_code
)
#########################################################################################
...
...
@@ -300,7 +330,7 @@ def check_changes(filename):
reject_message
=
reject_message
+
"Mapping stable to unstable for unreleased arch `%s'.
\n
"
%
(
i
)
del
changes
[
"distribution"
][
"stable"
]
changes
[
"distribution"
][
"unstable"
]
=
1
;
#
Map
arches
not
being
released
from
frozen
to
unstable
if
changes
[
"distribution"
].
has_key
(
"frozen"
):
for
i
in
changes
[
"architecture"
].
keys
():
...
...
@@ -336,7 +366,7 @@ def check_changes(filename):
if
string
.
find
(
reject_message
,
"Rejected:"
)
!= -1:
return
0
else
:
else
:
return
1
def
check_files
():
...
...
@@ -1327,31 +1357,14 @@ def process_it (changes_file):
def main():
global Cnf, Options, projectB, install_bytes, new_ack_old, Subst, nmu, Logger
apt_pkg.init();
Cnf = apt_pkg.newConfiguration();
apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
Arguments = [('
a
',"automatic","Dinstall::Options::Automatic"),
('
d
',"debug","Dinstall::Options::Debug", "IntVal"),
('
h
',"help","Dinstall::Options::Help"),
('
k
',"ack-new","Dinstall::Options::Ack-New"),
('
m
',"manual-reject","Dinstall::Options::Manual-Reject", "HasArg"),
('
n
',"no-action","Dinstall::Options::No-Action"),
('
p
',"no-lock", "Dinstall::Options::No-Lock"),
('
s
',"no-mail", "Dinstall::Options::No-Mail"),
('
u
',"override-distribution", "Dinstall::Options::Override-Distribution", "HasArg"),
('
v
',"version","Dinstall::Options::Version")];
changes_files = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Dinstall::Options")
changes_files = init();
if Options["Help"]:
usage(
0
);
usage();
if Options["Version"]:
print "katie
version 0.0000000000"
;
usage
(0);
print "katie
%s" % (katie_version)
;
sys.exit
(0);
# -n/--dry-run invalidates some other options which would involve things happening
if Options["No-Action"]:
...
...
@@ -1370,22 +1383,25 @@ def main():
#
Obtain
lock
if
not
in
no
-
action
mode
and
initialize
the
log
if
not
Options
[
"No-Action"
]:
lock_fd
=
os
.
open
(
Cnf
[
"Dinstall::LockFile"
],
os
.
O_RDWR
);
lock_fd
=
os
.
open
(
Cnf
[
"Dinstall::LockFile"
],
os
.
O_RDWR
|
os
.
O_CREAT
);
fcntl
.
lockf
(
lock_fd
,
FCNTL
.
F_TLOCK
);
Logger
=
logging
.
Logger
(
Cnf
,
"katie"
);
#
Read
in
the
list
of
already
-
acknowledged
NEW
packages
new_ack_list
=
utils
.
open_file
(
Cnf
[
"Dinstall::NewAckList"
],
'r'
);
new_ack_old
=
{};
for
line
in
new_ack_list
.
readlines
():
new_ack_old
[
line
[:-
1
]]
=
1
;
new_ack_list
.
close
();
if
Options
[
"Ack-New"
]:
#
Read
in
the
list
of
already
-
acknowledged
NEW
packages
if
not
os
.
path
.
exists
(
Cnf
[
"Dinstall::NewAckList"
]):
utils
.
touch_file
(
Cnf
[
"Dinstall::NewAckList"
]);
new_ack_list
=
utils
.
open_file
(
Cnf
[
"Dinstall::NewAckList"
],
'r'
);
new_ack_old
=
{};
for
line
in
new_ack_list
.
readlines
():
new_ack_old
[
line
[:-
1
]]
=
1
;
new_ack_list
.
close
();
#
Initialize
the
substitution
template
mapping
global
Subst
=
{}
Subst
[
"__ADMIN_ADDRESS__"
]
=
Cnf
[
"Dinstall::MyAdminAddress"
];
Subst
[
"__BUG_SERVER__"
]
=
Cnf
[
"Dinstall::BugServer"
];
bcc
=
"X-Katie:
$Revision: 1.59 $"
bcc
=
"X-Katie:
%s"
%
(
katie_version
);
if
Cnf
.
has_key
(
"Dinstall::Bcc"
):
Subst
[
"__BCC__"
]
=
bcc
+
"
\n
Bcc: %s"
%
(
Cnf
[
"Dinstall::Bcc"
]);
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录