gallium/targets: rework the empty targets removal
authorEmil Velikov <emil.velikov@collabora.com>
Sun, 5 Mar 2017 17:17:10 +0000 (17:17 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 8 Mar 2017 16:23:07 +0000 (16:23 +0000)
Earlier commit added extra tracking and we've attempted to remove the
vdpau/other folder if empty. V2 of said commit dropped the pipe
to /dev/null and the explicit "true" override.

Sadly both of those are needed since there's no guarantee that the
folder will be empty before we [mesa] make install.

Since we're bringing those two back, there's no need to track if we've
installed anything, and simply do "rm -d foo/ &>/dev/null || true"

Tested-by: Andy Furniss <adf.lists@gmail.com>
Reported-by: Andy Furniss <adf.lists@gmail.com>
Fixes: 1cd4fde053 ("gallium/targets: don't leave an empty target directory(ies)")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/gallium/targets/dri/Makefile.am
src/gallium/targets/vdpau/Makefile.am
src/gallium/targets/xvmc/Makefile.am

index 4d92f45e421df6acaab349b64e1d51995104f8ce..459459ebed29ffcfdb190a8e4cfdbff745b73190 100644 (file)
@@ -139,12 +139,11 @@ endif
 # gallium_dri.so in the set of final installed files.
 install-data-hook:
        for i in $(TARGET_DRIVERS); do                                  \
-               has_drivers=1;                                          \
                ln -f $(DESTDIR)$(dridir)/gallium_dri.so                \
                      $(DESTDIR)$(dridir)/$${i}_dri.so;                 \
        done;                                                           \
        $(RM) $(DESTDIR)$(dridir)/gallium_dri.*;                        \
-       test $${has_drivers} -eq 1 || $(RM) -d $(DESTDIR)$(dridir)
+       $(RM) -d $(DESTDIR)$(dridir) &>/dev/null || true
 
 uninstall-hook:
        for i in $(TARGET_DRIVERS); do                                  \
index a0f310bc5967423ac822dd7e1576658f072f570b..cd7ef982aac070b2b1ee429a4367cb7a52cfe8b5 100644 (file)
@@ -108,7 +108,6 @@ endif
 install-data-hook:
        $(AM_V_GEN)dest_dir=$(DESTDIR)/$(vdpaudir);                     \
        for i in $(TARGET_DRIVERS); do                                  \
-               has_drivers=1;                                          \
                j=libvdpau_gallium.$(LIB_EXT);                          \
                k=libvdpau_$${i}.$(LIB_EXT);                            \
                l=$${k}.$(VDPAU_MAJOR).$(VDPAU_MINOR).0;                \
@@ -122,7 +121,7 @@ install-data-hook:
                       $${dest_dir}/$${k};                              \
        done;                                                           \
        $(RM) $${dest_dir}/libvdpau_gallium.*;                          \
-       test $${has_drivers} -eq 1 || $(RM) -d $${dest_dir}
+       $(RM) -d $${dest_dir} &>/dev/null || true
 
 uninstall-hook:
        for i in $(TARGET_DRIVERS); do                                  \
index b65a191eab0b25c1df564b7bbc7b543a0494264b..e29dd6a5cadc6a3c43419290773c69676aa685ad 100644 (file)
@@ -70,7 +70,6 @@ endif
 install-data-hook:
        $(AM_V_GEN)dest_dir=$(DESTDIR)/$(xvmcdir);                      \
        for i in $(TARGET_DRIVERS); do                                  \
-               has_drivers=1;                                          \
                j=libXvMCgallium.$(LIB_EXT);                            \
                k=libXvMC$${i}.$(LIB_EXT);                              \
                l=$${k}.$(XVMC_MAJOR).$(XVMC_MINOR).0;                  \
@@ -84,7 +83,7 @@ install-data-hook:
                       $${dest_dir}/$${k};                              \
        done;                                                           \
        $(RM) $${dest_dir}/libXvMCgallium.*;                            \
-       test $${has_drivers} -eq 1 || $(RM) -d $${dest_dir}
+       $(RM) -d $${dest_dir} &>/dev/null || true
 
 uninstall-hook:
        for i in $(TARGET_DRIVERS); do                                  \