{"thread":{"id":"345","subject":"Re: [PATCH] make cg-export use tar-tree","startedAt":"2005-04-27T01:16:25Z","lastAt":"2005-04-27T01:16:25Z","messageCount":1,"participants":["Rene Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"1839","messageId":"426EE7E9.5010108@lsrfire.ath.cx","threadId":"345","inReplyTo":"200504261928.44538.jcorbin@wunjo.org","subject":"Re: [PATCH] make cg-export use tar-tree","fromName":"Rene Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2005-04-27T01:16:25Z","receivedAt":"2005-04-27T01:16:25Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Joshua T. Corbin schrieb:\n> Here it is (this time with real tabs instead of two spaces ;) ), requires \n> Rene's tar-tree patch. Works quite speedily too I might add.\n\nMaybe it's just Thunderbird, but I see single spaces instead of tabs\nthere.\n\n> +  tar=$(mktemp -t cg-export.tar.XXXXXX)\n> +  tar-tree $id \"$base\" > $tar\n> +  case $ext in\n> +  .tar.gz|.tgz)\n> +   gzip -c9 $tar > $dest\n> +   rm -f $tar\n> +   ;;\n> +  .tar.bz2)\n> +   bzip2 -c $tar > $dest\n> +   rm -f $tar\n> +   ;;\n> +  .tar)\n> +   mv $tar $dest\n> +   ;;\n> +  esac\n\nYou don't need to create a temporary file using tar-tree.  The above can\nbe done like this:\n\n  case $ext in\n  .tar.gz|.tgz)\n      tar-tree $id \"$base\" | gzip -9\n      ;;\n  .tar.bz2)\n      tar-tree $id \"$base\" | bzip2\n      ;;\n  .tar)\n      tar-tree $id \"$base\"\n      ;;\n  esac > $dest\n\nThis is both shorter and (a bit) faster.  More easily readable, too,\nIMO.  Don't fear the pipe. ;-)  And I don't think we need to avoid\nthe triplication of tar-tree calls.\n\nThanks,\nRene\n"}]}