From patchwork Mon Apr 18 17:52:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,6,STABLE] builddeb: use sed -i From: Sean Farley X-Patchwork-Id: 14721 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Mon, 18 Apr 2016 10:52:09 -0700 # HG changeset patch # User Sean Farley # Date 1460835201 25200 # Sat Apr 16 12:33:21 2016 -0700 # Branch stable # Node ID da3179bb3ca884e261034064c546d184dcd32a3a # Parent db33d0e7476c79ac0bc8048992ec6d24d6062c87 # EXP-Topic ppa builddeb: use sed -i Notice that there is no space after '-i'. This makes it work on both GNU and BSD versions of sed. diff --git a/contrib/builddeb b/contrib/builddeb --- a/contrib/builddeb +++ b/contrib/builddeb @@ -65,15 +65,12 @@ if [ "$BUILD" ]; then fi cp -r $PWD/contrib/debian debian chmod -R 0755 debian - # This looks like sed -i, but sed -i behaves just differently enough - # between BSD and GNU sed that I gave up and did the dumb thing. - sed "s/__VERSION__/$debver/" < $changelog > $changelog.tmp - date=$(date --rfc-2822) - sed "s/__DATE__/$date/" < $changelog.tmp > $changelog + sed -i.tmp "s/__VERSION__/$debver/" $changelog + sed -i.tmp "s/__DATE__/$(date --rfc-2822)/" $changelog rm $changelog.tmp debuild -us -uc -b if [ $? != 0 ]; then echo 'debuild failed!'