tazlito rev 393

tazlito: use local packages repository
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Nov 16 10:47:36 2015 +0200 (2015-11-16)
parents 00ea9c70d094
children 55187461ede3
files tazlito
line diff
     1.1 --- a/tazlito	Mon Nov 16 02:45:04 2015 +0200
     1.2 +++ b/tazlito	Mon Nov 16 10:47:36 2015 +0200
     1.3 @@ -2082,6 +2082,12 @@
     1.4  		cp $LIST_NAME $DISTRO/distro-packages.list
     1.5  		sed 's/\(.*\)/\1.tazpkg/' < $DISTRO/distro-packages.list > $DISTRO/list-packages
     1.6  		cd $PACKAGES_REPOSITORY
     1.7 +
     1.8 +		# Use packages repository as mirror, don't download unsynced packages from mirror server
     1.9 +		mkdir -p $ROOTFS/home/slitaz; ln -s ../../../../packages $ROOTFS/home/slitaz/packages
    1.10 +		echo '/home/slitaz/packages' > "$ROOTFS/var/lib/tazpkg/mirror"
    1.11 +		tazpkg --root=$ROOTFS >/dev/null # initial tazpkg setup in empty rootfs
    1.12 +
    1.13  		for pkg in $(cat $DISTRO/list-packages)
    1.14  		do
    1.15  			echo -n "Installing package: $pkg"
    1.16 @@ -2095,6 +2101,9 @@
    1.17  		rm $ROOTFS/var/lib/tazpkg/ID* $ROOTFS/var/lib/tazpkg/descriptions.txt \
    1.18  			$ROOTFS/var/lib/tazpkg/extra.list $ROOTFS/var/lib/tazpkg/files* \
    1.19  			$ROOTFS/var/lib/tazpkg/packages*
    1.20 +		# Back to default mirror
    1.21 +		rm $ROOTFS/home/slitaz/packages; rmdir $ROOTFS/home/slitaz
    1.22 +		echo "$DEFAULT_MIRROR" > $ROOTFS/var/lib/tazpkg/mirror
    1.23  
    1.24  		cd $DISTRO
    1.25  		cp distro-packages.list $ROOTFS/etc/tazlito
    1.26 @@ -2178,13 +2187,29 @@
    1.27  				mkdir ${ROOTFS}0$n
    1.28  				# Install packages
    1.29  				cd ${PACKAGES_REPOSITORY}
    1.30 +
    1.31 +				# Use packages repository as mirror, don't download unsynced packages from mirror server
    1.32 +				mkdir -p ${ROOTFS}0$n/home/slitaz; ln -s ../../../../packages ${ROOTFS}0$n/home/slitaz/packages
    1.33 +				echo '/home/slitaz/packages' > "$ROOTFS/var/lib/tazpkg/mirror"
    1.34 +				tazpkg --root=${ROOTFS}0$n >/dev/null # initial tazpkg setup in empty rootfs
    1.35 +
    1.36  				for pkg in $(cat $DISTRO/list-packages0$n)
    1.37  				do
    1.38  					echo -n "Installing package: $pkg"
    1.39  					yes y | tazpkg -i $pkg --root=${ROOTFS}0$n 2>&1 >> $log || exit 1
    1.40  					status
    1.41  				done
    1.42 +
    1.43  				rm -rf ${ROOTFS}0$n/boot ${ROOTFS}0$n/var/lib/tazpkg/packages.*
    1.44 +				# Clean packages cache
    1.45 +				find ${ROOTFS}0$n/var/cache/tazpkg -name '*.tazpkg' -delete
    1.46 +				# Clean /var/lib/tazpkg
    1.47 +				rm ${ROOTFS}0$n/var/lib/tazpkg/ID* ${ROOTFS}0$n/var/lib/tazpkg/descriptions.txt \
    1.48 +					${ROOTFS}0$n/var/lib/tazpkg/extra.list ${ROOTFS}0$n/var/lib/tazpkg/files*
    1.49 +				# Back to default mirror
    1.50 +				rm ${ROOTFS}0$n/home/slitaz/packages; rmdir ${ROOTFS}0$n/home/slitaz
    1.51 +				echo "$DEFAULT_MIRROR" > ${ROOTFS}0$n/var/lib/tazpkg/mirror
    1.52 +
    1.53  				cd $DISTRO
    1.54  				if [ -s $flavor.rootfs ]; then
    1.55  					echo -n "Adding $flavor rootfs extra files..."