From: Sebastien GODARD Date: Sat, 20 Jun 2020 08:36:26 +0000 (+0200) Subject: Makefile: Remove all reports and data files if requested X-Git-Tag: v12.4.0~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=36d9694c56bd0a20cb29738e4e5854900187a433;p=sysstat Makefile: Remove all reports and data files if requested When option --enable-clean-sa-dir, sysstat used to remove compressed reports and data files in /var/log/sa directory only when they had been compressed using gzip. Update Makefile to look for other compression programs. Also remove files using the format saYYYYMMDD or sarYYYYMMDD. Signed-off-by: Sebastien GODARD --- diff --git a/Makefile.in b/Makefile.in index 4fdbf2b..4741ae4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -422,9 +422,8 @@ install_base: all sa1 sa2 sysstat.sysconfig install_man install_nls mkdir -p $(DESTDIR)$(SA_LIB_DIR) mkdir -p $(DESTDIR)$(SA_DIR) ifeq ($(CLEAN_SA_DIR),y) - find $(DESTDIR)$(SA_DIR) \( -name 'sar??' -o -name 'sa??' -o -name 'sar??.gz' -o -name 'sa??.gz' \) \ - -exec rm -f {} \; - -rmdir --ignore-fail-on-non-empty $(DESTDIR)$(SA_DIR)/[0-9]????? + find $(DESTDIR)$(SA_DIR) -type f | egrep "/sar?[0-9]{2,8}(\.(Z|gz|bz2|xz|lz|lzo))?$$" | xargs rm -f + find $(DESTDIR)$(SA_DIR) -type f | egrep "/sar?[0-9]{2,8}$$" | xargs rm -f endif mkdir -p $(DESTDIR)$(BIN_DIR) mkdir -p $(DESTDIR)$(DOC_DIR)