Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ensembl-gh-mirror
ensembl
Commits
594987de
Commit
594987de
authored
18 years ago
by
Steve Trevanion
Browse files
Options
Downloads
Patches
Plain Diff
merge from vega-41-dev
parent
d5acf644
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc-scripts/repeats/vega_repeat_libraries.pl
+23
-78
23 additions, 78 deletions
misc-scripts/repeats/vega_repeat_libraries.pl
with
23 additions
and
78 deletions
misc-scripts/repeats/vega_repeat_libraries.pl
+
23
−
78
View file @
594987de
...
...
@@ -108,106 +108,63 @@ if($support->param('prune')){
if
(
check_for_backup_table
()){
# backup table present
if
(
$support
->
user_proceed
("
Replace the current table 'repeat_consensus' with the backup table 'repeat_consensus_backup'?
")){
if
(
$dbh
->
do
("
drop table repeat_consensus
")){
if
(
$dbh
->
do
("
create table repeat_consensus select * from repeat_consensus_backup
")){
$support
->
log
("
prune (undo) was successful
\n
");
if
(
$support
->
user_proceed
("
Replace the current table 'repeat_consensus' with the backup table 'repeat_consensus_backup'?
")){
if
(
$dbh
->
do
("
drop table repeat_consensus
")){
if
(
$dbh
->
do
("
create table repeat_consensus select * from repeat_consensus_backup
")){
$support
->
log
("
prune (undo) was successful
\n
");
$support
->
log_stamped
("
Done.
\n
");
# finish logfile
$support
->
finish_log
;
exit
(
0
);
}
else
{
$support
->
log_error
("
prune failed
\n
");
$support
->
finish_log
;
exit
(
0
);
}
}
else
{
$support
->
log_error
("
prune failed
\n
");
else
{
$support
->
log_error
("
prune failed
\n
");
}
}
else
{
$support
->
log_error
("
prune failed
\n
");
}
}
else
{
#user is aborting
print
"
aborting...
\n
";
$support
->
log_error
("
aborting...
\n
");
}
$support
->
log_error
("
aborting...
\n
");
}
}
else
{
else
{
print
"
Cannot do prune, as no backup table
\n
";
$support
->
log_error
("
Cannot do prune, as no backup table
\n
");
$support
->
log_error
("
Cannot do prune, as no backup table
\n
");
}
}
else
{
# normal run
# check to see if the backup table 'repeat_consensus_backup' already exists
# check to see if the backup table 'repeat_consensus_backup' already exists
if
(
check_for_backup_table
()){
#table already exists: ask user if OK to overwrite it
#table already exists: ask user if OK to overwrite it
if
(
$support
->
user_proceed
("
The backup table 'repeat_consensus_backup' already exists, OK to delete?
"))
{
if
(
$dbh
->
do
("
drop table 'repeat_consensus_backup'
")){
$support
->
log
("
deleted previous backup table
\n
");
make_backup_table
();
}
else
{
$support
->
log_error
("
tried but failed to delete previous backup table
\n
");
}
}
else
{
# user won't allow removing the backup table
print
"
Aborting ...
\n
";
$support
->
log_error
("
User won't allow removal of backup table ... aborting program
\n
");
}
}
else
{
# table doesn't exist, therefore we can create it
make_backup_table
();
}
}
# mouse fixes
if
(
$support
->
species
eq
'
Mus_musculus
')
{
$support
->
log
("
Making Vega mouse specific changes...
\n
");
...
...
@@ -299,15 +256,11 @@ $support->finish_log;
sub
make_backup_table
{
if
(
$dbh
->
do
("
create table repeat_consensus_backup select * from repeat_consensus
")){
$support
->
log
("
backup table 'repeat_consensus_backup was created successfully
\n
");
$support
->
log
("
backup table 'repeat_consensus_backup was created successfully
\n
");
}
else
{
$support
->
log_error
("
failed to create backup table 'repeat_consensus_backup'
\n
");
}
}
sub
check_for_backup_table
{
...
...
@@ -318,18 +271,10 @@ sub check_for_backup_table{
foreach
my
$table
(
@tables
){
#print "$table\n";
if
(
$table
eq
'
`repeat_consensus_backup`
'){
if
(
$table
eq
'
`repeat_consensus_backup`
'){
$found
=
1
;
last
;
}
last
;
}
}
return
$found
;
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Preview
0%
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