Index: trunk/DataStoreServer/scripts/dsreg
===================================================================
--- trunk/DataStoreServer/scripts/dsreg	(revision 17895)
+++ trunk/DataStoreServer/scripts/dsreg	(revision 17948)
@@ -15,4 +15,5 @@
 use PS::IPP::Metadata::List qw( parse_md_list );
 use File::Copy;
+use File::Basename;
 
 use PS::IPP::Config qw($PS_EXIT_SUCCESS
@@ -37,4 +38,5 @@
 my $copyfiles;      # if set, copy files from this directory to the Data Store fileset
 my $datapath;       # source for files required if $linkfiles or $copyfiles
+my $abspath;			# Path specified is absolute
 
 my $dbname;         # Database name
@@ -60,4 +62,5 @@
         'type=s'        =>      \$fstype,
         'datapath=s'    =>      \$datapath,
+	'abspath'       =>      \$abspath,
         'link'          =>      \$linkfiles,
         'copy'          =>      \$copyfiles,
@@ -92,5 +95,5 @@
         $err .= "only one of --link and --copy is allowed\n";
     }
-    if (($linkfiles or $copyfiles) and !$datapath) {
+    if (($linkfiles or $copyfiles) and !$datapath and !$abspath) {
         $err .= "need to specify datapath with --link or --copy\n";
     }
@@ -293,6 +296,7 @@
             ## then copy or symlink the files into place
             foreach my $ref (@files) {
-                my $src = "$datapath/$ref->{file}";
-                my $dest = "$fileset_dir/$ref->{file}";
+                my $src = (defined $abspath ? '' : "$datapath/") . "$ref->{file}";
+		my $filename = fileparse($ref->{file}, ());
+                my $dest = "$fileset_dir/$filename";
 
                 if ($linkfiles) {
@@ -319,6 +323,6 @@
     # now calculate the md5sum and file size
     foreach my $file (@files) {
-
-        my $path = "$fileset_dir/$file->{file}";
+	my $filename = fileparse($file->{file}, ());
+        my $path = "$fileset_dir/$filename";
         my @finfo = stat("$path");
 
@@ -364,4 +368,5 @@
 
         foreach my $ref (@files) {
+	    my $filename = fileparse($ref->{file}, ());
             my $query = "INSERT INTO dsFile" .  
                     " (fileset_id, file_id, file_name, bytes, md5sum, type," .
@@ -371,10 +376,10 @@
 
             my $aref = $ref->{ts_cols};
-            my $do_args =  [($ref->{file}, $ref->{bytes}, $ref->{md5sum}, $ref->{type}), @$aref];
+            my $do_args =  [($filename, $ref->{bytes}, $ref->{md5sum}, $ref->{type}), @$aref];
 
             $count = $dbh->do($query, undef, @$do_args);
 
             if ($count == 0E0) {
-                die("failed to insert $ref->{file} into $fileset");
+                die("failed to insert $filename into $fileset");
             }
         }
