Bug 498077 - digitaglinktree fails with blkid and does wrong uuid extraction [patch]
Summary: digitaglinktree fails with blkid and does wrong uuid extraction [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Setup-CLI (show other bugs)
Version: 8.5.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-31 08:50 UTC by Dr. Jürgen Hannappel
Modified: 2024-12-31 09:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 8.6.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dr. Jürgen Hannappel 2024-12-31 08:50:29 UTC
SUMMARY
at least on opensuse tumbleweed digitaglinktree fails in the getAlbumRoots{() function trying to use blkid

STEPS TO REPRODUCE
1.   call digitaglinktree

OBSERVED RESULT
digitaglinktree -d /data/fotos/digikam4.db -l $(pwd)/tags
Cannot find device /dev/disk/by-uuid/ae0e20a3-b7eb-4ac1-9ecc-d91992003348 or  ..../AE0E20A3-B7EB-4AC1-9ECC-D91992003348. Skipped.
Processed 0 photos. 


EXPECTED RESULT
normal operation

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
I traced the problem to two issues:
On opensuse a call like
    $uuiddev=`blkid -U $uuid`;
 fails because some nanny script says:
   Absolute path to 'blkid' is '/usr/sbin/blkid', so running it may require superuser privileges (eg. root).
Fix: Use:
   $blkid = `PATH=\$PATH:/usr/sbin/ which blkid`
   chomp $blkid
   $uuiddev=`$blkid -U $uuid`;

Other issue: Extracxing the uuid from the identifier with
   $uuid=$identifier;
   $uuid=~s/^.*uuid=//i;
Doesn't work,
  ($uuid) = $identifier =~ /\?uuid=([-0-9a-z]+)\&/;
does..


So the total diff to fix the bug would be:
diff digitaglinktree /usr/bin/digitaglinktree
839,841c839,840
< 	 $blkid = `PATH=\$PATH:/usr/sbin/ which blkid`;
< 	 chomp $blkid;
<          ($uuid) = $identifier =~ /\?uuid=([-0-9a-z]+)\&/;
---
> 	 $uuid=$identifier;
> 	 $uuid=~s/^.*uuid=//i; 
844c843
< 	    $uuiddev=`$blkid -U $uuid`;
---
> 	    $uuiddev=`blkid -U $uuid`;
847c846
< 	    $uuiddev=`$blkid -U $ucuuid`;
---
> 	    $uuiddev=`blkid -U $ucuuid`;
Comment 1 caulier.gilles 2024-12-31 09:11:42 UTC
Git commit a0ee498d87329b71fe93fff576017afaaef306d4 by Gilles Caulier.
Committed on 31/12/2024 at 09:10.
Pushed by cgilles into branch 'master'.

Apply patch from Jürgen Hannappel
FIXED-IN: 8.6.0

M  +5    -4    core/data/scripts/digitaglinktree/digitaglinktree

https://invent.kde.org/graphics/digikam/-/commit/a0ee498d87329b71fe93fff576017afaaef306d4