From patchwork Fri Mar 31 15:27:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9656631 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B9573601D2 for ; Fri, 31 Mar 2017 15:28:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABD1C286C2 for ; Fri, 31 Mar 2017 15:28:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0B5B286DC; Fri, 31 Mar 2017 15:28:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 33635286C2 for ; Fri, 31 Mar 2017 15:28:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 722876EADF; Fri, 31 Mar 2017 15:27:59 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qt0-x22d.google.com (mail-qt0-x22d.google.com [IPv6:2607:f8b0:400d:c0d::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 970CB6EADC for ; Fri, 31 Mar 2017 15:27:57 +0000 (UTC) Received: by mail-qt0-x22d.google.com with SMTP id n21so68374611qta.1 for ; Fri, 31 Mar 2017 08:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=nVhkwPJHL6Hha+TpN90vsZd1BDlGQxzo1vC8FLqXd1w=; b=WPMlUq94/Eh/j/wT6D0NM8TvTPFG3+XPek56PNF0YCiMoNaW8yoeME6lGB+Vmcy+39 tehzT4BfnqCigfSlEigHFWGY3YnHN4twkbDwsVSWNm8R6GXM/G8CsYJsY+/XY0lxxykn hDtZEqx5BE18TO7nFlC+LY3K5HXdGnq4ClL84= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nVhkwPJHL6Hha+TpN90vsZd1BDlGQxzo1vC8FLqXd1w=; b=dbxLUbPS7rXEHoh5xMQuZ89YLtNgIUiyfeHUiQIcJ8nI0pbvzx9z4+X9cmSiPCJtIC MUvLrdXZ2ukXy7QoVUPr45njm88JiFkeBzlBwZ4WD7ngI8BR1cXd3ZnfF4psbiFaLgFI DRumIFv8V5lVNQ9QosVbwGJZR26BWpai+XQwgBPYtU5sk2iUngm7QUuQABMOd66fZT37 hyIEdE1LyL0lAb41K7ssZ/tsc3RYReeXxPhB2PmMhWa+n7uNgVatvTWqRMCTW+aXiBQK 9ostuYwlRqXEoATFCc6HmujwHbHPlSrcUYShJiZTwT6FwnPhhfye0+WP0ubvl0hLr+aw RbTg== X-Gm-Message-State: AFeK/H14bMdIxCBn0Glb7gkrHyMaEnvERXhrjVr4/TyS99AJh+3xtss2xrRNKjwYh8BxG3pL X-Received: by 10.237.50.6 with SMTP id y6mr3331417qtd.115.1490974076433; Fri, 31 Mar 2017 08:27:56 -0700 (PDT) Received: from boxwood.roam.corp.google.com (cpe-75-189-128-87.nc.res.rr.com. [75.189.128.87]) by smtp.gmail.com with ESMTPSA id r30sm3706601qtc.66.2017.03.31.08.27.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 31 Mar 2017 08:27:55 -0700 (PDT) From: Sean Paul To: intel-gfx@lists.freedesktop.org Date: Fri, 31 Mar 2017 11:27:48 -0400 Message-Id: <20170331152754.33695-1-seanpaul@chromium.org> X-Mailer: git-send-email 2.12.2.564.g063fe858b8-goog Cc: daniel.vetter@intel.com Subject: [Intel-gfx] [PATCH] dim: Use mktemp for pull-request mails X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Instead of hardcoding ~/tmp in dim (and failing when it doesn't exist), use mktemp to create the pull-request mail file. Signed-off-by: Sean Paul --- dim | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/dim b/dim index 8357d4f..8b61fd8 100755 --- a/dim +++ b/dim @@ -1278,9 +1278,11 @@ function prep_pull_mail_overview # $@: tags, if any, to extract into the pull request overview function prep_pull_mail { - prep_pull_mail_greetings > ~/tmp/dim-pull-request - prep_pull_mail_overview "$@" >> ~/tmp/dim-pull-request - prep_pull_mail_signature >> ~/tmp/dim-pull-request + file=$1 + shift + prep_pull_mail_greetings > $file + prep_pull_mail_overview "$@" >> $file + prep_pull_mail_signature >> $file } function dim_create_workdir @@ -1391,17 +1393,18 @@ function dim_update_next_continue $DRY git tag $tag_testing $DIM_DRM_INTEL_REMOTE/drm-intel-testing $DRY git push $DIM_DRM_INTEL_REMOTE $tag_testing - cat > ~/tmp/test-request <<-HERE + req_file=$(mktemp) + cat > $req_file <<-HERE Hi all, HERE obj=$(git rev-parse $tag) if [[ "$(git cat-file -t $obj)" == "tag" ]] ; then - git cat-file -p $obj | tail -n+6 >> ~/tmp/test-request + git cat-file -p $obj | tail -n+6 >> $req_file else - echo "" >> ~/tmp/test-request + echo "" >> $req_file fi - cat >> ~/tmp/test-request <<-HERE + cat >> $req_file <<-HERE Happy testing! @@ -1409,7 +1412,7 @@ function dim_update_next_continue HERE $DRY $DIM_MUA -s "Updated drm-intel-testing" \ - -i ~/tmp/test-request \ + -i $req_file \ -c "$addr_intel_gfx" \ -c "$addr_intel_gfx_maintainer1" \ -c "$addr_intel_gfx_maintainer2" \ @@ -1448,6 +1451,7 @@ function dim_pull_request branch=${1:?$usage} upstream=${2:?$usage} remote=$(branch_to_remote $branch) + req_file=$(mktemp) if [ "$branch" != "drm-intel-next" ]; then assert_branch $branch @@ -1461,7 +1465,7 @@ function dim_pull_request if [ "$branch" = "drm-intel-next" ]; then # drm-intel-next pulls have been tagged using dim update-next drm_intel_next_tags=$(git log "$branch@{upstream}" ^$upstream --decorate | grep "(.*tag: drm-intel-next-" | sed -e "s/^.*(.*tag: \(drm-intel-next-[^ ,]*\).*)$/\1/") - prep_pull_mail $drm_intel_next_tags + prep_pull_mail $req_file $drm_intel_next_tags tag=$(git describe --all --exact "$branch@{upstream}") repo="drm-intel" @@ -1475,7 +1479,7 @@ function dim_pull_request gitk "$branch@{upstream}" ^$upstream & $DRY git tag -a $tag "$branch@{upstream}" $DRY git push $remote $tag - prep_pull_mail $tag + prep_pull_mail $req_file $tag repo=$(branch_to_repo $branch) fi @@ -1483,9 +1487,9 @@ function dim_pull_request url=${drm_tip_repos[$repo]} git_url=$(echo $url | sed -e 's/git\./anongit./' -e 's/ssh:/git:/') - git request-pull $upstream $git_url $tag >> ~/tmp/dim-pull-request + git request-pull $upstream $git_url $tag >> $req_file $DRY $DIM_MUA -s "[PULL] $branch" \ - -i ~/tmp/dim-pull-request \ + -i $req_file \ -c "$addr_intel_gfx" \ -c "$addr_dri_devel" \ -c "$addr_intel_gfx_maintainer1" \