Opened 12 years ago

Closed 2 years ago

#10325 closed Patch - Feature (Trac EOL)

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

Reported by: Nick Martin <njm@…> Owned by: sphery
Priority: minor Milestone: needs_triage
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 (1)

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

Download all attachments as: .zip

Change History (9)

Changed 12 years ago by Nick Martin <njm@…>

Attachment: mythlink.pl.patch added

comment:1 Changed 12 years ago by sphery

Owner: changed from xris to sphery
Status: newaccepted

comment:2 Changed 12 years ago by sphery

Component: Apps - NuvexportContributed Scripts & Apps

comment:3 Changed 11 years 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 11 years 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 11 years ago by mythtv@…

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

comment:6 Changed 6 years ago by sphery

Duplicate ticket/patch posted at #13115 . The implementation from the other ticket is at ​https://github.com/MythTV/mythtv/pull/149 .

comment:7 Changed 4 years ago by Stuart Auchterlonie

Milestone: unknownneeds_triage

comment:8 Changed 2 years ago by Stuart Auchterlonie

Resolution: Trac EOL
Status: acceptedclosed

We have moved all bug tracking to github [1]

If you continue to have this issue, please open a new issue at github, referencing this ticket.

[1] - https://github.com/MythTV/mythtv/issues

Note: See TracTickets for help on using tickets.