view build-aux/move-if-change @ 19637:b74ae93040e8

limit number of jobs for make command to 1 under windows (bug #44053) * scripts/pkg/private/configure_make.m: set jobs as 1 in pc, nproc ("overridable") if not pc
author Avinoam Kalma
date Wed, 21 Jan 2015 21:19:38 -0500
parents b67c2d580a25
children 5e50f25f245a
line wrap: on
line source

#!/bin/sh
#
# Like mv $1 $2, but if the files are the same, just delete $1.
# Status is 0 if $2 is changed, 1 otherwise.

if test -r $2; then
  if cmp $1 $2 > /dev/null; then
    echo $2 is unchanged
    rm -f $1
  else
    mv -f $1 $2
  fi
else
  mv -f $1 $2
fi