Skip to content

Commit dbe8f75

Browse files
committed
don't use sed's -i option to stay posix compliant
POSIX does not define sed's -i option. To stay as portable as possible we should not relay on it.
1 parent 3e7dac9 commit dbe8f75

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Makefile.include

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ $(LIBBITCOINQT):
4040
ui_%.h: %.ui
4141
@test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D)
4242
@test -f $(UIC) && QT_SELECT=$(QT_SELECT) $(UIC) -o $(abs_builddir)/$@ $(abs_srcdir)/$< || echo error: could not build $(abs_builddir)/$@
43-
$(SED) -i.bak -e '/^\*\*.*Created:/d' $(abs_builddir)/$@ && rm $(abs_builddir)/$@.bak
44-
$(SED) -i.bak -e '/^\*\*.*by:/d' $(abs_builddir)/$@ && rm $(abs_builddir)/$@.bak
43+
$(SED) -e '/^\*\*.*Created:/d' $(abs_builddir)/$@ > $(abs_builddir)/[email protected] && mv $(abs_builddir)/$@{.n,}
44+
$(SED) -e '/^\*\*.*by:/d' $(abs_builddir)/$@ > $(abs_builddir)/[email protected] && mv $(abs_builddir)/$@{.n,}
4545

4646
%.moc: %.cpp
4747
QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $<
48-
$(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm $@.bak
49-
$(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm $@.bak
48+
$(SED) -e '/^\*\*.*Created:/d' $@ > [email protected] && mv $@{.n,}
49+
$(SED) -e '/^\*\*.*by:/d' $@ > [email protected] && mv $@{.n,}
5050

5151
moc_%.cpp: %.h
5252
QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $<
53-
$(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm $@.bak
54-
$(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm $@.bak
53+
$(SED) -e '/^\*\*.*Created:/d' $@ > [email protected] && mv $@{.n,}
54+
$(SED) -e '/^\*\*.*by:/d' $@ > [email protected] && mv $@{.n,}
5555

5656
%.qm: %.ts
5757
@test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D)

src/qt/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ translate: bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(
372372
$(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H)
373373
@cd $(abs_srcdir); test -f $(RCC) && QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin -o $(abs_builddir)/$@ $< || \
374374
echo error: could not build $@
375-
$(SED) -i.bak -e '/^\*\*.*Created:/d' $@ && rm $@.bak
376-
$(SED) -i.bak -e '/^\*\*.*by:/d' $@ && rm $@.bak
375+
$(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,}
376+
$(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,}
377377

378378
CLEANFILES = $(BUILT_SOURCES) $(QT_QM) $(QT_FORMS_H) *.gcda *.gcno

0 commit comments

Comments
 (0)