#!/bin/ksh
#
# $Id: replacer 1023 2007-02-04 09:20:41Z comand $
#
# Copyright 2007 Cory Omand <comand@blastwave.org>
# All rights reserved.  Use is subject to license terms.
#
# Redistribution and/or use, with or without modification, is
# permitted.  This software is without warranty of any kind.  The
# author(s) shall not be liable in the event that use of the
# software causes damage.
#
# restorer - restore libtool .la file backups.
#

function usage {
    print "Usage: $0 <root_path>"
    exit 1
}

[ -z "$@" ] && usage

gfind $@ -type f -name '*.la~' -print0 | \
    gxargs --null --no-run-if-empty -n1 | \
        while read file ; do gcp -v $file ${file%.*~}.la ; done

