From 5eb5179fb8acb14d52c2c32eff82235a5d64f20d Mon Sep 17 00:00:00 2001 From: Dil3mm4 Date: Tue, 19 Jun 2018 00:11:33 +0200 Subject: [PATCH 1/8] script: multiple changes save_the_dev function that stashes current work to reapply if after sync do get bleeding edge patches on everything saving the dev's ass; adding some humor to the interation with user; --- build-dakkar.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/build-dakkar.sh b/build-dakkar.sh index 77d19e00..5d6b4cdf 100644 --- a/build-dakkar.sh +++ b/build-dakkar.sh @@ -4,6 +4,7 @@ set -e ## set defaults rom_fp="$(date +%y%m%d)" +curpath=$PWD myname="$(basename "$0")" if [[ $(uname -s) = "Darwin" ]];then @@ -13,7 +14,7 @@ elif [[ $(uname -s) = "Linux" ]];then fi ## handle command line arguments -read -p "Do you want to sync? " choice +read -p "[Phhusson magic-wand] Do you want to sync the whole jazz? " choice function help() { cat < Date: Tue, 19 Jun 2018 00:22:44 +0200 Subject: [PATCH 2/8] script: derp --- build-dakkar.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-dakkar.sh b/build-dakkar.sh index 5d6b4cdf..90fab6da 100644 --- a/build-dakkar.sh +++ b/build-dakkar.sh @@ -304,9 +304,12 @@ function jack_env() { function save_the_dev() { cd device/phh/treble git stash - git stash apply cd $curpath sync_repo + cd device/phh/treble + git stash apply + cd $curpath + } parse_options "$@" From e9dfb1e0bc225c7397da467fef2e32842c50d99c Mon Sep 17 00:00:00 2001 From: Dil3mm4 Date: Tue, 19 Jun 2018 04:43:21 +0200 Subject: [PATCH 3/8] script: fix stuff separating stash and stash applying via two functions now --- build-dakkar.sh | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/build-dakkar.sh b/build-dakkar.sh index 90fab6da..4084e32a 100644 --- a/build-dakkar.sh +++ b/build-dakkar.sh @@ -302,14 +302,23 @@ function jack_env() { } function save_the_dev() { - cd device/phh/treble - git stash - cd $curpath - sync_repo - cd device/phh/treble - git stash apply - cd $curpath - + if [ -d device/phh/treble ];then + cd device/phh/treble + git stash -u + cd $curpath + sync_repo + cd device/phh/treble + git stash apply + cd $curpath + fi +} + +function restore_the_dev() { + if [ -d device/phh/trble ];then + cd device/phh/treble + git stash apply + cd $curpath + fi } parse_options "$@" @@ -327,6 +336,8 @@ init_main_repo init_local_manifest init_patches save_the_dev +sync_repo +restore_the_dev fi patch_things jack_env From 74bff4efd026d9e3982b7e273871ee009b7bcad7 Mon Sep 17 00:00:00 2001 From: Dil3mm4 Date: Tue, 19 Jun 2018 15:44:01 +0200 Subject: [PATCH 4/8] script: fixing moar derps --- build-dakkar.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/build-dakkar.sh b/build-dakkar.sh index 4084e32a..ed5cef39 100644 --- a/build-dakkar.sh +++ b/build-dakkar.sh @@ -304,17 +304,16 @@ function jack_env() { function save_the_dev() { if [ -d device/phh/treble ];then cd device/phh/treble - git stash -u - cd $curpath - sync_repo - cd device/phh/treble - git stash apply + if git stash -u | grep -q 'No local changes to save';then + stashstatus=blank + fi cd $curpath + fi } function restore_the_dev() { - if [ -d device/phh/trble ];then + if [ -d device/phh/trble ] && [ -z "$stashstatus" ];then cd device/phh/treble git stash apply cd $curpath @@ -335,7 +334,7 @@ init_release init_main_repo init_local_manifest init_patches -save_the_dev +save_the_dev sync_repo restore_the_dev fi From 76e7665af15734f89a24b6396b6328a0bb013129 Mon Sep 17 00:00:00 2001 From: Dil3mm4 Date: Tue, 19 Jun 2018 21:12:53 +0200 Subject: [PATCH 5/8] script: pixel, remove extras. --- build-dakkar.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/build-dakkar.sh b/build-dakkar.sh index ed5cef39..04a960bb 100644 --- a/build-dakkar.sh +++ b/build-dakkar.sh @@ -102,7 +102,6 @@ function get_rom_type() { mainbranch="oreo-mr1" localManifestBranch="android-8.1" treble_generate="" - extra_make_options="WITHOUT_CHECK_API=true" ;; crdroid) mainrepo="https://github.com/crdroidandroid/android" From f53536ced3c72ee80c39488ae0c762f2ee77ed4c Mon Sep 17 00:00:00 2001 From: Dil3mm4 Date: Tue, 19 Jun 2018 21:17:26 +0200 Subject: [PATCH 6/8] script: change if condition for save_the_dev; --- build-dakkar.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-dakkar.sh b/build-dakkar.sh index 04a960bb..1ab48d1e 100644 --- a/build-dakkar.sh +++ b/build-dakkar.sh @@ -303,8 +303,8 @@ function jack_env() { function save_the_dev() { if [ -d device/phh/treble ];then cd device/phh/treble - if git stash -u | grep -q 'No local changes to save';then - stashstatus=blank + if ! git stash -u;then + stashstatus=empty fi cd $curpath From e631b318210f2d9f7cc58bf0eb2ce9f12c55f5d7 Mon Sep 17 00:00:00 2001 From: Dil3mm4 Date: Tue, 19 Jun 2018 21:51:59 +0200 Subject: [PATCH 7/8] script: changes dropping $curpath as function should already run in subshells; --- build-dakkar.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/build-dakkar.sh b/build-dakkar.sh index 1ab48d1e..8da1ee76 100644 --- a/build-dakkar.sh +++ b/build-dakkar.sh @@ -4,7 +4,6 @@ set -e ## set defaults rom_fp="$(date +%y%m%d)" -curpath=$PWD myname="$(basename "$0")" if [[ $(uname -s) = "Darwin" ]];then @@ -306,7 +305,6 @@ function save_the_dev() { if ! git stash -u;then stashstatus=empty fi - cd $curpath fi } @@ -315,7 +313,6 @@ function restore_the_dev() { if [ -d device/phh/trble ] && [ -z "$stashstatus" ];then cd device/phh/treble git stash apply - cd $curpath fi } From 1f2ec8df8495bf69aea45eb6bf20388eeecef5e9 Mon Sep 17 00:00:00 2001 From: Dil3mm4 Date: Tue, 19 Jun 2018 22:11:42 +0200 Subject: [PATCH 8/8] script: fixes + addition typo, trble => treble; function init_main_repo_ref: ask user if it has a reference path to sync from and let him do that in the case. --- build-dakkar.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build-dakkar.sh b/build-dakkar.sh index 8da1ee76..593411cd 100644 --- a/build-dakkar.sh +++ b/build-dakkar.sh @@ -14,6 +14,10 @@ fi ## handle command line arguments read -p "[Phhusson magic-wand] Do you want to sync the whole jazz? " choice +read -p "[Phhusson magic-wand] Do you have a reference path? " refchoice +if [[ $refchoice == *"y"* ]];then +read -p "[Phhusson magic-wand] Insert your path including the home path, eg. /home/user/dirtoreference " refpath +fi function help() { cat <