Skip to contentSkip to conversation

f2fs-tools: delete only if the libf2fs_format.so* exists

PATCH In review Jianan Huang via Linux-f2fs-devel 1 participant 4 messages May 8, 2025 – May 9, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 f2fs-tools: delete only if the libf2fs_format.so* exists

Otherwise we will get the following error when executing make uninstall:

make uninstall-hook
make[2]: Entering directory '/home/huangjianan/code/f2fs-tools/mkfs' rm /usr/local/lib/libf2fs_format.so*
rm: cannot remove '/usr/local/lib/libf2fs_format.so*': No such file or directory make[2]: *** [Makefile:827: uninstall-hook] Error 1
make[2]: Leaving directory '/home/huangjianan/code/f2fs-tools/mkfs' make[1]: *** [Makefile:790: uninstall-am] Error 2
make[1]: Leaving directory '/home/huangjianan/code/f2fs-tools/mkfs'
make: *** [Makefile:418: uninstall-recursive] Error 1

Fixes b067004c92dc ("add configure option --with-root-libdir")
---
 mkfs/Makefile.am | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
mkfs/Makefile.am +3 -1
index bfffd88..fb7bce8 100644
@@ -27,4 +27,6 @@ install-exec-hook:
 	fi
 
 uninstall-hook:
-	rm $(DESTDIR)$(root_libdir)/libf2fs_format.so*
+	if test -f "$(DESTDIR)$(root_libdir)/libf2fs_format.so*"; then \
+		rm $(DESTDIR)$(root_libdir)/libf2fs_format.so*; \
+	fi
\ No newline at end of file
Signature · 8 lines
2.43.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#1 lore raw

PATCH 2/2 f2fs-tools: clean up dump.f2fs etc. when uninstall

Otherwise, some lonely soft links will be left in /usr/local/bin.

---
 fsck/Makefile.am | 8 ++++++++
 1 file changed, 8 insertions(+)
fsck/Makefile.am +8 -0
index ea3b26a..f0d7f87 100644
@@ -21,3 +21,11 @@ install-data-hook:
 	ln -sf fsck.f2fs $(DESTDIR)/$(sbindir)/sload.f2fs
 	ln -sf fsck.f2fs $(DESTDIR)/$(sbindir)/f2fslabel
 	ln -sf fsck.f2fs $(DESTDIR)/$(sbindir)/inject.f2fs
+
+uninstall-hook:
+	-rm -f $(DESTDIR)/$(sbindir)/dump.f2fs
+	-rm -f $(DESTDIR)/$(sbindir)/defrag.f2fs
+	-rm -f $(DESTDIR)/$(sbindir)/resize.f2fs
+	-rm -f $(DESTDIR)/$(sbindir)/sload.f2fs
+	-rm -f $(DESTDIR)/$(sbindir)/f2fslabel
+	-rm -f $(DESTDIR)/$(sbindir)/inject.f2fs
Signature · 8 lines
2.43.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
author Reviewed-by Chao Yu on v1 2/2
#2 lore raw

Re: [f2fs-dev] [PATCH 2/2] f2fs-tools: clean up dump.f2fs etc. when uninstall

Quoted 3 lines · Jianan Huang

Otherwise, some lonely soft links will be left in /usr/local/bin.

Thanks,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

author Reviewed-by Chao Yu on v1 1/2
#3 lore raw
In reply to Jianan Huang via Linux-f2fs-devel
Quoted 12 lines · Jianan Huang

Otherwise we will get the following error when executing make uninstall:

make uninstall-hook
make[2]: Entering directory '/home/huangjianan/code/f2fs-tools/mkfs' rm /usr/local/lib/libf2fs_format.so*
rm: cannot remove '/usr/local/lib/libf2fs_format.so*': No such file or directory make[2]: *** [Makefile:827: uninstall-hook] Error 1
make[2]: Leaving directory '/home/huangjianan/code/f2fs-tools/mkfs' make[1]: *** [Makefile:790: uninstall-am] Error 2
make[1]: Leaving directory '/home/huangjianan/code/f2fs-tools/mkfs'
make: *** [Makefile:418: uninstall-recursive] Error 1

Quoted 2 lines
Fixes b067004c92dc ("add configure option --with-root-libdir")

Thanks,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel