{"action":"created","issue":{"url":"https://api.github.com/repos/nexB/attributecode/issues/276","repository_url":"https://api.github.com/repos/nexB/attributecode","labels_url":"https://api.github.com/repos/nexB/attributecode/issues/276/labels{/name}","comments_url":"https://api.github.com/repos/nexB/attributecode/issues/276/comments","events_url":"https://api.github.com/repos/nexB/attributecode/issues/276/events","html_url":"https://github.com/nexB/attributecode/issues/276","id":203043176,"number":276,"title":"Generate attribution from zip file with component list not working","user":{"login":"chinyeungli","id":4246379,"avatar_url":"https://avatars.githubusercontent.com/u/4246379?v=3","gravatar_id":"","url":"https://api.github.com/users/chinyeungli","html_url":"https://github.com/chinyeungli","followers_url":"https://api.github.com/users/chinyeungli/followers","following_url":"https://api.github.com/users/chinyeungli/following{/other_user}","gists_url":"https://api.github.com/users/chinyeungli/gists{/gist_id}","starred_url":"https://api.github.com/users/chinyeungli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinyeungli/subscriptions","organizations_url":"https://api.github.com/users/chinyeungli/orgs","repos_url":"https://api.github.com/users/chinyeungli/repos","events_url":"https://api.github.com/users/chinyeungli/events{/privacy}","received_events_url":"https://api.github.com/users/chinyeungli/received_events","type":"User","site_admin":false},"labels":[{"id":121528123,"url":"https://api.github.com/repos/nexB/attributecode/labels/High%20priority","name":"High priority","color":"e11d21","default":false},{"id":46903857,"url":"https://api.github.com/repos/nexB/attributecode/labels/Important","name":"Important","color":"f44fff","default":false},{"id":46448915,"url":"https://api.github.com/repos/nexB/attributecode/labels/requirement","name":"requirement","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":{"login":"chinyeungli","id":4246379,"avatar_url":"https://avatars.githubusercontent.com/u/4246379?v=3","gravatar_id":"","url":"https://api.github.com/users/chinyeungli","html_url":"https://github.com/chinyeungli","followers_url":"https://api.github.com/users/chinyeungli/followers","following_url":"https://api.github.com/users/chinyeungli/following{/other_user}","gists_url":"https://api.github.com/users/chinyeungli/gists{/gist_id}","starred_url":"https://api.github.com/users/chinyeungli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinyeungli/subscriptions","organizations_url":"https://api.github.com/users/chinyeungli/orgs","repos_url":"https://api.github.com/users/chinyeungli/repos","events_url":"https://api.github.com/users/chinyeungli/events{/privacy}","received_events_url":"https://api.github.com/users/chinyeungli/received_events","type":"User","site_admin":false},"assignees":[{"login":"chinyeungli","id":4246379,"avatar_url":"https://avatars.githubusercontent.com/u/4246379?v=3","gravatar_id":"","url":"https://api.github.com/users/chinyeungli","html_url":"https://github.com/chinyeungli","followers_url":"https://api.github.com/users/chinyeungli/followers","following_url":"https://api.github.com/users/chinyeungli/following{/other_user}","gists_url":"https://api.github.com/users/chinyeungli/gists{/gist_id}","starred_url":"https://api.github.com/users/chinyeungli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinyeungli/subscriptions","organizations_url":"https://api.github.com/users/chinyeungli/orgs","repos_url":"https://api.github.com/users/chinyeungli/repos","events_url":"https://api.github.com/users/chinyeungli/events{/privacy}","received_events_url":"https://api.github.com/users/chinyeungli/received_events","type":"User","site_admin":false},{"login":"DennisClark","id":4991620,"avatar_url":"https://avatars.githubusercontent.com/u/4991620?v=3","gravatar_id":"","url":"https://api.github.com/users/DennisClark","html_url":"https://github.com/DennisClark","followers_url":"https://api.github.com/users/DennisClark/followers","following_url":"https://api.github.com/users/DennisClark/following{/other_user}","gists_url":"https://api.github.com/users/DennisClark/gists{/gist_id}","starred_url":"https://api.github.com/users/DennisClark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DennisClark/subscriptions","organizations_url":"https://api.github.com/users/DennisClark/orgs","repos_url":"https://api.github.com/users/DennisClark/repos","events_url":"https://api.github.com/users/DennisClark/events{/privacy}","received_events_url":"https://api.github.com/users/DennisClark/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/nexB/attributecode/milestones/2","html_url":"https://github.com/nexB/attributecode/milestone/2","labels_url":"https://api.github.com/repos/nexB/attributecode/milestones/2/labels","id":1229336,"number":2,"title":"version 3","description":"Major changes including using YAML, revamped command line interface and more","creator":{"login":"pombredanne","id":675997,"avatar_url":"https://avatars.githubusercontent.com/u/675997?v=3","gravatar_id":"","url":"https://api.github.com/users/pombredanne","html_url":"https://github.com/pombredanne","followers_url":"https://api.github.com/users/pombredanne/followers","following_url":"https://api.github.com/users/pombredanne/following{/other_user}","gists_url":"https://api.github.com/users/pombredanne/gists{/gist_id}","starred_url":"https://api.github.com/users/pombredanne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pombredanne/subscriptions","organizations_url":"https://api.github.com/users/pombredanne/orgs","repos_url":"https://api.github.com/users/pombredanne/repos","events_url":"https://api.github.com/users/pombredanne/events{/privacy}","received_events_url":"https://api.github.com/users/pombredanne/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":27,"state":"open","created_at":"2015-07-28T12:37:01Z","updated_at":"2017-01-25T08:47:01Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2017-01-25T08:47:01Z","updated_at":"2017-01-26T05:45:40Z","closed_at":null,"body":"Generate attribution with component list from a directory work fine.\r\nHowever, if user zips the `about_files` directory to the `about_files.zip` and run attribution from there, it will not work.\r\nThe code will create a directory named `about_files`, the name of the zip file, under some tmp directory and extract the `about_files.zip` content to that directory and run from there\r\nfor instance,\r\n```\r\n/home/user/tmp/xxxbxbxbxx/about_files/about_files/test.h\r\n```\r\n\r\nThe input has the `/about_files/test.h` as the about file path, so when running the attribution from the created tmp directory, `/home/user/tmp/xxxbxbxbxx/about_files/`, it will look for `/about_files/about_files/test.h` and that's why it is not working (because of the extra `/about_files`)\r\n\r\n@DennisClark I would like to know if this also happens to MacOS or is it a windows issue?"},"comment":{"url":"https://api.github.com/repos/nexB/attributecode/issues/comments/275312529","html_url":"https://github.com/nexB/attributecode/issues/276#issuecomment-275312529","issue_url":"https://api.github.com/repos/nexB/attributecode/issues/276","id":275312529,"user":{"login":"chinyeungli","id":4246379,"avatar_url":"https://avatars.githubusercontent.com/u/4246379?v=3","gravatar_id":"","url":"https://api.github.com/users/chinyeungli","html_url":"https://github.com/chinyeungli","followers_url":"https://api.github.com/users/chinyeungli/followers","following_url":"https://api.github.com/users/chinyeungli/following{/other_user}","gists_url":"https://api.github.com/users/chinyeungli/gists{/gist_id}","starred_url":"https://api.github.com/users/chinyeungli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinyeungli/subscriptions","organizations_url":"https://api.github.com/users/chinyeungli/orgs","repos_url":"https://api.github.com/users/chinyeungli/repos","events_url":"https://api.github.com/users/chinyeungli/events{/privacy}","received_events_url":"https://api.github.com/users/chinyeungli/received_events","type":"User","site_admin":false},"created_at":"2017-01-26T05:45:40Z","updated_at":"2017-01-26T05:45:40Z","body":"The code keeps the last segment of the `base_loc` to become the first segment of the returned path in the `get_relative_path` function\r\ni.e.\r\nthe `base_loc` is \r\n```\r\n/home/User/tmp/xxxxxaaaaa/about_files/\r\n```\r\nand the `about_file_path` from the input begins with `about_files`, so when keeping the last segment from the `base_loc` and join the about_file_path, it will has 2 `about_files` segments in the returned path and this will not match with the `about_file_path` in the component list and causing errors.\r\n\r\nIn another example, if user has the following about_file_path for input:\r\n```\r\n/about_files/test.c\r\n```\r\nand generate about file at\r\n```\r\n/home/User/abc/about_files/test.c.ABOUT\r\n```\r\n\r\nThen, if the user zip it at the `about_files/` level under the named 'metadata.zip', the code will extract this zip file in a tmp location such as `/home/User/tmp/xxxxxaaaaa/metadata/about_files/test.c.ABOUT` with `base_loc` = ``/home/User/tmp/xxxxxaaaaa/metadata/`\r\n\r\nThe previous code will use the last segment of the `base_loc` as the root of the returned path, the tool will try to match the `/metadata/about_files/test.c.ABOUT` with the `about_file_path` from the input component list in genattrib, and it will throw error because there is no `/metadata/about_files/test.c.ABOUT` about_file_path in the component list."}}
{"actor":{"display_login":"chinyeungli"}}