Skip to content
This repository has been archived by the owner on Jun 15, 2018. It is now read-only.

Commit

Permalink
Replace cleanup script with Makefile targets
Browse files Browse the repository at this point in the history
  • Loading branch information
l0b0 committed Feb 13, 2014
1 parent 8f6a7fa commit ae810ec
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 121 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 49 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,59 @@ dotfiles = .ackrc \

dotfile_links = $(addprefix $(PREFIX)/,$(dotfiles))

gpg_backup_path = $(PREFIX)/.gnupg/ownertrust.txt

signature_dat_files = $(patsubst %.sig,%.dat,$(wildcard .signatures/*.sig))

.PHONY: all
all: test

.PHONY: $(gpg_backup_path)
$(gpg_backup_path):
gpg --export-ownertrust > "$@"

.PHONY: clean_comments
clean_comments:
for path in $(PREFIX)/.gnupg/ownertrust.txt .jedit/properties .jedit/keymaps/imported_keys.props; do \
if [ -e "$$path" ]; then \
sed -i -e '/^#/D' -e 's/[[:space:]]\+#.*$$//g' "$$path" || exit 1; \
fi \
done

.PHONY: clean_line_endings
clean_line_endings:
sed -i -e 's/ *$$/ /' .bash_history

.PHONY: clean_history_tags
clean_history_tags:
sed -i -e 's/^\(\(man\|info\) [^#]\+\)$$/\1# help /' .bash_history

.PHONY: clean_x_resources
clean_x_resources:
new_file=$$(mktemp) && \
xrdb -query > "$$new_file" && \
mv "$$new_file" .Xresources

.PHONY: clean_sort_text_files
clean_sort_text_files:
for path in .config/ipython/profile_default/history.py $(PREFIX)/.gnupg/ownertrust.txt .jedit/properties .jedit/keymaps/imported_keys.props .bash_history; do \
sort --unique --output="$$path" "$$path" || exit $$?; \
done

$(signature_dat_files): %.dat : %.sig
strfile $< $@

.PHONY: clean_signatures
clean_signatures: $(signature_dat_files)

.PHONY: clean_sqlite
clean_sqlite:
for db_file in $(PREFIX)/.mozilla/*/*/*.sqlite; do \
echo 'VACUUM;' | sqlite3 $$db_file || exit $$?; \
done

.PHONY: clean
clean:
$(CURDIR)/scripts/cleanup.sh --verbose
clean: $(gpg_backup_path) clean_comments clean_line_endings clean_history_tags clean_x_resources clean_sort_text_files clean_signatures clean_sqlite

.PHONY: uninstall
uninstall:
Expand Down
119 changes: 0 additions & 119 deletions scripts/cleanup.sh

This file was deleted.

0 comments on commit ae810ec

Please sign in to comment.