diff --git a/scripts/Build-Pkg b/scripts/Build-Pkg index 3cb27c7f3..b129121b7 100755 --- a/scripts/Build-Pkg +++ b/scripts/Build-Pkg @@ -585,20 +585,34 @@ abort() { # hook_dump > $builddir/debug.hooks # - { dump_env - echo "PS1='\\[\\e[00m\\e[01;31m\\]debug-` - `$xpkg\\[\\e[00m\\]:[\\W]\\\$ '" - echo 'alias cp="cp -i" ; alias mv="mv -i"' - echo 'alias rm="rm -i" ; alias ls="ls --color=auto -a"' - echo 'alias ..="cd .." ; alias ...="cd ../.."' - echo "alias xdiff='sh $base/misc/archive/xdiff.sh'" - echo "alias bked='sh $base/misc/archive/bked.sh'" + { + dump_env + cat <<- EOT + PS1='\\[\\e[00m\\e[01;31m\\]debug-` + `$xpkg\\[\\e[00m\\]:[\\W]\\\$ ' + alias cp="cp -i" ; alias mv="mv -i" + alias rm="rm -i" ; alias ls="ls --color=auto -a" + alias ..="cd .." ; alias ...="cd ../.." + alias xdiff="sh $base/misc/archive/xdiff.sh" + alias bked="sh $base/misc/archive/bked.sh" + fixfile () { + # we use .vanilla to not rediff backup .orig from patch + [ -f \$1.vanilla ] || cp \$1 \$1.vanilla + \$EDITOR \$1 + } + fixfilediff() { + find -name '*.vanilla' | while read x ; do + diff -u \$x \${x/.vanilla/} + done + } + EOT } > $builddir/debug.buildenv # - { echo "#!/bin/bash" - echo "export PROMPT_COMMAND='. debug.buildenv; cd .; unset PROMPT_COMMAND'" - echo "cd $builddir; exec bash 200>> build.pid" - } > $builddir/debug_x.sh + cat > $builddir/debug_x.sh <<- EOT + #!/bin/bash + export PROMPT_COMMAND='. debug.buildenv; cd .; unset PROMPT_COMMAND' + cd $builddir; exec bash 200>> build.pid + EOT # if [ "$ROCK_THIS_IS_CHROOT" != 1 ]; then mv $builddir/debug_x.sh $builddir/debug.sh