2012-12-03 21:43:26 +00:00
|
|
|
#!/bin/sh
|
2013-01-06 17:43:58 +00:00
|
|
|
# GNU Guix --- Functional package management for GNU
|
2013-06-17 21:54:39 +00:00
|
|
|
# Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
|
2012-12-03 21:43:26 +00:00
|
|
|
#
|
2013-01-06 17:43:58 +00:00
|
|
|
# This file is part of GNU Guix.
|
2012-12-03 21:43:26 +00:00
|
|
|
#
|
2013-01-06 17:43:58 +00:00
|
|
|
# GNU Guix is free software; you can redistribute it and/or modify it
|
2012-12-03 21:43:26 +00:00
|
|
|
# under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
# your option) any later version.
|
|
|
|
#
|
2013-01-06 17:43:58 +00:00
|
|
|
# GNU Guix is distributed in the hope that it will be useful, but
|
2012-12-03 21:43:26 +00:00
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2013-01-06 17:43:58 +00:00
|
|
|
# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
2012-12-03 21:43:26 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Update the local copy of Nix source code needed to build the daemon.
|
|
|
|
# Assume GNU Coreutils and Git are available.
|
|
|
|
#
|
|
|
|
|
|
|
|
top_srcdir="${top_srcdir:-..}"
|
|
|
|
|
|
|
|
log()
|
|
|
|
{
|
|
|
|
echo "sync-with-upstream: $@" >&2
|
|
|
|
}
|
|
|
|
|
|
|
|
# checked_in_p FILE
|
|
|
|
checked_in_p()
|
|
|
|
{
|
|
|
|
( cd "$top_srcdir" ;
|
|
|
|
git ls-tree HEAD -- "nix/$1" | grep "$1" > /dev/null )
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ ! -d "$top_srcdir/build-aux" ]
|
|
|
|
then
|
|
|
|
log "\`$top_srcdir' is not the valid top-level source directory"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
for upstream_file in `cd "$top_srcdir/nix-upstream/src" ;
|
|
|
|
find . -name \*.c -or -name \*.h -or -name \*.cc -or -name \*.hh \
|
|
|
|
-or -name \*.cpp -or -name \*.hpp -or -name \*.sql`
|
|
|
|
do
|
|
|
|
if grep "$upstream_file" "$top_srcdir/daemon.am" > /dev/null
|
|
|
|
then
|
|
|
|
if checked_in_p "$upstream_file"
|
|
|
|
then
|
|
|
|
log "skipping \`$upstream_file', which has a checked-in copy"
|
|
|
|
else
|
|
|
|
( cd "$top_srcdir/nix-upstream/src" && \
|
|
|
|
cp -v --parents "$upstream_file" ../../nix )
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
log "skipping \`$upstream_file', which is not used"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2013-06-17 21:54:39 +00:00
|
|
|
# This file should be generated by our build system so remove it.
|
|
|
|
rm -fv "$top_srcdir/nix/libstore/schema.sql.hh"
|
|
|
|
|
2012-12-14 10:47:09 +00:00
|
|
|
cp -v "$top_srcdir/nix-upstream/COPYING" "$top_srcdir/nix"
|
|
|
|
cp -v "$top_srcdir/nix-upstream/AUTHORS" "$top_srcdir/nix"
|
2012-12-05 15:29:28 +00:00
|
|
|
|
|
|
|
# Substitutions.
|
|
|
|
sed -i "$top_srcdir/nix/libstore/gc.cc" \
|
|
|
|
-e 's|/nix/find-runtime-roots\.pl|/guix/list-runtime-roots|g'
|