diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/get.sh | 20 | ||||
-rw-r--r-- | include/tree.sh | 37 |
2 files changed, 21 insertions, 36 deletions
diff --git a/include/get.sh b/include/get.sh index e3e4c311..9ab6956d 100644 --- a/include/get.sh +++ b/include/get.sh @@ -53,14 +53,13 @@ fetch_project() clone_project() { - # if loc is blank, don't create a target - # directory; just update the caches - loc="" if singletree "$project"; then loc="src/$project" - fi - if e "$loc" d missing; then + if [ -d "$loc" ]; then + return 0 + fi + remkdir "${tmpgit%/*}" git_prep "$url" "$bkup_url" \ "$xbmkpwd/config/$project/patches" "$loc" @@ -87,16 +86,7 @@ git_prep() x_ xbmkdir "${_loc%/*}" fi - if [ -z "$_loc" ]; then - # we only used git_prep to update caches, on - # a multi-tree project. tmpgit is useless now. - - x_ rm -Rf "$tmpgit" - else - # actual downloaded - - x_ mv "$tmpgit" "$_loc" - fi + x_ mv "$tmpgit" "$_loc" } fetch_submodule() diff --git a/include/tree.sh b/include/tree.sh index 450d79cf..166a3d86 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -8,7 +8,9 @@ flag="" # macros, overridden depending on the flag +if_do_make="" if_dry_build=":" +if_not_do_make=":" if_not_dry_build="" autoconfargs="" @@ -23,7 +25,6 @@ cmakedir="" cmd="" defconfig="" dest_dir="" -do_make="" elfdir="" forcepull="" gccdir="" @@ -75,24 +76,25 @@ trees() # where only a subset of build tasks are done, # and $if_not_dry_build is prefixed to skipped commands - if_not_dry_build=":" if_dry_build="" + if_not_dry_build=":" ;; -b) : ;; -u) mode="oldconfig" ;; -m) mode="menuconfig" ;; -c) mode="distclean" ;; -x) mode="crossgcc-clean" ;; - -f) # download source code for a project - do_make="n" # lets us know not to build anything - if_not_dry_build=":" + -f|-F) # download source code for a project + # macros. colon means false. + if_do_make=":" if_dry_build="" - ;; - -F) # same as -F, but don't skip git fetch/pull on cache - do_make="n" # lets us know not to build anything + if_not_do_make="" if_not_dry_build=":" - if_dry_build="" - forcepull="y" + if [ "$flag" = "-F" ]; then + # don't skip git fetch/pull on cached src + + forcepull="y" + fi ;; -s) mode="savedefconfig" ;; -l) mode="olddefconfig" ;; @@ -319,12 +321,8 @@ configure_project() break fi - if [ "$do_make" != "n" ]; then - # if we're *downloading* a project, then - # we don't need to to change the target.cfg - + $if_do_make \ break - fi if [ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ] then # we have found the main source tree that @@ -356,14 +354,11 @@ configure_project() if [ ! -f "CHANGELOG" ]; then delete_old_project_files - fi - if [ "$do_make" = "n" ]; then - if [ ! -f "CHANGELOG" ]; then + $if_not_do_make \ fetch_${cmd#build_} - fi - - return 1 fi + $if_not_do_make \ + return 1 x_ ./mk -f "$project" "$target" } |