Skip to content

Commit

Permalink
PKGBUILD: add post_upgrade messages
Browse files Browse the repository at this point in the history
  • Loading branch information
joukewitteveen committed Aug 4, 2018
1 parent e9c5de2 commit 9e9014e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.tar.xz
*.tar.xz.sig
/PKGBUILD
/netctl.install
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,19 @@ netctl-$(VERSION).tar.xz:
gpg --detach-sign $@

pkgbuild: PKGBUILD
PKGBUILD: netctl-$(VERSION).tar.xz contrib/PKGBUILD.in
PKGBUILD: netctl-$(VERSION).tar.xz netctl.install contrib/PKGBUILD.in
sed -e "s|@pkgver@|$(VERSION)|g" \
-e "s|@md5sum@|$(shell md5sum $< | cut -d ' ' -f 1)|" \
-e "s|@md5sum.sig@|$(shell md5sum $<.sig | cut -d ' ' -f 1)|" \
$(lastword $^) > $@

netctl.install: contrib/netctl.install
cp $< $@

upload: netctl-$(VERSION).tar.xz
scp $< $<.sig sources.archlinux.org:/srv/ftp/other/packages/netctl

clean:
$(MAKE) -C docs clean
-@rm -vf PKGBUILD *.tar.xz *.tar.xz.sig 2>/dev/null
-@rm -vf netctl-*.tar.xz{,.sig} PKGBUILD netctl.install

1 change: 1 addition & 0 deletions contrib/PKGBUILD.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ optdepends=('dialog: for the menu based wifi assistant'
'ppp: for PPP connections'
'openvswitch: for Open vSwitch connections'
)
install=netctl.install
source=(https://sources.archlinux.org/other/packages/netctl/netctl-${pkgver}.tar.xz{,.sig})
arch=('any')
md5sums=('@md5sum@'
Expand Down
10 changes: 10 additions & 0 deletions contrib/netctl.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
post_upgrade() {
if [[ $(vercmp 1.18 "$2") -gt 0 ]]; then
grep -ls '^.include ' /etc/systemd/system/netctl@*.service | \
while read -r unit; do
profile=$(systemd-escape --unescape "${unit:27:-8}")
echo ":: The unit for profile '$profile' uses deprecated features."
echo " Consider running: netctl reenable $(printf '%q' "$profile")"
done
fi
}
3 changes: 2 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
MANPAGES = netctl.1 netctl-auto.1 netctl.profile.5 netctl.special.7

.PHONY: manpages install $(MANPAGES:=-install) clean

manpages: $(MANPAGES)
$(MANPAGES): %: %.txt
a2x -d manpage -f manpage -a manversion=$(VERSION) $<
Expand All @@ -12,5 +13,5 @@ $(MANPAGES:=-install): %-install: %
install -Dm644 $< $(DESTDIR)/usr/share/man/man$(subst .,,$(suffix $<))/$<

clean:
-@rm -vf $(MANPAGES) 2>/dev/null
-@rm -vf $(MANPAGES)

0 comments on commit 9e9014e

Please sign in to comment.