run-test
changeset 271 c1ceab337505
parent 269 a09f1bc9a6cf
equal deleted inserted replaced
270:28b355b7390e 271:c1ceab337505
     6 
     6 
     7 DEBVERSION=sid
     7 DEBVERSION=sid
     8 
     8 
     9 PRISTINE=/var/local/cache/pristine/$DEBVERSION
     9 PRISTINE=/var/local/cache/pristine/$DEBVERSION
    10 
    10 
       
    11 if [ ! -e $PRISTINE ] ; then
       
    12     echo "Debian pristine image not found, try running create-source-image"
       
    13     echo $PRISTINE
       
    14     exit -1
       
    15 fi
       
    16 
    11 TOPDIR=`pwd`
    17 TOPDIR=`pwd`
       
    18 mkdir -p $TOPDIR/build/env
    12 BACKING=$TOPDIR/build/env/backing
    19 BACKING=$TOPDIR/build/env/backing
    13 MOUNT=$TOPDIR/build/env/mount
    20 MOUNT=$TOPDIR/build/env/mount
    14 mkdir -p $TOPDIR/build/env
    21 if [ -e $MOUNT ] ; then
       
    22     echo "Removing old filesystem"
       
    23     # FIXME: evil hack!
       
    24     chroot $MOUNT /etc/init.d/ssh stop || true
       
    25     umount $MOUNT/proc || true
       
    26     umount $MOUNT || true
       
    27     rm -rf $MOUNT
       
    28 fi
       
    29 if [ -e $BACKING ] ; then
       
    30     echo "Copying deb files into cache"
       
    31     cp $BACKING/var/cache/apt/archives/* build/aptcache/$DEBVERSION || true
       
    32     echo "Deleting old filesystem backing store"
       
    33     rm -rf $BACKING
       
    34 fi
    15 mkdir $BACKING $MOUNT
    35 mkdir $BACKING $MOUNT
    16 
    36 
    17 touch $BACKING/please-trash-this-system
    37 touch $BACKING/please-trash-this-system
    18 mkdir -p $BACKING/etc
    38 mkdir -p $BACKING/etc
    19 echo "pristine" > $BACKING/etc/debian_chroot
    39 echo "pristine" > $BACKING/etc/debian_chroot
    20 cp -v policy-rc.d $BACKING/etc/policy-rc.d
    40 cp -v policy-rc.d $BACKING/etc/policy-rc.d
    21 
    41 
    22 mkdir -p $BACKING/var/cache/apt/archives
    42 mkdir -p $BACKING/var/cache/apt/archives
    23 cp -v build/aptcache/$DEBVERSION/* $BACKING/var/cache/apt/archives || true
    43 echo "Copying deb files out of cache"
       
    44 cp build/aptcache/$DEBVERSION/* $BACKING/var/cache/apt/archives || true
    24 
    45 
    25 cp -av action $BACKING
    46 cp -av action $BACKING
    26 #hg -R ../mercurial-server archive -r default $BACKING/action/mercurial-server
    47 #hg -R ../mercurial-server archive -r default $BACKING/action/mercurial-server
    27 ( cd ../mercurial-server && \
    48 ( cd ../mercurial-server && \
    28     hg st -mac0n | cpio -p -0 -d $BACKING/action/mercurial-server )
    49     hg st -mac0n | cpio -p -0 -d $BACKING/action/mercurial-server )
    35 #mount --bind /dev/pts "$MOUNT/dev/pts"
    56 #mount --bind /dev/pts "$MOUNT/dev/pts"
    36 mount -t proc proc $MOUNT/proc
    57 mount -t proc proc $MOUNT/proc
    37 
    58 
    38 chroot $MOUNT ./action/go
    59 chroot $MOUNT ./action/go
    39 
    60 
    40 umount $MOUNT/proc
       
    41 umount $MOUNT
       
    42 
    61 
    43 #cat $BACKING/action/results
    62 #cat $BACKING/action/results
    44 
    63 
    45 rm -rf build/env
    64 #rm -rf build/env
    46 
    65