[source] usbmode: rename data files

LEDE Commits lede-commits at lists.infradead.org
Wed Oct 26 06:22:29 PDT 2016


blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/a2361eebfd5c000315cfb612b8ffb08c7c00ed17

commit a2361eebfd5c000315cfb612b8ffb08c7c00ed17
Author: Simon Hailes <btsimonh at googlemail.com>
AuthorDate: Tue Oct 11 19:01:21 2016 +0100

    usbmode: rename data files
    
    This is to ensure that git can be cloned onto a windows drive without failing.
    
    Signed-off-by: Simon Hailes <btsimonh at googlemail.com>
---
 package/utils/usbmode/Makefile                      | 11 +++++++++++
 package/utils/usbmode/data/{12d1:1f16 => 12d1-1f16} |  0
 2 files changed, 11 insertions(+)

diff --git a/package/utils/usbmode/Makefile b/package/utils/usbmode/Makefile
index 6737b5f..d835d37 100644
--- a/package/utils/usbmode/Makefile
+++ b/package/utils/usbmode/Makefile
@@ -45,6 +45,17 @@ define Build/Prepare
 	rm -f \
 		$(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/05c6:1000:sVe=GT
 	cp ./data/* $(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/
+	#in order to keep the Lede GIT repo free of filenames with colons,
+	#we name the files xxxx-yyyy
+	# and rename here after copying to the build directory
+	for filevar in $(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/*-* ; \
+	do \
+		[ -f "$$$$filevar" ] || continue ; \
+		FILENAME=$$$$(basename $$$$filevar) ; \
+		NEWNAME=$$$${FILENAME//-/:} ; \
+		rm "$(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/$$$$NEWNAME" ; \
+		mv "$(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/$$$$FILENAME" "$(PKG_BUILD_DIR)/$(PKG_DATA_PATH)/usb_modeswitch.d/$$$$NEWNAME" ; \
+	done
 endef
 
 define Package/usb-modeswitch/install
diff --git a/package/utils/usbmode/data/12d1:1f16 b/package/utils/usbmode/data/12d1-1f16
similarity index 100%
rename from package/utils/usbmode/data/12d1:1f16
rename to package/utils/usbmode/data/12d1-1f16



More information about the lede-commits mailing list