{"action":"created","issue":{"url":"https://api.github.com/repos/openSUSE/obs-service-format_spec_file/issues/17","repository_url":"https://api.github.com/repos/openSUSE/obs-service-format_spec_file","labels_url":"https://api.github.com/repos/openSUSE/obs-service-format_spec_file/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/openSUSE/obs-service-format_spec_file/issues/17/comments","events_url":"https://api.github.com/repos/openSUSE/obs-service-format_spec_file/issues/17/events","html_url":"https://github.com/openSUSE/obs-service-format_spec_file/issues/17","id":177412776,"number":17,"title":"Generated \"spec file for package FOO\" comment has incorrect package name","user":{"login":"peti","id":28323,"avatar_url":"https://avatars.githubusercontent.com/u/28323?v=3","gravatar_id":"","url":"https://api.github.com/users/peti","html_url":"https://github.com/peti","followers_url":"https://api.github.com/users/peti/followers","following_url":"https://api.github.com/users/peti/following{/other_user}","gists_url":"https://api.github.com/users/peti/gists{/gist_id}","starred_url":"https://api.github.com/users/peti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peti/subscriptions","organizations_url":"https://api.github.com/users/peti/orgs","repos_url":"https://api.github.com/users/peti/repos","events_url":"https://api.github.com/users/peti/events{/privacy}","received_events_url":"https://api.github.com/users/peti/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-16T12:23:57Z","updated_at":"2016-09-16T12:27:34Z","closed_at":null,"body":"I committed a spec file update that didn't touch the initial comment section, but according to https://build.opensuse.org/package/rdiff/devel:languages:haskell:lts:7/ghc-yaml?linkrev=base&rev=2 the commit ended up modifying that comment after all, and the generated comment has the package name wrong. I assume that `obs-service-format_spec` is responsible for that change? Would it be possible to fix the script not to mis-detected that package name?"},"comment":{"url":"https://api.github.com/repos/openSUSE/obs-service-format_spec_file/issues/comments/247588032","html_url":"https://github.com/openSUSE/obs-service-format_spec_file/issues/17#issuecomment-247588032","issue_url":"https://api.github.com/repos/openSUSE/obs-service-format_spec_file/issues/17","id":247588032,"user":{"login":"DimStar77","id":532559,"avatar_url":"https://avatars.githubusercontent.com/u/532559?v=3","gravatar_id":"","url":"https://api.github.com/users/DimStar77","html_url":"https://github.com/DimStar77","followers_url":"https://api.github.com/users/DimStar77/followers","following_url":"https://api.github.com/users/DimStar77/following{/other_user}","gists_url":"https://api.github.com/users/DimStar77/gists{/gist_id}","starred_url":"https://api.github.com/users/DimStar77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DimStar77/subscriptions","organizations_url":"https://api.github.com/users/DimStar77/orgs","repos_url":"https://api.github.com/users/DimStar77/repos","events_url":"https://api.github.com/users/DimStar77/events{/privacy}","received_events_url":"https://api.github.com/users/DimStar77/received_events","type":"User","site_admin":false},"created_at":"2016-09-16T12:27:34Z","updated_at":"2016-09-16T12:27:34Z","body":"/usr/lib/obs/service/format_spec_file.files/prepare_spec stumbles over the fact that the Name: tag in the .spec file contains a variable:\r\n\r\n```\r\n%global pkg_name yaml\r\n%bcond_with tests\r\nName:           ghc-%{pkg_name}\r\n```\r\n\r\n```\r\nif ( ! stat ((glob(\"$specdir/$base_package*.spec\"))[0] || \"\") ) {\r\n  $base_package =~ s/[0-9]$//;\r\n}\r\n\r\nif ( ! stat ((glob(\"$specdir/$base_package*.spec\"))[0] || \"\") ) {\r\n  $base_package =~ s/\\-[^\\-]*$//;\r\n}\r\n```\r\nas the file ghc-%{pkg_name}.spec does not exist it strips it to some 'better guess'"}}
{"actor":{"display_login":"DimStar77"}}