diff options
author | Joshua Ismael Haase Hernández <hahj87@gmail.com> | 2011-07-19 14:50:29 -0500 |
---|---|---|
committer | Joshua Ismael Haase Hernández <hahj87@gmail.com> | 2011-07-19 14:50:29 -0500 |
commit | f3cfc59e0e4c6d27be065cee49ca3e133d045bdd (patch) | |
tree | b4ec42dc33305d1d45bed2afacaa2c7aab08245a /prtools/prfullpkg | |
parent | 394783a7fda0f1fb587416d54af563730bff939c (diff) |
Some fixing
Diffstat (limited to 'prtools/prfullpkg')
-rwxr-xr-x | prtools/prfullpkg | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/prtools/prfullpkg b/prtools/prfullpkg index e3a022b..dd2ba3a 100755 --- a/prtools/prfullpkg +++ b/prtools/prfullpkg @@ -67,11 +67,13 @@ function get_fullver { # return : full version spec, including epoch (if necessa function cleanup { # Cleans the build_dir. - [[ "${do_cleanup}" = "n" || ! -d ${build_dir} ]] && return 0 # Do nothing or already cleaned. + [ ! -d "${build_dir}" -o "${build_only}" = 'y' ] && return 0 # Do nothing or already cleaned. - msg "Cleaning up..." - [ $level -eq 0 ] && rm -rf $build_dir/* # Only do cleanup on level 0. + if [ $level -eq 0 ]; then # Only do cleanup on level 0. + msg "Cleaning up ${build_dir}" + rm -rf "$build_dir/*" + fi } function find_deps { # Checks ABSROOT and look for target pkg deps. Adds them if not built or outdated. @@ -166,7 +168,7 @@ function find_deps { # Checks ABSROOT and look for target pkg deps. Adds them i unset next_level dir # unset PKGBUILD variables - unset pkgname pkgver pkgrel epoch pkgdesc arch url license groups depends \ + unset pkgbase pkgname pkgver pkgrel epoch pkgdesc arch url license groups depends \ makedepens checkdepends optdepends provides conflicts replaces backup \ options install changelog source noextract md5sums build check package } @@ -264,7 +266,6 @@ function trap_exit { # End inmediately but print a useful message # Trap signals from makepkg set -E -trap 'cleanup' 0 trap 'trap_exit "(prfullpkg:${level}) TERM signal caught. Exiting..."' TERM HUP QUIT trap 'trap_exit "(prfullpkg:${level}) Aborted by user! Exiting..."' INT trap 'trap_exit "(prfullpkg:${level}) An unknown error has occurred. Exiting..."' ERR @@ -314,14 +315,14 @@ fi if [ $level -eq 0 ]; then - build_dir=${build_dir:-$(mktemp -d /tmp/fullpkg.XXXXXX)} # use -d option or else mktemp - if [ ! -d ${build_dir} ]; then # in case of custom -d option mkdir -p ${build_dir} else cleanup # files already there can screw find_deps fi + build_dir=${build_dir:-$(mktemp -d /tmp/fullpkg.XXXXXX)} # use -d option or else mktemp + touch ${build_dir}/{log,BUILDORDER} ${ban_file} # make files for log and buildorder buildorder=${build_dir}/BUILDORDER |