If I understand correctly, you're saying that the $XDG variables won't necessarily be in use, and that the script shouldn't count on them being there. And if they're not there, that the default location should be assumed. If that's correct, here's my new DBPATH setting block:
# find our db, and set a var. Checking for XDG path first, since it's the
more recent location of the db
if [ -f $XDG_CONFIG_DIR/f-spot/photos.db ] #checks if the $XDG_CONFIG_DIR
variable is in use
then
DBPATH=$XDG_CONFIG_DIR/f-spot/photos.db
elif [ -f $HOME/.config/f-spot/photos.db ] #uses the default $XDG location,
if that's being used.
then
DBPATH=$HOME/.config/f-spot/photos.db
elif [ -f $HOME/.gnome2/f-spot/photos.db ] #uses the old location of the
DB, if the former aren't in use.
then
DBPATH=$HOME/.gnome2/f-spot/photos.db
else
echo "Error: Could not find database. Damn."
exit 1
fi
Michael Lissner
[email protected]
909-576-4123
Nick Urbanik wrote on 10/17/2009 05:45 PM:
> Dear Michael,
>
> Thanks for your efforts.
>
> On 17/10/09 11:03 -0700, Michael Lissner wrote:
>> Thanks Jean. I updated that so it actually uses a variable for the
>> dbpath, and cleaned up a couple other things as well.
>>
>> The latest version is here:
>> http://michaeljaylissner.com/blog/script-to-cleanup-fspot-database
>
> $ echo $XDG_CONFIG_DIR
>
> $ env | grep CONFIG
> $ ls -l /home/nicku/.config/f-spot/photos.db
>
> I'm using Fedora 11. Your script assumes that XDG_CONFIG_DIR is set.
> From my memory, ~/.config matches some sort of standard:
>
> http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
>
> $XDG_CONFIG_HOME defines the base directory relative to which user
> specific configuration files should be stored. If $XDG_CONFIG_HOME
> is either not set or empty, a default equal to $HOME/.config should
> be used.
>
> So perhaps your default should be $HOME/.config instead of
> $HOME/.gnome2.
>
>
> _______________________________________________
> F-spot-list mailing list
> [email protected]
> http://mail.gnome.org/mailman/listinfo/f-spot-list
>
<<attachment: mlissner.vcf>>
_______________________________________________ F-spot-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/f-spot-list
