From 067db8fa72afe7a3dcbaf62a561be53fd39a4f5f Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Fri, 8 Feb 2008 19:13:29 +0000 Subject: [PATCH] Modifications to nixos-checkout for multi-branch support. svn path=/nixos/trunk/; revision=10558 --- installer/nixos-checkout.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/installer/nixos-checkout.sh b/installer/nixos-checkout.sh index 1551f009de27..7c8f329b658a 100644 --- a/installer/nixos-checkout.sh +++ b/installer/nixos-checkout.sh @@ -23,15 +23,26 @@ fi cd /etc/nixos +if test -n "$NIXOS" && test "$NIXOS_BRANCH" = 1 && test -z "$CHECKOUT_BRANCH" && ! test "$NIXOS" = "/etc/nixos/nixos"; then + CHECKOUT_BRANCH=${NIXOS##*/} + CHECKOUT_BRANCH=${CHECKOUT_BRANCH#nixos-} + CHECKOUT_BRANCH=branches/${CHECKOUT_BRANCH} + CHECKOUT_SUFFIX=-${CHECKOUT_BRANCH##*/} +fi + +if test -n "${CHECKOUT_BRANCH}" && test -z "${CHECKOUT_SUFFIX}" ; then + CHECKOUT_SUFFIX=-${CHECKOUT_BRANCH##*/} +fi; + # Move any old nixos or nixpkgs directories out of the way. backupTimestamp=$(date "+%Y%m%d%H%M%S") if test -e nixos -a ! -e nixos/.svn; then - mv nixos nixos-$backupTimestamp + mv nixos${CHECKOUT_SUFFIX} nixos-$backupTimestamp fi if test -e nixpkgs -a ! -e nixpkgs/.svn; then - mv nixpkgs nixpkgs-$backupTimestamp + mv nixpkgs${CHECKOUT_SUFFIX} nixpkgs-$backupTimestamp fi if test -e services -a ! -e services/.svn; then @@ -39,10 +50,10 @@ if test -e services -a ! -e services/.svn; then fi # Check out the NixOS and Nixpkgs sources. -svn co https://svn.cs.uu.nl:12443/repos/trace/nixos/trunk nixos -svn co https://svn.cs.uu.nl:12443/repos/trace/nixpkgs/trunk nixpkgs +svn co https://svn.cs.uu.nl:12443/repos/trace/nixos/trunk nixos${CHECKOUT_SUFFIX} +svn co https://svn.cs.uu.nl:12443/repos/trace/nixpkgs/${CHECKOUT_BRANCH:-trunk} nixpkgs${CHECKOUT_SUFFIX} svn co https://svn.cs.uu.nl:12443/repos/trace/services/trunk services # Add a few required symlink. -ln -sfn ../services nixos/services -ln -sfn ../nixpkgs/pkgs nixos/pkgs +ln -sfn ../services nixos${CHECKOUT_SUFFIX}/services +ln -sfn ../nixpkgs${CHECKOUT_SUFFIX}/pkgs nixos${CHECKOUT_SUFFIX}/pkgs