Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: build: devenv: remove files installed previously
......................................................................

packaging: build: devenv: remove files installed previously

with increasing changes in packaging, and people that preserve their
prefix, we need a solution to cleanup old installed files if are missing
from new installation to avoid conflicts.

a method of storing a file list of all simple files (these that are
copied recursively) is a simple and efficient for this cause.

files are relative to PREFIX so that if people move PREFIX to other
location we won't erase wrong files.

Change-Id: I2b0f47ee6fa4b3fb6759bc4f4899092f4128ced7
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M Makefile
1 file changed, 16 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-dwh refs/changes/04/23204/1

diff --git a/Makefile b/Makefile
index 7fdf96a..882f572 100644
--- a/Makefile
+++ b/Makefile
@@ -149,7 +149,7 @@
 
 clean:
        $(MVN) clean $(EXTRA_BUILD_FLAGS)
-       rm -rf $(OUTPUT_RPMBUILD) $(OUTPUT_DIR) $(BUILD_FILE)
+       rm -rf $(OUTPUT_RPMBUILD) $(OUTPUT_DIR) $(BUILD_FILE) tmp.dev.flist
        rm -rf $(GENERATED)
 
 test:
@@ -220,8 +220,11 @@
                        $${exclude} || echo "$${f}"; \
                done \
        ) | while read f; do \
-               [ -x "$(SOURCEDIR)/$${f}" ] && MASK=755 || MASK=644; \
-               install -m "$${MASK}" "$(SOURCEDIR)/$${f}" "$$(dirname 
"$(TARGETDIR)/$${f}")"; \
+               src="$(SOURCEDIR)/$${f}"; \
+               dst="$(TARGETDIR)/$${f}"; \
+               [ -x "$${src}" ] && MASK=0755 || MASK=0644; \
+               [ -n "$(DEV_FLIST)" ] && echo "$${dst}" | sed 's#^$(PREFIX)/##' 
>> "$(DEV_FLIST)"; \
+               install -T -m "$${MASK}" "$${src}" "$${dst}"; \
        done
 
 validations:   generated-files
@@ -282,11 +285,21 @@
        # remove dbscripts to avoid dups
        rm -fr "$(DESTDIR)$(PKG_DATA_DIR)/dbscripts"
 
+       if [ -f "$(DESTDIR)$(PREFIX)/dev.$(PACKAGE_NAME).flist" ]; then \
+               cat "$(DESTDIR)$(PREFIX)/dev.$(PACKAGE_NAME).flist" | while 
read f; do \
+                       rm -f "$(DESTDIR)$(PREFIX)/$${f}"; \
+               done; \
+               rm -f "$(DESTDIR)$(PREFIX)/dev.$(PACKAGE_NAME).flist"; \
+       fi
+
+       rm -f tmp.dev.flist
        $(MAKE) \
                install \
                BUILD_VALIDATION=0 \
                PYTHON_DIR="$(PREFIX)$(PYTHON_SYS_DIR)" \
+               DEV_FLIST=tmp.dev.flist \
                $(NULL)
+       cp tmp.dev.flist "$(DESTDIR)$(PREFIX)/dev.$(PACKAGE_NAME).flist"
 
        install -d "$(DESTDIR)$(PKG_STATE_DIR)"
        install -d "$(DESTDIR)$(PKG_LOG_DIR)"


-- 
To view, visit http://gerrit.ovirt.org/23204
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b0f47ee6fa4b3fb6759bc4f4899092f4128ced7
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-dwh
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to