summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2007-11-27 15:22:33 +0000
committerAndreas Brachold <vdr07@deltab.de>2007-11-27 15:22:33 +0000
commit73ffd898650f6cb75d323cc438845a3aead1b110 (patch)
treee92d68f9802fd2ae1e7479d0e02935ac350bb1bf /bin
parentaacaa350f7da7c154264897da26d15ff38df46bb (diff)
downloadxxv-73ffd898650f6cb75d323cc438845a3aead1b110.tar.gz
xxv-73ffd898650f6cb75d323cc438845a3aead1b110.tar.bz2
* Database: Change method of version control, use comment from table, instead use table 'VERSION'
* RECORDS: Use MD5 for mapping preview images * RECORDS: Don't use 2nd try to generate preview images * Handle field names from table now with special character, remove prior workaround * TIMER: Search lookup also for description * buildsearch: redesign avoid SQL-Injection * AUTOTIMER: Speed up background scan, compare now only changed und added epg-events
Diffstat (limited to 'bin')
-rwxr-xr-xbin/xxvd55
1 files changed, 10 insertions, 45 deletions
diff --git a/bin/xxvd b/bin/xxvd
index d14b9c1..87291c6 100755
--- a/bin/xxvd
+++ b/bin/xxvd
@@ -43,8 +43,9 @@ $|++;
my $REV = &getRev() || (split(/ /, '$Revision$'))[1];
my $MODULES;
-my $VERSION = '1.0.1';
+my $VERSION = '1.1';
my $VDRVERSION = 0;
+my $DBVERSION = 0;
my $CLEANUP;
my $DBCACHE = {};
my $AFTER = [0 ... 50];
@@ -421,8 +422,8 @@ sub getModule {
my $name = shift || return error('No requested modul defined!');
my ($modname) = grep(/${name}$/, keys %$MODULES);
- unless ($modname) {
- error sprintf("Requested modul '%s' is'nt loaded!",$name);
+ unless ($modname && $MODULES->{$modname}) {
+ panic sprintf("Requested modul '%s' is'nt loaded!",$name);
return undef;
}
@@ -473,21 +474,6 @@ sub getVdrVersion {
}
# ------------------
-sub getDBVersion {
-# ------------------
- my $dbh = shift || return error('No database handle defined!');
-
- # Keine Versionstabelle?
- unless(tableExists($dbh, 'VERSION')) {
- $dbh->do("create table `VERSION` ( `Version` tinyint (4) DEFAULT '0' NOT NULL );");
- $dbh->do(sprintf("insert into `VERSION` ( `Version` ) values ( '%s' );", &getActualDbVersion()));
- }
- my $row = $dbh->selectrow_hashref('select * from VERSION');
- return $row->{Version};
-}
-
-
-# ------------------
sub getConfigFile {
# ------------------
if(defined $PATHS->{DEFINED_CFGFILE} and -r $PATHS->{DEFINED_CFGFILE}) { # user defined file via comandline
@@ -606,31 +592,14 @@ sub restart {
}
# ------------------
-sub getActualDbVersion {
-# ------------------
- my $cmd = sprintf('%s/update-xxv', $PATHS->{CONTRIB});
- my ($aver) = (`$cmd -v`)[-1] =~ /\'(\d+)\'/;
- return $aver;
-}
-
-# ------------------
-sub checkDB {
+sub getDBVersion {
# ------------------
- my $dbh = shift || return error('No database handle defined!');
- my $dbversion = &getDBVersion($dbh);
- my $aver = &getActualDbVersion();
+ return $DBVERSION if($DBVERSION);
- unless($dbversion == $aver) {
- return undef, sprintf(gettext(q|
-------- !PROBLEM! ----------
-Upps, your Version from DB(%d) doesn't match
-with the wished version from xxv-software-packet(%d).
-Please go to contribdir 'cd %s' and start
-'./update-xxv' to upgrade your xxv database!
-------- !PROBLEM! ----------
-|), $dbversion, $aver, $PATHS->{CONTRIB});#'
- }
- return $dbversion;
+ my $cmd = sprintf('%s/update-xxv', $PATHS->{CONTRIB});
+ my ($ver) = (`$cmd -v`)[-1] =~ /\'(\d+)\'/;
+ $DBVERSION = $ver;
+ return $DBVERSION;
}
# ------------------
@@ -753,10 +722,6 @@ sub init_db_connect {
$cfg->{General}->{PWD},
) or return error "Couldn't connect to database";
- # Test on compare Version from DB and Sourcepaket
- my ($dbok, $dberr) = &checkDB($dbh);
- error($dberr) unless($dbok);
-
# Set DBH for Toolsmodule
$Tools::DBH = $dbh;