A while back I was asking about why nightly was building everything in a
zfs clone of a snapshot of a fully built repo.  The issue apparently is
that there are .make.state files that contain the absolute path of the
repo in which they are created so they are recreated when nightly is run
in the repo clone (which has a different path).  Today I tried running
the following script that replaces the hg root part of the path in the
.make.state files in the clone to be the hg root of the clone and I
found that an incremental nightly only built what it normally does in a
fully built repo.

Here is the script:

#!/bin/ksh93 -p

# Modify paths found in .make.state files to suite new repository.  This is
# usefile when creating a zfs clone of the snapshot of a hg repo where nightly
# has been run.  Updating the .make.state files in the clone so the hg root
# path matches the clone will prevent dmake from unnecessarily building
# binaries.

if [[ $# -ne 2 || "$1" == @('-?'|'--help') ]]
then
    output=; rc=0
    [[ $# -ne 2 ]] && { output='-u2'; rc=1; }
    print $output "Usage: ${0##*/} parent_hg_root clone_hg_root"
    print $output "Example: ${0##*/} /pool/willf/hg/i386/bug1 
/pool/willf/hg/i386/bug2"
    exit $rc
fi

trap "echo 'A command failed, aborting.'; exit 1" ERR

# cd to clone hg root dir
cd $2

tmpmsfile=$(mktemp -t tmp-make-state.XXXXXX)

for msfile in $(find . -type d -name .hg -prune -o -type f -name '.make.state' 
-print)
do
    sed "s[$1[$2[g" < $msfile > $tmpmsfile
    cp $tmpmsfile $msfile
done
################################ End of script 
#####################################

Is this safe/correct to do?

-- 
Will Fiveash
Sun Microsystems Inc.
http://opensolaris.org/os/project/kerberos/
Sent from mutt, a sweet ASCII MUA
_______________________________________________
tools-discuss mailing list
tools-discuss@opensolaris.org

Reply via email to