git-annex/Utility
Joey Hess f8e940eb8e Fix bug in parsing of parens in some preferred content expressions. This fixes the behavior of the manual mode group.
The current manual mode preferred content expression is:

"present and (((exclude=*/archive/* and exclude=archive/*) or (not (copies=archive:1 or copies=smallarchive:1))) or (not copies=semitrusted+:1))"

The old matcher misparsed this, to basically:

OR (present and (...)) (not copies=semitrusted+:1))

The paren handling and indeed the whole conversion from tokens to the
matcher was just wrong. The new way may not be the cleverest, but I think
it is correct, and you can see how it pattern matches structurally against
the expressions when parsing them.

That expression is now parsed to:

MAnd (MOp <function>)
  (MOr (MOr (MAnd (MOp <function>) (MOp <function>)) (MNot (MOr (MOp <function>) (MOp <function>))))
    (MNot (MOp <function>)))

Which appears correct, and behaves correct in testing.

Also threw in a simplifier, so the final generated Matcher has less
unnecessary clutter in it. Mostly so that I could more easily read &
confirm them.

Also, added a simple test of the Matcher to the test suite.

There is a small chance of badly formed preferred content expressions
behaving differently than before due to this rewrite.
2013-05-24 21:46:33 -04:00
..
DirWatcher let's put type modules under the parent module, not in a Types directory 2013-03-10 22:24:13 -04:00
Gpg GnuPG options for symmetric encryption. 2013-03-11 09:48:38 -04:00
Applicative.hs pointlessness 2012-06-29 10:00:05 -04:00
Base64.hs tag xmpp pushes with jid 2013-03-06 16:29:19 -04:00
CoProcess.hs refactoring 2013-05-11 23:11:56 -04:00
CopyFile.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
Daemon.hs fix the day's Windows permissions damage 2013-05-14 20:15:14 -04:00
DataUnits.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
DBus.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
Directory.hs better nukefile 2013-05-21 13:03:46 -04:00
DirWatcher.hs assistant: Fix OSX bug that prevented committing changed files to a repository when in indirect mode. 2013-03-17 17:01:43 -04:00
DiskFree.hs tweak 2013-03-13 14:54:52 -04:00
Dot.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
Env.hs fix the day's windows permissions damage 2013-05-12 19:09:48 -04:00
Exception.hs better nukefile 2013-05-21 13:03:46 -04:00
ExternalSHA.hs configure: Better checking that sha commands output in the desired format. 2013-05-08 11:17:09 -04:00
FileMode.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
FileSystemEncoding.hs add decodeW8 2012-09-13 19:14:29 -04:00
Format.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
FreeDesktop.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
FSEvents.hs let's put type modules under the parent module, not in a Types directory 2013-03-10 22:24:13 -04:00
Gpg.hs Allow building with gpg2. 2013-05-19 17:59:58 -04:00
HumanTime.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
InodeCache.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
INotify.hs whups, I didn't mean to commit this, it was in to more quickly test out of limit behavior 2013-04-24 11:52:24 -04:00
JSONStream.hs whitespace fixes 2012-12-13 00:45:27 -04:00
Kqueue.hs let's put type modules under the parent module, not in a Types directory 2013-03-10 22:24:13 -04:00
libdiskfree.c Makefile now builds using cabal, taking advantage of cabal's automatic detection of appropriate build flags. 2013-02-27 02:39:22 -04:00
libdiskfree.h Renamed diskfree.c to avoid OSX case insensativity bug. 2012-04-13 11:26:39 -04:00
libkqueue.c include sys/types.h 2013-04-24 10:39:52 -04:00
libkqueue.h fix prototype 2012-06-19 01:57:19 -04:00
libmounts.c cleanup 2012-07-19 21:20:38 -04:00
libmounts.h Got removable media mount detection working on Android. 2013-05-04 16:19:25 -04:00
LogFile.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
Lsof.hs clean up from windows porting 2013-05-11 18:23:41 -04:00
Matcher.hs Fix bug in parsing of parens in some preferred content expressions. This fixes the behavior of the manual mode group. 2013-05-24 21:46:33 -04:00
Metered.hs webapp: Progess bar fixes for many types of special remotes. 2013-03-28 17:04:37 -04:00
Misc.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
Monad.hs pasto 2012-11-02 12:48:52 -04:00
Mounts.hsc Got removable media mount detection working on Android. 2013-05-04 16:19:25 -04:00
Network.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
NotificationBroadcaster.hs webapp: Fix a race that sometimes caused alerts or other notifications to be missed if they occurred while a page was loading. 2013-03-27 14:56:20 -04:00
OSX.hs squelch warning 2012-11-26 16:29:05 -04:00
Parallel.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
PartialPrelude.hs rename readMaybe to readish 2012-01-23 17:00:10 -04:00
Path.hs fix the day's Windows permissions damage 2013-05-14 20:15:14 -04:00
Percentage.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
Process.hs Fix a zombie that could result when running a process like gpg to read and write to it. 2013-05-19 15:52:22 -04:00
QuickCheck.hs Stop depending on testpack. 2013-02-27 23:23:41 -04:00
Rsync.hs deal with Cygwin rsync paths issue 2013-05-14 13:24:15 -04:00
SafeCommand.hs webapp: Run ssh server probes in a way that will work when the login shell is a monstrosity that should have died 25 years ago, such as csh. 2013-03-29 13:09:30 -04:00
Shell.hs fix use of wrong shebang when android is installing git-annex-shell wrapper on server 2013-05-06 15:58:13 -04:00
SRV.hs Makefile now builds using cabal, taking advantage of cabal's automatic detection of appropriate build flags. 2013-02-27 02:39:22 -04:00
Tense.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
ThreadLock.hs reorg 2012-06-17 14:02:40 -04:00
ThreadScheduler.hs cleanup 2013-03-14 22:05:23 -04:00
TList.hs add two long-running XMPP push threads, no more inversion of control 2013-05-22 15:13:31 -04:00
Tmp.hs rename module 2013-05-12 19:19:28 -04:00
Touch.hsc finished where indentation changes 2012-12-13 00:24:19 -04:00
Url.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
UserInfo.hs fix the day's windows permissions damage 2013-05-12 19:09:48 -04:00
Verifiable.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
WebApp.hs rename module 2013-05-12 19:19:28 -04:00
Yesod.hs don't need any of this on android 2013-04-15 19:32:45 -04:00