{"action":"created","issue":{"url":"https://api.github.com/repos/ximion/appstream/issues/25","repository_url":"https://api.github.com/repos/ximion/appstream","labels_url":"https://api.github.com/repos/ximion/appstream/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/ximion/appstream/issues/25/comments","events_url":"https://api.github.com/repos/ximion/appstream/issues/25/events","html_url":"https://github.com/ximion/appstream/pull/25","id":132688967,"number":25,"title":"as-cache-builder: Cope with no YAML documents","user":{"login":"iainlane","id":321014,"avatar_url":"https://avatars.githubusercontent.com/u/321014?v=3","gravatar_id":"","url":"https://api.github.com/users/iainlane","html_url":"https://github.com/iainlane","followers_url":"https://api.github.com/users/iainlane/followers","following_url":"https://api.github.com/users/iainlane/following{/other_user}","gists_url":"https://api.github.com/users/iainlane/gists{/gist_id}","starred_url":"https://api.github.com/users/iainlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iainlane/subscriptions","organizations_url":"https://api.github.com/users/iainlane/orgs","repos_url":"https://api.github.com/users/iainlane/repos","events_url":"https://api.github.com/users/iainlane/events{/privacy}","received_events_url":"https://api.github.com/users/iainlane/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-10T12:38:29Z","updated_at":"2016-02-10T12:54:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ximion/appstream/pulls/25","html_url":"https://github.com/ximion/appstream/pull/25","diff_url":"https://github.com/ximion/appstream/pull/25.diff","patch_url":"https://github.com/ximion/appstream/pull/25.patch"},"body":"It's possible that a suite/arch will have no packages with AppStream; we\r\nshouldn't crash in that case.\r\n\r\ng_strstr_len will return NULL if the string we're searching for (\"---\")\r\nis not found - this will be the case if there are only the headers and\r\nno further documents. In that case we should read to the end of the\r\nfile.\r\n\r\nWhile doing this, I made this bit (IMO) easier to read by renaming some variables and adding comments, hope you like that."},"comment":{"url":"https://api.github.com/repos/ximion/appstream/issues/comments/182359888","html_url":"https://github.com/ximion/appstream/pull/25#issuecomment-182359888","issue_url":"https://api.github.com/repos/ximion/appstream/issues/25","id":182359888,"user":{"login":"ximion","id":417468,"avatar_url":"https://avatars.githubusercontent.com/u/417468?v=3","gravatar_id":"","url":"https://api.github.com/users/ximion","html_url":"https://github.com/ximion","followers_url":"https://api.github.com/users/ximion/followers","following_url":"https://api.github.com/users/ximion/following{/other_user}","gists_url":"https://api.github.com/users/ximion/gists{/gist_id}","starred_url":"https://api.github.com/users/ximion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ximion/subscriptions","organizations_url":"https://api.github.com/users/ximion/orgs","repos_url":"https://api.github.com/users/ximion/repos","events_url":"https://api.github.com/users/ximion/events{/privacy}","received_events_url":"https://api.github.com/users/ximion/received_events","type":"User","site_admin":false},"created_at":"2016-02-10T12:54:35Z","updated_at":"2016-02-10T12:54:35Z","body":"Looks good - the empty-DEP-11-doc case shouldn't have been missed. This is pretty much the uglies part of the code, unfortunately just scanning the first part of the doc instead of parsing the YAML correctly is also significantly faster (and we don't want to slow down people's `apt update`).\r\n(For the next release, I plan to make the whole code for importing data from APT a bit smarter anyway)."}}