I tried an experiment of doing an incremental nightly in a zfs clone of a built repo after I renamed the original repo zfs filesystem and found that there are files generated in a build other than .make.state that have absolute paths in them so my script below is not enough. Note, because I renamed the original repo this caused errors in the nightly in the zfs clone.
It's unfortunate that absolute paths appear in various files instead of relative paths as that would have made it possible to safely/correctly do what I was hoping to do. On Fri, Jan 08, 2010 at 07:59:51PM -0600, Will Fiveash wrote: > 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 -- 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