Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
forge001
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gerhard Gonter
forge001
Commits
1472d2f0
Commit
1472d2f0
authored
8 years ago
by
Gerhard Gonter
Browse files
Options
Downloads
Patches
Plain Diff
improved SIGINT handling
parent
46a125a6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
textarchive/vlib001.pl
+22
-6
22 additions, 6 deletions
textarchive/vlib001.pl
with
22 additions
and
6 deletions
textarchive/vlib001.pl
+
22
−
6
View file @
1472d2f0
...
...
@@ -127,7 +127,7 @@ unless (defined ($project))
{
print
"
no project specified; check these:
\n
";
system
("
ls -ls
\"
$ENV
{'TABASE'}/projects
\"
");
exit
(
0
);
exit
(
2
);
}
# &usage ('no store specified') unless (defined ($store));
...
...
@@ -136,14 +136,16 @@ if ($op_mode eq 'edit')
my
(
$proj_cfg_dir
,
$proj_cfg_fnm
)
=
TA::ObjReg::
_get_project_paths
(
$project
);
system
(
$EDITOR
,
$proj_cfg_fnm
);
# print "store_cfg: ", Dumper ($store_cfg);
exit
;
exit
(
0
)
;
}
my
$objreg
=
new
TA::
ObjReg
('
project
'
=>
$project
,
'
store
'
=>
$store
,
'
key
'
=>
'
md5
');
# print "objreg: ", Dumper ($objreg); exit;
&usage
('
no config found
')
unless
(
defined
(
$objreg
));
print
"
objreg:
",
Dumper
(
$objreg
)
if
(
$DEBUG
||
$STOP
);
exit
if
(
$STOP
);
exit
(
2
)
if
(
$STOP
);
$SIG
{
INT
}
=
sub
{
$STOP
=
1
;
print
"
SIGINT received
\n
";
};
if
(
$op_mode
eq
'
refresh
')
{
...
...
@@ -155,7 +157,7 @@ if ($op_mode eq 'refresh')
unless
(
defined
(
$store_cfg
))
{
print
"
no store config found for '
$store
', check these:
",
Dumper
(
$stores_p
);
exit
(
-
2
);
exit
(
2
);
}
# ZZZ
...
...
@@ -223,7 +225,7 @@ elsif ($op_mode eq 'get-cat')
unless
(
defined
(
$store_cfg
))
{
print
"
no store config found for '
$store
', check these:
",
Dumper
(
$stores_p
);
exit
(
-
2
);
exit
(
2
);
}
print
"
store_cfg:
",
Dumper
(
$store_cfg
)
if
(
$DEBUG
);
...
...
@@ -238,6 +240,12 @@ elsif ($op_mode eq 'next-seq')
# print "objreg: (after refresh)", Dumper ($objreg);
if
(
$STOP
)
{
print
"
STOP set, exit 2
\n
";
exit
(
2
);
}
exit
(
0
);
sub
usage
...
...
@@ -256,7 +264,9 @@ sub event_die
{
my
$msg
=
shift
;
# TODO: write to MongoDB if an event collection is known
die
$msg
;
print
join
('
',
caller
),
"
\n
";
print
$msg
;
exit
(
2
);
}
sub
refresh_md5cat
...
...
@@ -379,6 +389,12 @@ sub refresh_internal
print
"
\n
pass 2
\n
";
my
$new_files
=
$md5cat
->
check_new_files
(
$limit
);
# print "new_files: ", Dumper ($new_files);
unless
(
$md5cat
->
run
())
{
print
"
SIGINT received in
\$
md5cat->check_new_files()
\n
";
$STOP
=
1
;
}
# print __LINE__, " integrate_md5_sums\n";
$md5cat
->
integrate_md5_sums
(
$new_files
);
# $md5cat->save_catalog (); # TODO: if save_catalog flag is true!
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment