# Writing shell scripts in makefiles sucks. Remember to $$ shell
# variables and include \ at the end of each line.
# Add code to postinst to add/remove diversions as appropriate
# Writing shell scripts in makefiles sucks. Remember to $$ shell
# variables and include \ at the end of each line.
# Add code to postinst to add/remove diversions as appropriate
sed 's/#PACKAGE#/$(cdbs_curpkg)/g; s/#DEB_DIVERT_EXTENSION#/$(DEB_DIVERT_EXTENSION)/g' $(DEB_DIVERT_SCRIPT); \
$(if $(divert_files_all), \
echo 'if [ "$$1" = "configure" ]; then'; \
sed 's/#PACKAGE#/$(cdbs_curpkg)/g; s/#DEB_DIVERT_EXTENSION#/$(DEB_DIVERT_EXTENSION)/g' $(DEB_DIVERT_SCRIPT); \
$(if $(divert_files_all), \
echo 'if [ "$$1" = "configure" ]; then'; \
sed 's/#PACKAGE#/$(cdbs_curpkg)/g; s/#DEB_DIVERT_EXTENSION#/$(DEB_DIVERT_EXTENSION)/g' $(DEB_DIVERT_SCRIPT); \
$(if $(divert_files_thispkg), \
echo 'if [ "$$1" = "remove" ]; then'; \
sed 's/#PACKAGE#/$(cdbs_curpkg)/g; s/#DEB_DIVERT_EXTENSION#/$(DEB_DIVERT_EXTENSION)/g' $(DEB_DIVERT_SCRIPT); \
$(if $(divert_files_thispkg), \
echo 'if [ "$$1" = "remove" ]; then'; \
# Add an encoding of the names of the diverted files to the Provides:
# and Conflicts: lists. This prevents two packages diverting the same
# file from being installed simultaneously (it cannot work, and this
# produces a much less ugly error). Requires in debian/control:
# Provides: $(diverted-files)
# Conflicts: $(diverted-files)
# Add an encoding of the names of the diverted files to the Provides:
# and Conflicts: lists. This prevents two packages diverting the same
# file from being installed simultaneously (it cannot work, and this
# produces a much less ugly error). Requires in debian/control:
# Provides: $(diverted-files)
# Conflicts: $(diverted-files)
echo -n "diverted-files="; \
$(foreach file,$(divert_files_thispkg),\
echo -n "diverts-"; \
${DEB_DIVERT_ENCODER} "$(call divert_files_replace_name,$(file))"; \
echo -n ", ";) \
echo -n "diverted-files="; \
$(foreach file,$(divert_files_thispkg),\
echo -n "diverts-"; \
${DEB_DIVERT_ENCODER} "$(call divert_files_replace_name,$(file))"; \
echo -n ", ";) \
$(patsubst %,binary-post-install/%,$(DEB_DIVERT_PACKAGES)) :: binary-post-install/%: debian-divert/%
$(patsubst %,binary-post-install/%,$(DEB_DIVERT_PACKAGES)) :: binary-post-install/%: debian-divert/%