/usr/share/perl5/UR/DataSource/Code.pm is in libur-perl 0.430-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | package UR::DataSource::Code;
use strict;
use warnings;
require UR;
our $VERSION = "0.43"; # UR $VERSION;
use File::Copy qw//;
##- use UR;
UR::Object::Type->define(
class_name => 'UR::DataSource::Code',
is => ['UR::DataSource::SQLite'],
);
sub server {
my $self = shift->_singleton_object();
my $path = $self->__meta__->module_path;
$path =~ s/\.pm$/.db/ or Carp::confess("Bad module path for resolving server!");
unless (-e $path) {
# initialize a new database from the one in the base class
# should this be moved to connect time?
my $template_database_file = UR::DataSource::Code->server();
if ($self->class eq __PACKAGE__) {
Carp::confess("Missing template database file: $path!");
}
unless (-e $template_database_file) {
Carp::confess("Missing template database file: $path! Cannot initialize database for " . $self->class);
}
unless(File::Copy::copy($template_database_file,$path)) {
Carp::confess("Error copying $path to $template_database_file to initialize database!");
}
unless(-e $path) {
Carp::confess("File $path not found after copy from $template_database_file. Cannot initialize database!");
}
}
return $path;
}
sub resolve_class_name_for_table_name_fixups {
my $self = shift->_singleton_object;
print "fixup @_";
return $self->class . "::", @_;
}
1;
|