Modify

Ticket #10325 (accepted Patch - Feature)

Opened 16 months ago

Last modified 4 months ago

Modify mythlink.pl to allow relative file names to be used in the links

Reported by: Nick Martin <njm@…> Owned by: mdean
Priority: minor Milestone: unknown
Component: Contributed Scripts & Apps Version: 0.24-fixes
Severity: medium Keywords: mythlink.pl relative
Cc: Ticket locked: no

Description

This is useful if your links directory and recordings directory are both in a directory tree exported by an NFS server. Links to absolute file names will be broken in the NFS clients, but links to relative file names will be ok.

E.g., if /home is exported on an NFS server with the following dirs:

/home/nick/links
/home/mythtv/recordings

...and the exported /home is mounted by an NFS client at /mnt/mythtv, then

/mnt/mythtv/nick/links/Title.mpg -> /home/mythtv/recordings/1004_20111224115800.mpg is broken
/mnt/mythtv/nick/links/Title.mpg -> ../../mythtv/recordings/1004_20111224115800.mpg is ok

The attached patch adds a --relative option to allow relative file names to be used in the links created by mythlink.pl.

Attachments

mythlink.pl.patch (1.8 KB) - added by Nick Martin <njm@…> 16 months ago.

Change History

Changed 16 months ago by Nick Martin <njm@…>

comment:1 Changed 16 months ago by mdean

  • Owner changed from xris to mdean
  • Status changed from new to accepted

comment:2 Changed 16 months ago by mdean

  • Component changed from Apps - Nuvexport to Contributed Scripts & Apps

comment:3 follow-up: ↓ 4 Changed 5 months ago by mythtvorg@…

There is a bug in this patch!

The added line:

$local_path = File::Spec->abs2rel($local_path, $dest);

Should be:

$local_path = File::Spec->abs2rel($local_path, $dirname);

Because $name may be of form "tv_show/episode" in which case the final directory will be attached to $name and missing from $dest.

Luckily, the existing code defines already: my $directory = dirname("$dest/$name");

comment:4 in reply to: ↑ 3 Changed 4 months ago by justpaul@…

Replying to mythtvorg@…: The "should be":

$local_path = File::Spec->abs2rel($local_path, $dirname);

Should really be:

$local_path = File::Spec->abs2rel($local_path, $directory);

$dirname is undefined.

comment:5 Changed 4 months ago by mythtv@…

You are absolutely right! For some reason, I typo'd when copying over the code...

View

Add a comment

Modify Ticket

Action
as accepted
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.