From 3701f3f0dcf0f416eaa89d65bc9974161b110e5c Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 28 Dec 2013 20:08:54 +0100 Subject: regenerate the original folder (album) structure for each tag --- digitaglinktree-1.8.4beta | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/digitaglinktree-1.8.4beta b/digitaglinktree-1.8.4beta index 1ebcdb6..c0625bf 100755 --- a/digitaglinktree-1.8.4beta +++ b/digitaglinktree-1.8.4beta @@ -441,7 +441,17 @@ sub createLinkTree{ if(length($opt_absolute)){ # Create link $sourceDir="${photoRootDir}$path/$image"; - $destDir="${linktreeRootDir}/$tag/$linkName"; + $destDir="${linktreeRootDir}/$tag$path/$linkName"; + + print "$sourceDir -> $destDir\n"; + + if ( ! -d "${linktreeRootDir}/$tag$path" ) { + $ret=mkpath("${linktreeRootDir}/$tag$path", 0, 0755); + } + + if( !$ret ){ + die "Cannot mkdir \"${linktreeRootDir}/$tag$path\"\n"; + } }else{ # Get relative path from absolute one # $rel=File::Spec->abs2rel( $path, $base ) ; @@ -837,6 +847,7 @@ sub usage{ " -C If -A was given this option will put hardlinks of all\n", " photos in the \"$archiveDirPhotos\" directory not only of those with tags.\n", " -a Create absolute symbolic links instead of relative ones \n", + " and regenerate the original folder (album) structure for each tag \n", " -H Use hard links instead of symbolic links in linktree. \n", " -Y Add Year directory below each tag directory \n", " -f If there are hierarchical tags (tags that have subtags) \n", -- cgit v1.2.3