# -*- tcl -*-
# --------------------------------------------------
# (C) 1997	Andreas Kupries <a.kupries@westend.com>
#
# CVS:	$Id: trans_pwd,v 1.3 1998/06/02 16:59:14 aku Exp $
#
# @c Transporter. Working directory is used as destination.
# @s Transport to working directory.
# @i transport, working directory
# --------------------------------------------------

::makedist::transporter pwd "To working directory" {
    # @c The <a module> archives and any supporting files are transfered from
    # @c the <a builddir> to the current working directory.

    set here [::pwd]
    cd $builddir

    set fail [catch {
	# Copy all files left by the packer(s)
	eval file rename -force [glob ${module}*] $here

	# And now the supporting files, if any. A bit more
	# tricklish, as their names are about to be changed.

	cd sup.$module
	foreach f [glob *] {
	    file rename -force $f [file join $here ${module}.$f]
	}
    } msg]	;# {}

    cd $here

    if {$fail} {
	Log warning $msg
    }
    return
}
