duc
duc copied to clipboard
Config file
Hi there
I wish to configure the default directory of the db. but there is no info about the config file syntax
Thanks HY.
Hal> I wish to configure the default directory of the db. but there is Hal> no info about the config file syntax
See the duc(1) man page EXAMPLES section. Put your config if ~/.ducrc in your home directory.
The following sample configuration file defines default parameters for
the duc ls and duc ui commands and defines a global option to
configure the database path which is used by all subcommands
[global]
database /var/cache/duc.db
[ls]
recursive
classify
color
[ui]
no-color
apparent
Thanks a lot
It seems like the config file does not resolve paths : to get the database in ~/.cache/duc.db,
neither ~/.cache/duc.db nor $HOME/.cache/duc.db worked, I had to give the full expanded path /home/myName/.cache/duc.db.
"remisphere" == remisphere @.***> writes:
remisphere> It seems like the config file does not resolve paths : to remisphere> get the database in ~/.cache/duc.db, neither remisphere> ~/.cache/duc.db nor $HOME/.cache/duc.db worked, I had to remisphere> give the full expanded path /home /myName/.cache/duc.db.
Thanks for the report, we'll look into what it would take to fix this issue. Should be a simple fix to just use the realpath(3) call.
John
"John" == John Stoffel @.***> writes:
"remisphere" == remisphere @.***> writes: remisphere> It seems like the config file does not resolve paths : to remisphere> get the database in ~/.cache/duc.db, neither remisphere> ~/.cache/duc.db nor $HOME/.cache/duc.db worked, I had to remisphere> give the full expanded path /home /myName/.cache/duc.db.
John> Thanks for the report, we'll look into what it would take to fix this John> issue. Should be a simple fix to just use the realpath(3) call.
Ok, I've done a patch and pushed it to the 'realpath' branch on github. Can you please pull it down and test it out and let me know if you find any problems? It works for me in my quick and dirty tests.
John
I couldn't get it to work.
Now I get errors like this:
Error opening: /home/myName/~ - Database not found,
Error opening: /home/myName/$HOME - Database not found
I'm running Ubuntu 19.04, my ducrc looks like this:
[global]
database $HOME/.cache/duc.db
[index]
progress
check-hard-links
[ls]
color
classify
graph
I tried several values for database, with ~ and $HOME, with simple, double or no quotes, the errors are the same.
It seems like the specified path is appended to the cwd ; If I move to ~/tmp for example, I get:
Error opening: /home/myName/tmp/~ - Database not found
"remisphere" == remisphere @.***> writes:
remisphere> I couldn't get it to work. remisphere> Now I get errors like this: remisphere> Error opening: /home/myName/~ - Database not found, remisphere> Error opening: /home/myName/$HOME - Database not found
remisphere> I'm running Ubuntu 19.04, remisphere> my ducrc looks like this:
remisphere> [global] remisphere> database $HOME/.cache/duc.db
So $HOME looks like /home/myName correct?
How about if you do:
duc index -d ~/.cache/duc.db /tmp
Does it work then? And did you pull down the 'realpath' branch on github or the master branch? Only the realpath branch has my tweaks.
remisphere> [index] remisphere> progress remisphere> check-hard-links
remisphere> [ls] remisphere> color remisphere> classify remisphere> graph
remisphere> I tried several values for database, with ~ and $HOME, with simple, double or no quotes, the remisphere> errors are the same. remisphere> It seems like the specified path is appended to the cwd ; If I move to ~/tmp for example, I get: remisphere> Error opening: /home/myName/tmp/~ - Database not found
remisphere> — remisphere> You are receiving this because you commented. remisphere> Reply to this email directly, view it on GitHub, or unsubscribe.*
"remisphere" == remisphere @.***> writes:
remisphere> I couldn't get it to work. remisphere> Now I get errors like this: remisphere> Error opening: /home/myName/~ - Database not found, remisphere> Error opening: /home/myName/$HOME - Database not found
remisphere> I'm running Ubuntu 19.04, remisphere> my ducrc looks like this:
remisphere> [global] remisphere> database $HOME/.cache/duc.db
remisphere> [index] remisphere> progress remisphere> check-hard-links
remisphere> [ls] remisphere> color remisphere> classify remisphere> graph
remisphere> I tried several values for database, with ~ and $HOME, remisphere> with simple, double or no quotes, the errors are the same. remisphere> It seems like the specified path is appended to the cwd ; remisphere> If I move to ~/tmp for example, I get: Error opening: remisphere> /home/myName/tmp/~ - Database not found
Ok, I think I've found some bugs in the parsing of command line opts and the ~/.ducrc file as well. I'm slowly trying to chase down the errors.
But for now, I would stronly suggest that you just pass in all your configuration via the command line switches instead. And if you can show that there are bugs that way, then we'll work on fixing them up more quickly.
John