Re: Script to Clean Up Orphans



This is a multi-part message in MIME format.
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
mlissner michaeljaylissner com
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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]