Mercurial > bins
comparison debian/patches/10_symlinks_movies @ 4:c5749e43b1d7
Adding debian files (to original 1.1.29)
author | Peter Gervai <grin@grin.hu> |
---|---|
date | Wed, 15 Oct 2008 23:35:35 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:a84c32f131df | 4:c5749e43b1d7 |
---|---|
1 #! /bin/sh /usr/share/dpatch/dpatch-run | |
2 ## 10_symlinks_movies.dpatch by Martin Michlmayr <tbm@cyrius.com> | |
3 ## | |
4 ## DP: Support linkInsteadOfCopy for movies [#334064] | |
5 | |
6 @DPATCH@ | |
7 --- bins-1.1.29.orig/bins | |
8 +++ bins-1.1.29/bins | |
9 @@ -1849,7 +1849,20 @@ | |
10 my $from="$picdir$album$fileInAlbum"; | |
11 my $to="$albumdir$album$fileInAlbum"; | |
12 if ( ! -f $to ) { | |
13 - `cp -p "$from" "$to"`; | |
14 + if ($configHash->{linkInsteadOfCopy}) { | |
15 + my $newpath; | |
16 + if ($configHash->{linkRelative}) { | |
17 + $newpath = relpath($to, $from); | |
18 + } else { | |
19 + $newpath = $from; | |
20 + } | |
21 + beVerboseN("Linking from $to to $newpath...", 2); | |
22 + system("ln", "-sf", $newpath, $to) == 0 | |
23 + or die("\nCannot link $to to $newpath: $?"); | |
24 + } else { | |
25 + beVerboseN("Copying from $from to $to...", 2); | |
26 + `cp -p "$from" "$to"`; | |
27 + } | |
28 } | |
29 } | |
30 } |