[PATCH] [Wok v2] Issue #155: 'make clean' does not revert its changes from 'make rpm'

From: Bianca Carvalho <bianca@linux.vnet.ibm.com> Edited Makefile.am to check if there is any file to be stashed or commited before run 'make rpm' to avoid losing any changes. Also included 'git reset --hard' command to revert changes made by 'make rpm' command. Signed-off-by: Bianca Carvalho <bianca@linux.vnet.ibm.com> --- Makefile.am | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/Makefile.am b/Makefile.am index 10d9718..2b27a6a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -115,30 +115,17 @@ wok.spec: contrib/wok.spec.fedora contrib/wok.spec.suse /bin/false ; \ fi -check_files: - @if [ -d '.git' ]; then \ - if [ `git status --porcelain --untracked-files=no | wc -l` -gt 0 ]; then \ - echo "***** Aborting 'make rpm' command *****"; \ - echo "There are some changes not commited in your working \ -directory. To avoid losing them, please commit or stage before run 'make rpm' command."; \ - exit 1; \ - fi \ - fi - -rpm: check_files dist wok.spec +rpm: wok.spec $(MKDIR_P) rpm/BUILD rpm/RPMS rpm/SOURCES rpm/SPECS rpm/SRPMS cp $(top_srcdir)/wok.spec rpm/SPECS/wok.spec cp $(DIST_ARCHIVES) rpm/SOURCES rpmbuild -ba --define "_topdir `pwd`/rpm" rpm/SPECS/wok.spec - @if [ -d '.git' ]; then \ - git reset --hard; \ - fi -fedora-rpm: check_files contrib/wok.spec.fedora +fedora-rpm: contrib/wok.spec.fedora ln -sf contrib/wok.spec.fedora wok.spec $(MAKE) rpm -suse-rpm: check_files contrib/wok.spec.suse +suse-rpm: contrib/wok.spec.suse ln -sf contrib/wok.spec.suse wok.spec $(MAKE) rpm -- 2.7.4
participants (2)
-
Aline Manera
-
bianca@linux.vnet.ibm.com