summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-04-07 17:31:02 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-04-07 17:31:02 -0400
commit0664c3dd3af3cb28878852f5f58f48587a246daa (patch)
tree7ec2ba8cdf4631d83935ad31022074d63de2a17f
parentc1bd3a26491c94ac8bee2d29291ad39b440dd400 (diff)
parent9effe0bc8bcede580a73149406d242167d0678c2 (diff)
Merge branch 'master' of ssh://git-annex.branchable.com
-rw-r--r--Command/ImportFeed.hs9
-rw-r--r--debian/changelog7
-rw-r--r--debian/control2
-rw-r--r--doc/bugs/Assistant_having_a_child_git_cat-file_--batch_do_the_same_thing_over_and_over_and_using_a_lot_of_memory/comment_2_b2941bf7901a1b2237b7210c8f0af2a5._comment22
-rw-r--r--doc/git-annex.mdwn2
-rw-r--r--doc/tips/downloading_podcasts.mdwn3
-rw-r--r--doc/todo/make___34__itemdate__34___valid_importfeed_template_option.mdwn3
-rw-r--r--git-annex.cabal2
8 files changed, 46 insertions, 4 deletions
diff --git a/Command/ImportFeed.hs b/Command/ImportFeed.hs
index 50f4278b6..3f629af6e 100644
--- a/Command/ImportFeed.hs
+++ b/Command/ImportFeed.hs
@@ -15,6 +15,8 @@ import Text.Feed.Types
import qualified Data.Set as S
import qualified Data.Map as M
import Data.Time.Clock
+import Data.Time.Format
+import System.Locale
import Common.Annex
import qualified Annex
@@ -212,6 +214,7 @@ feedFile tmpl i extension = Utility.Format.format tmpl $ M.fromList
, fieldMaybe "itemdescription" $ getItemDescription $ item i
, fieldMaybe "itemrights" $ getItemRights $ item i
, fieldMaybe "itemid" $ snd <$> getItemId (item i)
+ , fieldMaybe "itempubdate" $ pubdate $ item i
, ("extension", sanitizeFilePath extension)
]
where
@@ -221,6 +224,12 @@ feedFile tmpl i extension = Utility.Format.format tmpl $ M.fromList
fieldMaybe k Nothing = (k, "none")
fieldMaybe k (Just v) = field k v
+ pubdate itm = case getItemPublishDate itm :: Maybe (Maybe UTCTime) of
+ Just (Just d) -> Just $
+ formatTime defaultTimeLocale "%F" d
+ -- if date cannot be parsed, use the raw string
+ _ -> replace "/" "-" <$> getItemPublishDateString itm
+
{- Called when there is a problem with a feed.
- Throws an error if the feed is broken, otherwise shows a warning. -}
feedProblem :: URLString -> String -> Annex ()
diff --git a/debian/changelog b/debian/changelog
index 3d316fc7b..996f0ef04 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+git-annex (5.20140406) UNRELEASED; urgency=medium
+
+ * importfeed: Filename template can now contain an itempubdate variable.
+ Needs feed 0.3.9.2.
+
+ -- Joey Hess <joeyh@debian.org> Mon, 07 Apr 2014 16:22:02 -0400
+
git-annex (5.20140405) unstable; urgency=medium
* git-annex-shell: Added notifychanges command.
diff --git a/debian/control b/debian/control
index dd7eaa848..1a2aaed70 100644
--- a/debian/control
+++ b/debian/control
@@ -55,7 +55,7 @@ Build-Depends:
libghc-xml-types-dev,
libghc-async-dev,
libghc-http-dev,
- libghc-feed-dev,
+ libghc-feed-dev (>= 0.3.9.2),
libghc-regex-tdfa-dev [!mipsel !s390],
libghc-regex-compat-dev [mipsel s390],
libghc-tasty-dev (>= 0.7) [!mipsel !sparc],
diff --git a/doc/bugs/Assistant_having_a_child_git_cat-file_--batch_do_the_same_thing_over_and_over_and_using_a_lot_of_memory/comment_2_b2941bf7901a1b2237b7210c8f0af2a5._comment b/doc/bugs/Assistant_having_a_child_git_cat-file_--batch_do_the_same_thing_over_and_over_and_using_a_lot_of_memory/comment_2_b2941bf7901a1b2237b7210c8f0af2a5._comment
new file mode 100644
index 000000000..c9e798c28
--- /dev/null
+++ b/doc/bugs/Assistant_having_a_child_git_cat-file_--batch_do_the_same_thing_over_and_over_and_using_a_lot_of_memory/comment_2_b2941bf7901a1b2237b7210c8f0af2a5._comment
@@ -0,0 +1,22 @@
+[[!comment format=mdwn
+ username="http://joeyh.name/"
+ ip="209.250.56.244"
+ subject="comment 2"
+ date="2014-04-07T21:07:35Z"
+ content="""
+Except of log when this apparently happened. Note the 6 minute time discontinuity when it was apparently looping:
+
+<pre>
+[2014-04-07 23:24:24 EEST] read: git [\"--git-dir=/storage/sarjat/annex-sarjat/.git\",\"--work-tree=/storage/sarjat/annex-sarjat\",\"write-tree\"]
+[2014-04-07 23:24:24 EEST] read: git [\"--git-dir=/storage/sarjat/annex-sarjat/.git\",\"--work-tree=/storage/sarjat/annex-sarjat\",\"rev-parse\",\"84068090af4bcd3d24f16d865ac07b0478f20ada:\"]
+[2014-04-07 23:24:24 EEST] read: git [\"--git-dir=/storage/sarjat/annex-sarjat/.git\",\"--work-tree=/storage/sarjat/annex-sarjat\",\"symbolic-ref\",\"HEAD\"]
+[2014-04-07 23:24:24 EEST] read: git [\"--git-dir=/storage/sarjat/annex-sarjat/.git\",\"--work-tree=/storage/sarjat/annex-sarjat\",\"show-ref\",\"refs/heads/master\"]
+[2014-04-07 23:30:13 EEST] read: git [\"--git-dir=/storage/sarjat/annex-sarjat/.git\",\"--work-tree=/storage/sarjat/annex-sarjat\",\"show-ref\",\"git-annex\"]
+[2014-04-07 23:30:13 EEST] read: git [\"--git-dir=/storage/sarjat/annex-sarjat/.git\",\"--work-tree=/storage/sarjat/annex-sarjat\",\"show-ref\",\"--hash\",\"refs/heads/git-annex\"]
+[2014-04-07 23:30:13 EEST] read: git [\"--git-dir=/storage/sarjat/annex-sarjat/.git\",\"--work-tree=/storage/sarjat/annex-sarjat\",\"log\",\"refs/heads/git-annex..214ed317536695b91c8dd5bed059c46c11ad00be\",\"--oneline\",\"-n1\"]
+</pre>
+
+Also probably relevant, the network topology AIUI was: `client --> server` where both nodes ran the assistant. This happened on the server shortly after the client dropped off a refs/heads/synced/master.
+
+(Also, the \"logging to a deleted file\" appears to have been a local misconfiguration; a cron job that repeatedly tried to start the assistant. Only one will start, but later ones will rotate the logs before noticing it's running and giving up.)
+"""]]
diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn
index 2d43953af..03e05d934 100644
--- a/doc/git-annex.mdwn
+++ b/doc/git-annex.mdwn
@@ -268,7 +268,7 @@ subdirectories).
Use `--template` to control where the files are stored.
The default template is '${feedtitle}/${itemtitle}${extension}'
- (Other available variables: feedauthor, itemauthor, itemsummary, itemdescription, itemrights, itemid)
+ (Other available variables: feedauthor, itemauthor, itemsummary, itemdescription, itemrights, itemid, itempubdate)
The `--relaxed` and `--fast` options behave the same as they do in addurl.
diff --git a/doc/tips/downloading_podcasts.mdwn b/doc/tips/downloading_podcasts.mdwn
index d412a73bf..876d8d4e1 100644
--- a/doc/tips/downloading_podcasts.mdwn
+++ b/doc/tips/downloading_podcasts.mdwn
@@ -23,7 +23,8 @@ there's a --template option. The default is
`--template='${feedtitle}/${itemtitle}${extension}'`
Other available template variables:
-feedauthor, itemauthor, itemsummary, itemdescription, itemrights, itemid
+feedauthor, itemauthor, itemsummary, itemdescription, itemrights, itemid,
+itempubdate
## catching up
diff --git a/doc/todo/make___34__itemdate__34___valid_importfeed_template_option.mdwn b/doc/todo/make___34__itemdate__34___valid_importfeed_template_option.mdwn
index 31978a7b6..9b6f6ce7c 100644
--- a/doc/todo/make___34__itemdate__34___valid_importfeed_template_option.mdwn
+++ b/doc/todo/make___34__itemdate__34___valid_importfeed_template_option.mdwn
@@ -13,3 +13,6 @@ or
that "works" but is ugly :)
Would love to be able to put a YYYYMMDD at the beginning and then the title.
+
+> [[done]]; itempubdate will use form YYYY-MM-DD (or the raw date string
+> if the feed does not use a parsable form). --[[Joey]]
diff --git a/git-annex.cabal b/git-annex.cabal
index a91540bbf..59b7b3a59 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -210,7 +210,7 @@ Executable git-annex
CPP-Options: -DWITH_DNS
if flag(Feed)
- Build-Depends: feed
+ Build-Depends: feed (>= 0.3.9.2)
CPP-Options: -DWITH_FEED
if flag(Quvi)