Re: [Tracker] Migrating tracker-utils/ into one 'tracker' command



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Martyn,

I like this idea a lot. Would it also be possible to make
tracker-$name in argv[0] to be recognized by the new 'tracker'
command's command line parsing to be the same as $name in argv[1]?

Then for one release we could just make symlinks from the old tool
names to the tracker binary, and keep the symlinks for one point
release (to maintain backward compatibility with scripts made with the
old tools' names in the bin directory).

That way we get the git commandline UI as proposed here, which I like
a lot, and we migrate cleanly to it.

So

tracker sparql -q "select ?a { ?a a nie:InformationElement }"

and

tracker-sparql -q "select ?a { ?a a nie:InformationElement }"

Are the same thing for at least one point release by letting
make-install do a ln -s /usr/bin/tracker /usr/bin/tracker-sparq and
adapt the argv command line to recognize it.

I guess something like (pseudo code)

copyarray(argv, n_argv)
if (s = split(n_argv[0], "-") != null) {
  movearray(n_argv, 1, argc, 2)
  n_argv[1]=s
}
parseargv(n_argv)

Kind regards,

Philip


On 6/10/2014 13:58, Martyn Russell wrote:
Hi all,

So I spent some time last week working on this. I said in some
earlier conversations with the maintainers that I would like to
take things back to basics a bit using a more "git" like approach
to tracker so it becomes more powerful on the command line.


Branch? ------- As part of this, I wanted to merge the command line
utils binaries into one binary in much the same way that Git does.

I have started a branch called "tracker-cmd" here:

https://git.gnome.org/browse/tracker/log/?h=tracker-cmd

It works quite well and also has bash completion available:

trac


Anything left to do? -------------------- I have plans to later add
some new commands like:

$ tracker add /path/to/dir/to/index /another/path ...

and

$ tracker rm /path/to/remove/from/index /and/another ...

Which would update the tracker-miner-fs config...

I've even been thinking about having something like:

$ tracker show {extractors|supported-mime-types|...}

Or something like that, mainly because these are the commonly
asked things when debugging or when trying to understand what
Tracker is using to build the index in the first place.

I would like to know from those of you out there using Tracker in 
projects, what you think is missing from the command line tools to
make life easier? Chances are, we can easily add what you need.

I may also integrate the utils/tracker-resdump/tracker-resdump code
into one of the existing tracker commands.


Examples of what you can do now ------------------------------- To
give you some idea of what this branch already does, here's some 
examples of the newer work....:

*daemon* (previously from tracker-control):

$ tracker daemon -s | -t [daemons] | -k [daemons] | -l $ tracker
daemon -f | -w [ontology] $ tracker daemon --miner <miner>
--pause[-for-process] <reason> $ tracker daemon --miner <miner>
--resume <cookie>

*index* (previously from tracker-control):

$ tracker index --reindex-mime-type <mime1> [[-m [mime2]] ...] $
tracker index --file <file1> [[file2] ...] $ tracker index --import
<file1> [[file2] ...] $ tracker index --backup <file> | --restore
<file>

*reset* (previously from tracker-control):

$ tracker reset [--hard | --soft] [--config]

*sql* (previously utils/tracker-sql/tracker-sql):

$ tracker sql -q <sql> | -f <file>

All other commands like tracker-sparql, tracker-info, tracker-tag,
etc have been merged too of course, e.g.:

$ tracker sparql -q <sparql> [-u] | -f <file> $ tracker sparql -t
[class] [-s <needle>] [-p] $ tracker sparql [-c] [-p] [-x] [-n
[class]] [-i [property]] [-s <needle>] $ tracker sparql
[--get-longhand <class>] [--get-shorthand <class>]


Comments appreciated!


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (MingW32)

iQEcBAEBAgAGBQJUMocdAAoJEEP2NSGEz4aDMxgH/23eKBwulH51k6GBmxBH3e8A
cLEB9CJVrWNB7tXd+rga49tuV/PHJ5QafznbrhxWs0rZLrr27im7VoKDMJwJybrD
XDjtvmEaTkrlRzIrEVTTTDL+SP4a0OW7v3LF4ZAcNGTxEH1M6CqP79iBBZxRREeL
iPa+fLf78KgzO2LgXZOHsW9Lws7/+mhGZoom12l/i6zZvEJrBlvaUeY7rOECVcTq
L1sk9cJIgBUvJ1dyQ1qjPfF7Ykg5b+5cHPyJQB5hDmxLCotRqeB5O4B+8tfxljKi
hdoejlKNWyyQPeLzOudLcfaXvarWJm3+c7phDxKVZt7ZMZecdvekAc8w3mE34aE=
=B4yk
-----END PGP SIGNATURE-----


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