This patch includes a "patches" folder in the base directoy to
scripts/env's version control. Such a folder will be treated the
same way as the "files" folder.

Signed-off-by: Linus Lüssing <linus.luess...@web.de>

Index: kamikaze/scripts/env
===================================================================
--- kamikaze/scripts/env        (revision 18405)
+++ kamikaze/scripts/env        (working copy)
@@ -62,6 +62,7 @@
                git init &&
                touch .config &&
                mkdir files &&
+               mkdir patches &&
                git add . && 
                git commit -q -m "Initial import"
        } || {
@@ -87,6 +88,8 @@
        ln -s env/.config "$BASEDIR/.config"
        mkdir -p "$ENVDIR/files"
        [ -L "$BASEDIR/files" ] || ln -s env/files "$BASEDIR/files"
+       mkdir -p "$ENVDIR/patches"
+       [ -L "$BASEDIR/patches" ] || ln -s env/patches "$BASEDIR/patches"
 }
 
 env_do_reset() {
@@ -134,14 +137,17 @@
        env_init
        [ -L "$BASEDIR/.config" ] && rm -f "$BASEDIR/.config"
        [ -L "$BASEDIR/files" ] && rm -f "$BASEDIR/files"
+       [ -L "$BASEDIR/patches" ] && rm -f "$BASEDIR/patches"
        [ -f "$ENVDIR/.config" ] || ( cd "$ENVDIR/files" && find | grep -vE 
'^\.$' > /dev/null )
        env_sync_data
        if ask_bool 1 "Do you want to keep your current config and files"; then
                mkdir -p "$BASEDIR/files"
+               mkdir -p "$BASEDIR/patches"
                cp -a "$ENVDIR/files/*" "$BASEDIR/files" 2>/dev/null >/dev/null
+               cp -a "$ENVDIR/patches/*" "$BASEDIR/patches" 2>/dev/null 
>/dev/nul
                cp "$ENVDIR/.config" "$BASEDIR/"
        else
-               rm -rf "$BASEDIR/files" "$BASEDIR/.config"
+               rm -rf "$BASEDIR/files" "$BASEDIR/patches" "$BASEDIR/.config"
        fi
        cd "$BASEDIR"
        rm -rf "$ENVDIR"
@@ -186,18 +192,22 @@
                if ask_bool 0 "Do you want to clone the current environment?"; 
then
                        from="$branch"
                fi
-               rm -f "$BASEDIR/.config" "$BASEDIR/files"
+               rm -f "$BASEDIR/.config" "$BASEDIR/files" "$BASEDIR/patches"
        fi
        git checkout -b "$1" "$from"
-       if [ -f "$BASEDIR/.config" -o -d "$BASEDIR/files" ]; then
+       if [ -f "$BASEDIR/.config" -o -d "$BASEDIR/files" -o -d 
"$BASEDIR/patches" ]; then
                if ask_bool 1 "Do you want to keep your current config and 
files?"; then
                        [ -d "$BASEDIR/files" -a \! -L "$BASEDIR/files" ] && {
                                mv "$BASEDIR/files/"* "$ENVDIR/" 2>/dev/null
                                rmdir "$BASEDIR/files"
                        }
+                       [ -d "$BASEDIR/patches" -a \! -L "$BASEDIR/patches" ] 
&& {
+                               mv "$BASEDIR/patches/"* "$ENVDIR/" 2>/dev/null
+                               rmdir "$BASEDIR/patches"
+                       }
                        env_sync
                else
-                       rm -rf "$BASEDIR/.config" "$BASEDIR/files"
+                       rm -rf "$BASEDIR/.config" "$BASEDIR/files" 
"$BASEDIR/patches"
                fi
        fi
        env_link_config

Attachment: signature.asc
Description: Digital signature

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to