Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
2d003fcc
Commit
2d003fcc
authored
Dec 15, 2005
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Oops, need to check for existing experiments that do not have an
archive!
parent
6a0a1eb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
11 deletions
+39
-11
tbsetup/libArchive.pm.in
tbsetup/libArchive.pm.in
+39
-11
No files found.
tbsetup/libArchive.pm.in
View file @
2d003fcc
...
...
@@ -881,8 +881,9 @@ sub TBExperimentArchiveInfo($$$$)
my
($
archive_idx
,$
exptidx
)
=
$
query_result
->
fetchrow_array
();
return
-
1
if
(
!defined($archive_idx));
#
Need
to
deal
with
no
archive
yet
!
return
1
if
(
!defined($archive_idx) || $archive_idx == 0);
$$
idxp
=
$
archive_idx
if
(
defined
($
idxp
));
...
...
@@ -949,8 +950,11 @@ sub TBExperimentArchiveAddFile($$$)
return
0
if
(
!$MAINSITE || $pid ne $ALLOWEDPID);
my
$
rval
=
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
);
return
0
if
($
rval
>
0
);
return
-
1
if
(
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
)
<
0
);
if
(
$
rval
<
0
);
return
ArchiveAdd
($
archive_idx
,
$
pathname
,
$
view
);
}
...
...
@@ -966,8 +970,11 @@ sub TBExperimentArchiveSavePoint($$$)
return
0
if
(
!$MAINSITE || $pid ne $ALLOWEDPID);
my
$
rval
=
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
);
return
0
if
($
rval
>
0
);
return
-
1
if
(
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
)
<
0
);
if
(
$
rval
<
0
);
#
#
Derive
a
tag
that
contains
some
useful
info
?
...
...
@@ -991,8 +998,11 @@ sub TBExperimentArchivePreSwapMod($$)
return
0
if
(
!$MAINSITE || $pid ne $ALLOWEDPID);
my
$
rval
=
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
);
return
0
if
($
rval
>
0
);
return
-
1
if
(
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
)
<
0
);
if
(
$
rval
<
0
);
my
$
directory
;
if
(
GetArchiveDirectory
($
archive_idx
,
\$
directory
)
<
0
)
{
...
...
@@ -1073,8 +1083,11 @@ sub TBExperimentArchiveRollBack($$)
return
0
if
(
!$MAINSITE || $pid ne $ALLOWEDPID);
my
$
rval
=
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
);
return
0
if
($
rval
>
0
);
return
-
1
if
(
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
)
<
0
);
if
(
$
rval
<
0
);
my
$
directory
;
if
(
GetArchiveDirectory
($
archive_idx
,
\$
directory
)
<
0
)
{
...
...
@@ -1125,8 +1138,11 @@ sub TBExperimentArchiveSwapModCommit($$)
return
0
if
(
!$MAINSITE || $pid ne $ALLOWEDPID);
my
$
rval
=
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
);
return
0
if
($
rval
>
0
);
return
-
1
if
(
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
)
<
0
);
if
(
$
rval
<
0
);
my
$
directory
;
if
(
GetArchiveDirectory
($
archive_idx
,
\$
directory
)
<
0
)
{
...
...
@@ -1193,8 +1209,11 @@ sub TBCommitExperimentArchive($$$)
return
0
if
(
!$MAINSITE || $pid ne $ALLOWEDPID);
my
$
rval
=
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
);
return
0
if
($
rval
>
0
);
return
-
1
if
(
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
)
<
0
);
if
(
$
rval
<
0
);
#
#
Need
this
below
.
...
...
@@ -1238,8 +1257,11 @@ sub TBArchiveExperimentArchive($$)
return
0
if
(
!$MAINSITE || $pid ne $ALLOWEDPID);
my
$
rval
=
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
);
return
0
if
($
rval
>
0
);
return
-
1
if
(
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
)
<
0
);
if
(
$
rval
<
0
);
return
ArchiveArchive
($
archive_idx
,
TBExptLogDir
($
pid
,
$
eid
));
}
...
...
@@ -1256,8 +1278,11 @@ sub TBDeleteExperimentArchive($$)
return
0
if
(
!$MAINSITE || $pid ne $ALLOWEDPID);
my
$
rval
=
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
);
return
0
if
($
rval
>
0
);
return
-
1
if
(
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
)
<
0
);
if
(
$
rval
<
0
);
return
ArchiveDestroy
($
archive_idx
,
0
);
}
...
...
@@ -1273,8 +1298,11 @@ sub TBDestroyExperimentArchive($$)
return
0
if
(
!$MAINSITE || $pid ne $ALLOWEDPID);
my
$
rval
=
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
);
return
0
if
($
rval
>
0
);
return
-
1
if
(
TBExperimentArchiveInfo
($
pid
,
$
eid
,
\$
archive_idx
,
\$
view
)
<
0
);
if
(
$
rval
<
0
);
return
ArchiveDestroy
($
archive_idx
,
1
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment