[PATCH] xfsdump: don't fail installation if /sbin is symlink of /usr/sbin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some distributions, like Fedora, have /bin and /sbin as symlinks
pointing to /usr/* and this patch adds compatibility for these cases.

Signed-off-by: Jan Tulak <jtulak@xxxxxxxxxx>
---
 dump/Makefile    | 4 +++-
 restore/Makefile | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dump/Makefile b/dump/Makefile
index 97879fa..66f00d3 100644
--- a/dump/Makefile
+++ b/dump/Makefile
@@ -100,7 +100,9 @@ install: default
 	$(INSTALL) -m 755 -d $(PKG_ROOT_SBIN_DIR)
 	$(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_ROOT_SBIN_DIR)
 	$(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
-	$(INSTALL) -S $(PKG_ROOT_SBIN_DIR)/$(LTCOMMAND) $(PKG_SBIN_DIR)/$(LTCOMMAND)
+	# skip symlink when /sbin is alread symlinked to /usr/sbin, like on Fedora
+	test $(PKG_ROOT_SBIN_DIR) -ef $(PKG_SBIN_DIR) || \
+		$(INSTALL) -S $(PKG_ROOT_SBIN_DIR)/$(LTCOMMAND) $(PKG_SBIN_DIR)/$(LTCOMMAND)
 install-dev:
 
 .dep: $(COMMINCL) $(COMMON) $(INVINCL) $(INVCOMMON)
diff --git a/restore/Makefile b/restore/Makefile
index c6f3f25..20c870a 100644
--- a/restore/Makefile
+++ b/restore/Makefile
@@ -110,7 +110,9 @@ install: default
 	$(INSTALL) -m 755 -d $(PKG_ROOT_SBIN_DIR)
 	$(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_ROOT_SBIN_DIR)
 	$(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
-	$(INSTALL) -S $(PKG_ROOT_SBIN_DIR)/$(LTCOMMAND) $(PKG_SBIN_DIR)/$(LTCOMMAND)
+	# skip symlink when /sbin is alread symlinked to /usr/sbin, like on Fedora
+	test $(PKG_ROOT_SBIN_DIR) -ef $(PKG_SBIN_DIR) || \
+		$(INSTALL) -S $(PKG_ROOT_SBIN_DIR)/$(LTCOMMAND) $(PKG_SBIN_DIR)/$(LTCOMMAND)
 install-dev:
 
 .dep: $(COMMINCL) $(COMMON) $(INVINCL) $(INVCOMMON)
-- 
2.19.1




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux