Merge branch 'master' of ssh://git-annex.branchable.com

This commit is contained in:
Joey Hess 2014-04-07 17:31:02 -04:00
commit cf99e48ef0
8 changed files with 46 additions and 4 deletions

View file

@ -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 ()

7
debian/changelog vendored
View file

@ -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.

2
debian/control vendored
View file

@ -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],

View file

@ -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.)
"""]]

View file

@ -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.

View file

@ -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

View file

@ -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]]

View file

@ -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)