Skip to content

Commit df1b2f0

Browse files
Cleanup the note cache during install
1 parent defb51d commit df1b2f0

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@ build
5656
donotcommit
5757
echttp_get
5858
echttp_print
59+
httpserver
5960

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ LDCONFIG=/usr/sbin/ldconfig
3333
PACKAGE=build/echttp
3434

3535
HMAN=/var/lib/house/note/content/manuals/infrastructure
36+
HMANCACHE=/var/lib/house/note/cache
3637

3738
OBJS= echttp.o \
3839
echttp_static.o \
@@ -76,6 +77,7 @@ dev:
7677
install: dev
7778
$(INSTALL) -m 0755 -d $(DESTDIR)$(HMAN)
7879
$(INSTALL) -m 0644 README.md $(DESTDIR)$(HMAN)/echttp.md
80+
rm -rf $(DESTDIR)$(HMANCACHE)/*
7981

8082
clean:
8183
rm -f *.o *.a *.so
@@ -96,8 +98,9 @@ debian-package:
9698
rm -rf build
9799
mkdir -p $(PACKAGE)/DEBIAN
98100
sed "s/{{arch}}/`dpkg --print-architecture`/" < debian/control > $(PACKAGE)/DEBIAN/control
99-
cp debian/copyright $(PACKAGE)/DEBIAN
100-
cp debian/changelog $(PACKAGE)/DEBIAN
101+
$(INSTALL) -m 644 debian/copyright $(PACKAGE)/DEBIAN
102+
$(INSTALL) -m 644 debian/changelog $(PACKAGE)/DEBIAN
103+
$(INSTALL) -m 755 debian/postinst $(PACKAGE)/DEBIAN
101104
make DESTDIR=$(PACKAGE) install
102105
cd build ; fakeroot dpkg-deb -b echttp .
103106

debian/postinst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
case $1 in
4+
configure|abort-upgrade|abort-deconfigure|abort-remove)
5+
if [ -d /var/lib/house/note/cache ] ; then rm -rf /var/lib/house/note/cache/* ; fi
6+
;;
7+
esac
8+

0 commit comments

Comments
 (0)