Commit 737afccd authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add routine to get stuff out of the version_info table.

parent b7f47d56
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Utility routines for Emulab.
......@@ -14,7 +14,7 @@ use vars qw(@ISA @EXPORT);
@ISA = qw(Exporter SelfLoader);
@EXPORT = qw(TBDB_CHECKDBSLOT_NOFLAGS TBDB_CHECKDBSLOT_WARN
TBDB_CHECKDBSLOT_ERROR TBcheck_dbslot TBFieldErrorString
TBGetUniqueIndex ParRun);
TBGetUniqueIndex ParRun VersionInfo);
use emdb;
use English;
......@@ -461,5 +461,23 @@ sub ParRun($$$@)
return 0;
}
#
# Version Info
#
sub VersionInfo($)
{
my ($name) = @_;
my $query_result =
DBQueryWarn("select value from version_info ".
"where name='$name'");
return undef
if (!$query_result || !$query_result->numrows);
my ($value) = $query_result->fetchrow_array();
return $value;
}
# _Always_ make sure that this 1 is at the end of the file...
1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment