[PATCH 2/2] compat-drivers: Add 2 convenience functions

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

 



Add copyFiles and copyDirectories. Their functionality is repeated
over and over in the current code. We'll start using them to get
rid of redundant code snippets.

Signed-off-by: Ozan Çağlayan <ozancag@xxxxxxxxx>
---
 scripts/admin-update.sh | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index bf5fb8e..22365cd 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -163,6 +163,24 @@ nagometer() {
 
 }
 
+# Copy each file in $1 into $2
+copyFiles() {
+	FILES=$1
+	TARGET=$2
+	for file in $FILES; do
+		echo "Copying $GIT_TREE/$TARGET/$file"
+		cp "$GIT_TREE/$TARGET/$file" $TARGET/
+	done
+}
+
+copyDirectories() {
+	DIRS=$1
+	for dir in $DIRS; do
+		echo "Copying $GIT_TREE/$dir/*.[ch]"
+		cp $GIT_TREE/$dir/{Kconfig,Makefile,*.[ch]} $dir/ &> /dev/null
+	done
+}
+
 # First check cmdline args to understand
 # which patches to apply and which release tag to set.
 #
-- 
1.7.11.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux