summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Types/StandardGroups.hs21
-rw-r--r--debian/changelog3
-rw-r--r--doc/preferred_content.mdwn20
-rw-r--r--doc/todo/assistant_smarter_archive_directory_handling.mdwn2
4 files changed, 28 insertions, 18 deletions
diff --git a/Types/StandardGroups.hs b/Types/StandardGroups.hs
index 434600f3f..417d6bec1 100644
--- a/Types/StandardGroups.hs
+++ b/Types/StandardGroups.hs
@@ -55,21 +55,22 @@ descStandardGroup UnwantedGroup = "unwanted: remove content from this repository
{- See doc/preferred_content.mdwn for explanations of these expressions. -}
preferredContent :: StandardGroup -> String
-preferredContent ClientGroup = lastResort
- "exclude=*/archive/* and exclude=archive/*"
-preferredContent TransferGroup = lastResort
- "not (inallgroup=client and copies=client:2) and " ++ preferredContent ClientGroup
+preferredContent ClientGroup = lastResort $
+ "(exclude=*/archive/* and exclude=archive/*) or (" ++ notArchived ++ ")"
+preferredContent TransferGroup = lastResort $
+ "not (inallgroup=client and copies=client:2) and (" ++ preferredContent ClientGroup ++ ")"
preferredContent BackupGroup = "include=*"
-preferredContent IncrementalBackupGroup = lastResort
+preferredContent IncrementalBackupGroup = lastResort $
"include=* and (not copies=incrementalbackup:1)"
preferredContent SmallArchiveGroup = lastResort $
- "(include=*/archive/* or include=archive/*) and " ++ preferredContent FullArchiveGroup
-preferredContent FullArchiveGroup = lastResort
- "not (copies=archive:1 or copies=smallarchive:1)"
+ "(include=*/archive/* or include=archive/*) and (" ++ preferredContent FullArchiveGroup ++ ")"
+preferredContent FullArchiveGroup = lastResort notArchived
preferredContent SourceGroup = "not (copies=1)"
-preferredContent ManualGroup = lastResort
- "present and exclude=*/archive/* and exclude=archive/*"
+preferredContent ManualGroup = "present and (" ++ preferredContent ClientGroup ++ ")"
preferredContent UnwantedGroup = "exclude=*"
+
+notArchived :: String
+notArchived = "not (copies=archive:1 or copies=smallarchive:1)"
{- Most repositories want any content that is only on untrusted
- or dead repositories. -}
diff --git a/debian/changelog b/debian/changelog
index a112c1cbd..57f7223ae 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,9 @@ git-annex (4.20130406) UNRELEASED; urgency=low
remotes, to avoid delays.
Thanks, guilhem for the patch.
* Bugfix: Direct mode no longer repeatedly checksums duplicated files.
+ * Adjust preferred content expressions so that content in archive
+ directories is preferred until it has reached an archive or smallarchive
+ repository.
-- Joey Hess <joeyh@debian.org> Sat, 06 Apr 2013 15:24:15 -0400
diff --git a/doc/preferred_content.mdwn b/doc/preferred_content.mdwn
index f8fd29c9d..1bcdfdf07 100644
--- a/doc/preferred_content.mdwn
+++ b/doc/preferred_content.mdwn
@@ -86,9 +86,10 @@ any repository that can will back it up.)
### client
-All content is preferred, unless it's in a "archive" directory.
+All content is preferred, unless it's for a file in a "archive" directory,
+which has reached an archive repository.
-`(exclude=*/archive/* and exclude=archive/*) or (not copies=semitrusted+:1)`
+`((exclude=*/archive/* and exclude=archive/*) or (not (copies=archive:1 or copies=smallarchive:1))) or (not copies=semitrusted+:1)`
### transfer
@@ -100,7 +101,7 @@ USB drive used in a sneakernet.
The preferred content expression for these causes them to get and retain
data until all clients have a copy.
-`(not (inallgroup=client and copies=client:2) and exclude=*/archive/* and exclude=archive/*) or (not copies=semitrusted+:1)`
+`(not (inallgroup=client and copies=client:2) and ($client)`
The "copies=client:2" part of the above handles the case where
there is only one client repository. It makes a transfer repository
@@ -152,15 +153,18 @@ data until a copy has been sent to some other repository.
### manual
-This gives you full manual control over what content is stored in the
+This gives you nearly full manual control over what content is stored in the
repository. This allows using the [[assistant]] without it trying to keep a
local copy of every file. Instead, you can manually run `git annex get`,
-`git annex drop`, etc to manage content.
+`git annex drop`, etc to manage content. Only content that is present
+is preferred.
-Only content that is present is preferred. Content in "archive"
-directories is never preferred.
+The exception to this manual control is that content that a client
+repository would not want is not preferred. So, files in archive
+directories are not preferred once their content has
+reached an archive repository.
-`(present and exclude=*/archive/* and exclude=archive/*) or (not copies=semitrusted+:1)`
+`present and ($client)`
### unwanted
diff --git a/doc/todo/assistant_smarter_archive_directory_handling.mdwn b/doc/todo/assistant_smarter_archive_directory_handling.mdwn
index f464c182b..fa5a3e4fc 100644
--- a/doc/todo/assistant_smarter_archive_directory_handling.mdwn
+++ b/doc/todo/assistant_smarter_archive_directory_handling.mdwn
@@ -27,3 +27,5 @@ Something vaguely like this should work as the preferred content
expression for the clients:
exclude=archive/* or (include=archive/* and (not (copies=archive:1 or copies=smallarchive:1)))
+
+> [[done]] --[[Joey]]