{"action":"created","comment":{"url":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments/74373674","id":74373674,"diff_hunk":"@@ -419,51 +421,77 @@ sub process_request {\n     unlink(\"$destdir/rootimg.gz\");\n     unlink(\"$destdir/rootimg.sfs\");\n \n-    $callback->({ info => [\"archive method:$method\"] });\n-    if ($method =~ /cpio/) {\n-        my $compress = \"gzip\";\n-\n-        #use \"pigz\" as the compress tool instead of gzip if \"pigz\" exist\n+    my $suffix;\n+    if ($compress) {\n+        if ($compress eq 'gzip') {\n+            my $isgzip = system(\"bash -c 'type -p gzip' >/dev/null 2>&1\");\n+            unless ($isgzip == 0) {\n+                $callback->({ error => [\"Command gzip does not exist, please make sure it works.\"] });\n+                return 1;\n+            }\n+            $suffix = \"gz\";\n+        } elsif ($compress eq 'pigz') {\n+            my $ispigz = system(\"bash -c 'type -p pigz' >/dev/null 2>&1\");\n+            unless ($ispigz == 0) {\n+                $callback->({ error => [\"Command pigz does not exist, please make sure it works.\"] });\n+                return 1;\n+            }\n+            $suffix = \"gz\";\n+        } elsif ($compress eq 'xz') {\n+            my $isxz = system(\"bash -c 'type -p xz' >/dev/null 2>&1\");\n+            unless ($isxz == 0) {\n+                $callback->({ error => [\"Command xz does not exist, please make sure it works.\"] });\n+                return 1;\n+            }\n+            $suffix = \"xz\";\n+        } else {\n+            $callback->({ error => [\"Invalid compress method '$compress' requested\"], errorcode => [1] });\n+            return 1;\n+        }\n+    } else {\n         my $ispigz = system(\"bash -c 'type -p pigz' >/dev/null 2>&1\");\n         if ($ispigz == 0) {\n             $compress = \"pigz\";\n+        } else {\n+            $callback->({ error => [\"Command pigz does not exist, will use gzip instead.\"] });","path":"xCAT-server/lib/xcat/plugins/packimage.pm","position":57,"original_position":57,"commit_id":"8797b7f618e3607565aaf1333271b6c81dbbbf38","original_commit_id":"8797b7f618e3607565aaf1333271b6c81dbbbf38","user":{"login":"penguhyang","id":13343411,"avatar_url":"https://avatars.githubusercontent.com/u/13343411?v=3","gravatar_id":"","url":"https://api.github.com/users/penguhyang","html_url":"https://github.com/penguhyang","followers_url":"https://api.github.com/users/penguhyang/followers","following_url":"https://api.github.com/users/penguhyang/following{/other_user}","gists_url":"https://api.github.com/users/penguhyang/gists{/gist_id}","starred_url":"https://api.github.com/users/penguhyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penguhyang/subscriptions","organizations_url":"https://api.github.com/users/penguhyang/orgs","repos_url":"https://api.github.com/users/penguhyang/repos","events_url":"https://api.github.com/users/penguhyang/events{/privacy}","received_events_url":"https://api.github.com/users/penguhyang/received_events","type":"User","site_admin":false},"body":"fixed.","created_at":"2016-08-11T06:33:54Z","updated_at":"2016-08-11T06:33:54Z","html_url":"https://github.com/xcat2/xcat-core/pull/1669#discussion_r74373674","pull_request_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/1669","_links":{"self":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments/74373674"},"html":{"href":"https://github.com/xcat2/xcat-core/pull/1669#discussion_r74373674"},"pull_request":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/1669"}}},"pull_request":{"url":"https://api.github.com/repos/xcat2/xcat-core/pulls/1669","id":80894141,"html_url":"https://github.com/xcat2/xcat-core/pull/1669","diff_url":"https://github.com/xcat2/xcat-core/pull/1669.diff","patch_url":"https://github.com/xcat2/xcat-core/pull/1669.patch","issue_url":"https://api.github.com/repos/xcat2/xcat-core/issues/1669","number":1669,"state":"open","locked":false,"title":"add new option -c to indicate compress method for packimage","user":{"login":"penguhyang","id":13343411,"avatar_url":"https://avatars.githubusercontent.com/u/13343411?v=3","gravatar_id":"","url":"https://api.github.com/users/penguhyang","html_url":"https://github.com/penguhyang","followers_url":"https://api.github.com/users/penguhyang/followers","following_url":"https://api.github.com/users/penguhyang/following{/other_user}","gists_url":"https://api.github.com/users/penguhyang/gists{/gist_id}","starred_url":"https://api.github.com/users/penguhyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penguhyang/subscriptions","organizations_url":"https://api.github.com/users/penguhyang/orgs","repos_url":"https://api.github.com/users/penguhyang/repos","events_url":"https://api.github.com/users/penguhyang/events{/privacy}","received_events_url":"https://api.github.com/users/penguhyang/received_events","type":"User","site_admin":false},"body":"-c means compress.\r\nFor example:\r\npackimage -m tar -c pigz osimage","created_at":"2016-08-11T01:35:11Z","updated_at":"2016-08-11T06:33:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4aec68d099bd739499d790e0ab0db6d314cbc986","assignee":{"login":"immarvin","id":5668922,"avatar_url":"https://avatars.githubusercontent.com/u/5668922?v=3","gravatar_id":"","url":"https://api.github.com/users/immarvin","html_url":"https://github.com/immarvin","followers_url":"https://api.github.com/users/immarvin/followers","following_url":"https://api.github.com/users/immarvin/following{/other_user}","gists_url":"https://api.github.com/users/immarvin/gists{/gist_id}","starred_url":"https://api.github.com/users/immarvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/immarvin/subscriptions","organizations_url":"https://api.github.com/users/immarvin/orgs","repos_url":"https://api.github.com/users/immarvin/repos","events_url":"https://api.github.com/users/immarvin/events{/privacy}","received_events_url":"https://api.github.com/users/immarvin/received_events","type":"User","site_admin":false},"assignees":[{"login":"immarvin","id":5668922,"avatar_url":"https://avatars.githubusercontent.com/u/5668922?v=3","gravatar_id":"","url":"https://api.github.com/users/immarvin","html_url":"https://github.com/immarvin","followers_url":"https://api.github.com/users/immarvin/followers","following_url":"https://api.github.com/users/immarvin/following{/other_user}","gists_url":"https://api.github.com/users/immarvin/gists{/gist_id}","starred_url":"https://api.github.com/users/immarvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/immarvin/subscriptions","organizations_url":"https://api.github.com/users/immarvin/orgs","repos_url":"https://api.github.com/users/immarvin/repos","events_url":"https://api.github.com/users/immarvin/events{/privacy}","received_events_url":"https://api.github.com/users/immarvin/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/xcat2/xcat-core/milestones/17","html_url":"https://github.com/xcat2/xcat-core/milestones/2.12.2","labels_url":"https://api.github.com/repos/xcat2/xcat-core/milestones/17/labels","id":1854029,"number":17,"title":"2.12.2","description":"","creator":{"login":"daniceexi","id":10385985,"avatar_url":"https://avatars.githubusercontent.com/u/10385985?v=3","gravatar_id":"","url":"https://api.github.com/users/daniceexi","html_url":"https://github.com/daniceexi","followers_url":"https://api.github.com/users/daniceexi/followers","following_url":"https://api.github.com/users/daniceexi/following{/other_user}","gists_url":"https://api.github.com/users/daniceexi/gists{/gist_id}","starred_url":"https://api.github.com/users/daniceexi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniceexi/subscriptions","organizations_url":"https://api.github.com/users/daniceexi/orgs","repos_url":"https://api.github.com/users/daniceexi/repos","events_url":"https://api.github.com/users/daniceexi/events{/privacy}","received_events_url":"https://api.github.com/users/daniceexi/received_events","type":"User","site_admin":false},"open_issues":88,"closed_issues":111,"state":"open","created_at":"2016-06-29T01:21:43Z","updated_at":"2016-08-11T06:21:23Z","due_on":"2016-08-19T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/1669/commits","review_comments_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/1669/comments","review_comment_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xcat2/xcat-core/issues/1669/comments","statuses_url":"https://api.github.com/repos/xcat2/xcat-core/statuses/8797b7f618e3607565aaf1333271b6c81dbbbf38","head":{"label":"penguhyang:support_compress_packimage","ref":"support_compress_packimage","sha":"8797b7f618e3607565aaf1333271b6c81dbbbf38","user":{"login":"penguhyang","id":13343411,"avatar_url":"https://avatars.githubusercontent.com/u/13343411?v=3","gravatar_id":"","url":"https://api.github.com/users/penguhyang","html_url":"https://github.com/penguhyang","followers_url":"https://api.github.com/users/penguhyang/followers","following_url":"https://api.github.com/users/penguhyang/following{/other_user}","gists_url":"https://api.github.com/users/penguhyang/gists{/gist_id}","starred_url":"https://api.github.com/users/penguhyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penguhyang/subscriptions","organizations_url":"https://api.github.com/users/penguhyang/orgs","repos_url":"https://api.github.com/users/penguhyang/repos","events_url":"https://api.github.com/users/penguhyang/events{/privacy}","received_events_url":"https://api.github.com/users/penguhyang/received_events","type":"User","site_admin":false},"repo":{"id":62190170,"name":"xcat-core","full_name":"penguhyang/xcat-core","owner":{"login":"penguhyang","id":13343411,"avatar_url":"https://avatars.githubusercontent.com/u/13343411?v=3","gravatar_id":"","url":"https://api.github.com/users/penguhyang","html_url":"https://github.com/penguhyang","followers_url":"https://api.github.com/users/penguhyang/followers","following_url":"https://api.github.com/users/penguhyang/following{/other_user}","gists_url":"https://api.github.com/users/penguhyang/gists{/gist_id}","starred_url":"https://api.github.com/users/penguhyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penguhyang/subscriptions","organizations_url":"https://api.github.com/users/penguhyang/orgs","repos_url":"https://api.github.com/users/penguhyang/repos","events_url":"https://api.github.com/users/penguhyang/events{/privacy}","received_events_url":"https://api.github.com/users/penguhyang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/penguhyang/xcat-core","description":"Code repo for xCAT core packages","fork":true,"url":"https://api.github.com/repos/penguhyang/xcat-core","forks_url":"https://api.github.com/repos/penguhyang/xcat-core/forks","keys_url":"https://api.github.com/repos/penguhyang/xcat-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/penguhyang/xcat-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/penguhyang/xcat-core/teams","hooks_url":"https://api.github.com/repos/penguhyang/xcat-core/hooks","issue_events_url":"https://api.github.com/repos/penguhyang/xcat-core/issues/events{/number}","events_url":"https://api.github.com/repos/penguhyang/xcat-core/events","assignees_url":"https://api.github.com/repos/penguhyang/xcat-core/assignees{/user}","branches_url":"https://api.github.com/repos/penguhyang/xcat-core/branches{/branch}","tags_url":"https://api.github.com/repos/penguhyang/xcat-core/tags","blobs_url":"https://api.github.com/repos/penguhyang/xcat-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/penguhyang/xcat-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/penguhyang/xcat-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/penguhyang/xcat-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/penguhyang/xcat-core/statuses/{sha}","languages_url":"https://api.github.com/repos/penguhyang/xcat-core/languages","stargazers_url":"https://api.github.com/repos/penguhyang/xcat-core/stargazers","contributors_url":"https://api.github.com/repos/penguhyang/xcat-core/contributors","subscribers_url":"https://api.github.com/repos/penguhyang/xcat-core/subscribers","subscription_url":"https://api.github.com/repos/penguhyang/xcat-core/subscription","commits_url":"https://api.github.com/repos/penguhyang/xcat-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/penguhyang/xcat-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/penguhyang/xcat-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/penguhyang/xcat-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/penguhyang/xcat-core/contents/{+path}","compare_url":"https://api.github.com/repos/penguhyang/xcat-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/penguhyang/xcat-core/merges","archive_url":"https://api.github.com/repos/penguhyang/xcat-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/penguhyang/xcat-core/downloads","issues_url":"https://api.github.com/repos/penguhyang/xcat-core/issues{/number}","pulls_url":"https://api.github.com/repos/penguhyang/xcat-core/pulls{/number}","milestones_url":"https://api.github.com/repos/penguhyang/xcat-core/milestones{/number}","notifications_url":"https://api.github.com/repos/penguhyang/xcat-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/penguhyang/xcat-core/labels{/name}","releases_url":"https://api.github.com/repos/penguhyang/xcat-core/releases{/id}","deployments_url":"https://api.github.com/repos/penguhyang/xcat-core/deployments","created_at":"2016-06-29T02:46:54Z","updated_at":"2016-06-29T02:47:04Z","pushed_at":"2016-08-11T05:21:27Z","git_url":"git://github.com/penguhyang/xcat-core.git","ssh_url":"git@github.com:penguhyang/xcat-core.git","clone_url":"https://github.com/penguhyang/xcat-core.git","svn_url":"https://github.com/penguhyang/xcat-core","homepage":null,"size":186907,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xcat2:master","ref":"master","sha":"8d46304373eb5ea92c25ca1242499bc1978e49a0","user":{"login":"xcat2","id":10124414,"avatar_url":"https://avatars.githubusercontent.com/u/10124414?v=3","gravatar_id":"","url":"https://api.github.com/users/xcat2","html_url":"https://github.com/xcat2","followers_url":"https://api.github.com/users/xcat2/followers","following_url":"https://api.github.com/users/xcat2/following{/other_user}","gists_url":"https://api.github.com/users/xcat2/gists{/gist_id}","starred_url":"https://api.github.com/users/xcat2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xcat2/subscriptions","organizations_url":"https://api.github.com/users/xcat2/orgs","repos_url":"https://api.github.com/users/xcat2/repos","events_url":"https://api.github.com/users/xcat2/events{/privacy}","received_events_url":"https://api.github.com/users/xcat2/received_events","type":"Organization","site_admin":false},"repo":{"id":27747508,"name":"xcat-core","full_name":"xcat2/xcat-core","owner":{"login":"xcat2","id":10124414,"avatar_url":"https://avatars.githubusercontent.com/u/10124414?v=3","gravatar_id":"","url":"https://api.github.com/users/xcat2","html_url":"https://github.com/xcat2","followers_url":"https://api.github.com/users/xcat2/followers","following_url":"https://api.github.com/users/xcat2/following{/other_user}","gists_url":"https://api.github.com/users/xcat2/gists{/gist_id}","starred_url":"https://api.github.com/users/xcat2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xcat2/subscriptions","organizations_url":"https://api.github.com/users/xcat2/orgs","repos_url":"https://api.github.com/users/xcat2/repos","events_url":"https://api.github.com/users/xcat2/events{/privacy}","received_events_url":"https://api.github.com/users/xcat2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xcat2/xcat-core","description":"Code repo for xCAT core packages","fork":false,"url":"https://api.github.com/repos/xcat2/xcat-core","forks_url":"https://api.github.com/repos/xcat2/xcat-core/forks","keys_url":"https://api.github.com/repos/xcat2/xcat-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xcat2/xcat-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xcat2/xcat-core/teams","hooks_url":"https://api.github.com/repos/xcat2/xcat-core/hooks","issue_events_url":"https://api.github.com/repos/xcat2/xcat-core/issues/events{/number}","events_url":"https://api.github.com/repos/xcat2/xcat-core/events","assignees_url":"https://api.github.com/repos/xcat2/xcat-core/assignees{/user}","branches_url":"https://api.github.com/repos/xcat2/xcat-core/branches{/branch}","tags_url":"https://api.github.com/repos/xcat2/xcat-core/tags","blobs_url":"https://api.github.com/repos/xcat2/xcat-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xcat2/xcat-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xcat2/xcat-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/xcat2/xcat-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xcat2/xcat-core/statuses/{sha}","languages_url":"https://api.github.com/repos/xcat2/xcat-core/languages","stargazers_url":"https://api.github.com/repos/xcat2/xcat-core/stargazers","contributors_url":"https://api.github.com/repos/xcat2/xcat-core/contributors","subscribers_url":"https://api.github.com/repos/xcat2/xcat-core/subscribers","subscription_url":"https://api.github.com/repos/xcat2/xcat-core/subscription","commits_url":"https://api.github.com/repos/xcat2/xcat-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/xcat2/xcat-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/xcat2/xcat-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/xcat2/xcat-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/xcat2/xcat-core/contents/{+path}","compare_url":"https://api.github.com/repos/xcat2/xcat-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xcat2/xcat-core/merges","archive_url":"https://api.github.com/repos/xcat2/xcat-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xcat2/xcat-core/downloads","issues_url":"https://api.github.com/repos/xcat2/xcat-core/issues{/number}","pulls_url":"https://api.github.com/repos/xcat2/xcat-core/pulls{/number}","milestones_url":"https://api.github.com/repos/xcat2/xcat-core/milestones{/number}","notifications_url":"https://api.github.com/repos/xcat2/xcat-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xcat2/xcat-core/labels{/name}","releases_url":"https://api.github.com/repos/xcat2/xcat-core/releases{/id}","deployments_url":"https://api.github.com/repos/xcat2/xcat-core/deployments","created_at":"2014-12-09T03:21:50Z","updated_at":"2016-07-25T20:52:36Z","pushed_at":"2016-08-11T06:21:07Z","git_url":"git://github.com/xcat2/xcat-core.git","ssh_url":"git@github.com:xcat2/xcat-core.git","clone_url":"https://github.com/xcat2/xcat-core.git","svn_url":"https://github.com/xcat2/xcat-core","homepage":null,"size":187481,"stargazers_count":51,"watchers_count":51,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":60,"mirror_url":null,"open_issues_count":155,"forks":60,"open_issues":155,"watchers":51,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/1669"},"html":{"href":"https://github.com/xcat2/xcat-core/pull/1669"},"issue":{"href":"https://api.github.com/repos/xcat2/xcat-core/issues/1669"},"comments":{"href":"https://api.github.com/repos/xcat2/xcat-core/issues/1669/comments"},"review_comments":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/1669/comments"},"review_comment":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/1669/commits"},"statuses":{"href":"https://api.github.com/repos/xcat2/xcat-core/statuses/8797b7f618e3607565aaf1333271b6c81dbbbf38"}}}}
{"actor":{"display_login":"penguhyang"}}