Skip to content

Commit

Permalink
Merge pull request #967
Browse files Browse the repository at this point in the history
extensions: cleanup /var/run leftovers in scripts (bsc#1194557)
  • Loading branch information
cfconrad committed May 11, 2023
2 parents b03f6f9 + 64a2fdf commit 5cd1841
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -49,6 +49,8 @@ Makefile.in
/etc/systemv/network
/etc/systemv/*.service
/etc/systemd/*.service
/extensions/firewall
/extensions/hostname
/schema/constants.xml
/autoip4/wickedd-auto4
/dhcp4/wickedd-dhcp4
Expand Down
45 changes: 34 additions & 11 deletions extensions/Makefile.am
@@ -1,29 +1,52 @@

CLEANFILES = *~
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = $(wicked_extensions_SCRIPTS)

wicked_extensions_SCRIPTS = \
dispatch \
firewall \
hostname \
ibft \
netconfig \
DISTCLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = $(scripts) $(templates)

wicked_extensions_SCRIPTS = $(scripts) $(BUILT_SOURCES)

scripts = \
dispatch \
ibft \
netconfig \
redfish-config

if nbft
wicked_extensions_SCRIPTS += nbft
scripts += nbft
else
EXTRA_DIST += nbft
endif

BUILT_SOURCES = \
firewall \
hostname

templates = \
$(BUILT_SOURCES:=.sh)

substitute_vars = \
$(AM_V_GEN)sed \
-e "s|[@]wicked_sbindir[@]|$(wicked_sbindir)|g" \
-e "s|[@]wicked_statedir[@]|$(wicked_statedir)|g"

%: %.sh $(top_builddir)/config.status
@echo "substituting variables in $< > $@"
@rm -f $@ $@.tmp
@$(substitute_vars) < $< > $@.tmp && mv $@.tmp $@ && chmod +x $@

check-local:
@for i in $(wicked_extensions_SCRIPTS) ; \
check-local: $(wicked_extensions_SCRIPTS)
@for i in $(scripts) ; \
do \
bash -n $(srcdir)/$$i \
&& printf 'extensions/%-30s %s\n' $$i "Syntax OK" \
|| exit 1 ; \
done
@for i in $(BUILT_SOURCES) ; \
do \
bash -n $(builddir)/$$i \
&& printf 'extensions/%-30s %s\n' $$i "Syntax OK" \
|| exit 1 ; \
done

# vim: ai
Empty file modified extensions/dispatch 100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion extensions/firewall → extensions/firewall.sh
Expand Up @@ -40,7 +40,7 @@
#exec 2>/tmp/wicked-firewall.$$.trace
#set -vx

wicked="/usr/sbin/wicked"
wicked="@wicked_sbindir@/wicked"
systemctl="/usr/bin/systemctl"
firewalld_cmd="/usr/bin/firewall-cmd"
firewalld_service="firewalld.service"
Expand Down
2 changes: 1 addition & 1 deletion extensions/hostname → extensions/hostname.sh
@@ -1,6 +1,6 @@
#!/bin/bash

hostnamedir=/var/run/wicked/extension/hostname
hostnamedir=@wicked_statedir@/extension/hostname
defaulthostname=/etc/hostname

type=""
Expand Down
Empty file modified extensions/nbft 100644 → 100755
Empty file.
3 changes: 0 additions & 3 deletions extensions/netconfig
@@ -1,8 +1,5 @@
#!/bin/bash

backupdir=/var/run/wicked/backup
updaterdir=/var/run/wicked/extension/generic

type=""
family=""
ifname=""
Expand Down

0 comments on commit 5cd1841

Please sign in to comment.