diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/patches/10_symlinks_movies	Wed Oct 15 23:35:35 2008 +0200
@@ -0,0 +1,30 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10_symlinks_movies.dpatch by Martin Michlmayr <tbm@cyrius.com>
+##
+## DP: Support linkInsteadOfCopy for movies [#334064]
+
+@DPATCH@
+--- bins-1.1.29.orig/bins
++++ bins-1.1.29/bins
+@@ -1849,7 +1849,20 @@
+                     my $from="$picdir$album$fileInAlbum";
+                     my $to="$albumdir$album$fileInAlbum";
+                     if ( ! -f $to ) {
+-                        `cp -p "$from" "$to"`;
++                        if ($configHash->{linkInsteadOfCopy}) {
++                            my $newpath;
++                            if ($configHash->{linkRelative}) {
++                                $newpath = relpath($to, $from);
++                            } else {
++                                $newpath = $from;
++                            }
++                            beVerboseN("Linking from $to to $newpath...", 2);
++                            system("ln", "-sf", $newpath, $to) == 0
++                                or die("\nCannot link $to to $newpath: $?");
++                        } else {
++                            beVerboseN("Copying from $from to $to...", 2);
++                            `cp -p "$from" "$to"`;
++                        }
+                     }
+                 }
+             }