# HG changeset patch # User Volker Grabsch # Date 1333091534 -7200 # Node ID 5e6e989cb3495a26ab63487d54d1779a4ee0b419 # Parent f4f7bd9a7a17db61420fa278ae80e67f10f0d875 Improve "make cleanup-style" to touch only files that have to be fixed diff -r f4f7bd9a7a17 -r 5e6e989cb349 Makefile --- a/Makefile Fri Mar 30 08:08:03 2012 +0200 +++ b/Makefile Fri Mar 30 09:12:14 2012 +0200 @@ -220,14 +220,17 @@ cleanup-style: @$(foreach FILE,$(wildcard $(addprefix $(TOP_DIR)/,Makefile index.html CNAME src/*.mk src/*test.* tools/*)),\ - echo '[cleanup] $(FILE)'; \ - $(SED) -i ' \ + $(SED) ' \ s/\r//g; \ s/[ \t]\+$$//; \ s,^#!/bin/bash$$,#!/usr/bin/env bash,; \ $(if $(filter %Makefile,$(FILE)),,\ s/\t/ /g; \ ) \ - ' $(FILE); \ + ' < $(FILE) > $(TOP_DIR)/tmp-cleanup-style; \ + diff -u $(FILE) $(TOP_DIR)/tmp-cleanup-style >/dev/null \ + || { echo '[cleanup] $(FILE)'; \ + cp $(TOP_DIR)/tmp-cleanup-style $(FILE); }; \ + rm -f $(TOP_DIR)/tmp-cleanup-style; \ )