slitaz-modular rev 64

Updated slitaz-modular script to make subfolders for differnet flavors packages lists. This way you can get a iso to load one of the more basic flavors.
author Christopher Rogers <slaxemulator@gmail.com>
date Tue Apr 12 20:20:45 2011 +0000 (2011-04-12)
parents af121a5932c3
children fc092cbb5617
files initramfs/usr/bin/slitaz-modular
line diff
     1.1 --- a/initramfs/usr/bin/slitaz-modular	Tue Apr 12 17:59:26 2011 +0000
     1.2 +++ b/initramfs/usr/bin/slitaz-modular	Tue Apr 12 20:20:45 2011 +0000
     1.3 @@ -50,10 +50,7 @@
     1.4  info () { echo -e "\033[1;32;40m>>> \033[1;37;40m$@\033[1;0m"; }
     1.5  
     1.6  
     1.7 -if [ ! -f "$PROFILE/packages.list" ]; then
     1.8 -	echo "$PROFILE/packages.list doesn't exist."
     1.9 -	exit 1	
    1.10 -elif [ ! -f "$PROFILE/config" ]; then
    1.11 +if [ ! -f "$PROFILE/config" ]; then
    1.12  	echo "$PROFILE/config doesn't exist."
    1.13  	exit 1	
    1.14  fi
    1.15 @@ -192,6 +189,7 @@
    1.16  				cp -a $PKGNAME/$i $PKGNAME/fs/$INSTALLED/$PACKAGE/$i
    1.17  			fi
    1.18  		done
    1.19 +		[ -d $CUR_DIR ] || mkdir $CUR_DIR
    1.20  		md5sum $PKGNAME.tazpkg > $PKGNAME/fs/$INSTALLED/$PACKAGE/pkgmd5
    1.21  		create_module $PKGNAME/fs $CUR_DIR/$PKGNAME.$EXT /var/lib/tazpkg/installed
    1.22  	fi
    1.23 @@ -243,6 +241,46 @@
    1.24  	fi
    1.25  }
    1.26  
    1.27 +pkg_flavors_modules()
    1.28 +{
    1.29 +	local i
    1.30 +	for i in $(cat $PROFILE/list/${flavors}.list); do
    1.31 +		look_for_dep $i > /tmp/deps
    1.32 +		if [ "$(cat /tmp/deps)" != "" ]; then
    1.33 +			cat /tmp/deps | while read d; do
    1.34 +				if [ ! $(grep "^$d$" $ISODIR/packages-order.txt) ]; then
    1.35 +					[ -d $MODULES_DIR/$d ] || mkdir -p $MODULES_DIR/$d
    1.36 +					[ -f $MODULES_DIR/$d/receipt ] && continue
    1.37 +					if [ "$CLEAN_MODULES_DIR" = "yes" ]; then
    1.38 +						if [ -d $MODULES_DIR/$d ]; then
    1.39 +							rm -Rf $MODULES_DIR/$d
    1.40 +						fi
    1.41 +					fi
    1.42 +					info "Make module of depend package $i"
    1.43 +					echo "$d" >> $ISODIR/packages-order.txt
    1.44 +					cd $MODULES_DIR/$d
    1.45 +					mktaz2xz $d $ISODIR/$CDNAME/base/$flavors
    1.46 +					cd $PROFILE
    1.47 +				fi
    1.48 +			done
    1.49 +		fi
    1.50 +		if [ ! $(grep "^$i$" $ISODIR/packages-order.txt) ]; then
    1.51 +			[ -d $MODULES_DIR/$i ] || mkdir -p $MODULES_DIR/$i
    1.52 +			[ -f $MODULES_DIR/$i/receipt ] && continue
    1.53 +			if [ "$CLEAN_MODULES_DIR" = "yes" ]; then
    1.54 +				if [ -d $MODULES_DIR/$i ]; then
    1.55 +					rm -Rf $MODULES_DIR/$i
    1.56 +				fi
    1.57 +			fi
    1.58 +			echo "$i" >> $ISODIR/packages-order.txt
    1.59 +			info "Make module of main package $i"
    1.60 +			cd $MODULES_DIR/$i
    1.61 +			mktaz2xz $i $ISODIR/$CDNAME/base/$flavors
    1.62 +			cd $PROFILE
    1.63 +		fi
    1.64 +	done
    1.65 +}
    1.66 +
    1.67  build_modules()
    1.68  {
    1.69  	mkdir -p $WORKING
    1.70 @@ -271,45 +309,16 @@
    1.71  	fi
    1.72  	
    1.73  	if [ ! -d $SLITAZ_DIR/repos/wok ]; then
    1.74 -		hg clone $HG_URL/wok $SLITAZ/repos/wok
    1.75 +		hg clone $HG_URL/wok $SLITAZ_DIR/repos/wok
    1.76  	fi
    1.77  	
    1.78  	[ -d $INCOMING_REPOSITORY ] || mkdir -p $INCOMING_REPOSITORY
    1.79  	tazwok gen-wok-db --WOK=$SLITAZ_DIR/repos/wok
    1.80  
    1.81 -	for i in $(cat $PROFILE/packages.list); do
    1.82 -		look_for_dep $i > /tmp/deps
    1.83 -		if [ "$(cat /tmp/deps)" != "" ]; then
    1.84 -			cat /tmp/deps | while read d; do
    1.85 -				if [ ! $(grep "^$d$" $ISODIR/packages-order.txt) ]; then
    1.86 -					[ -d $MODULES_DIR/$d ] || mkdir -p $MODULES_DIR/$d
    1.87 -					[ -f $MODULES_DIR/$d/receipt ] && continue
    1.88 -					if [ "$CLEAN_MODULES_DIR" = "yes" ]; then
    1.89 -						if [ -d $MODULES_DIR/$d ]; then
    1.90 -							rm -Rf $MODULES_DIR/$d
    1.91 -						fi
    1.92 -					fi
    1.93 -					info "Make module of depend package $i"
    1.94 -					echo "$d" >> $ISODIR/packages-order.txt
    1.95 -					cd $MODULES_DIR/$d
    1.96 -					mktaz2xz $d $ISODIR/$CDNAME/base
    1.97 -					cd $PROFILE
    1.98 -				fi
    1.99 -			done
   1.100 -		fi
   1.101 -		if [ ! $(grep "^$i$" $ISODIR/packages-order.txt) ]; then
   1.102 -			[ -d $MODULES_DIR/$i ] || mkdir -p $MODULES_DIR/$i
   1.103 -			[ -f $MODULES_DIR/$i/receipt ] && continue
   1.104 -			if [ "$CLEAN_MODULES_DIR" = "yes" ]; then
   1.105 -				if [ -d $MODULES_DIR/$i ]; then
   1.106 -					rm -Rf $MODULES_DIR/$i
   1.107 -				fi
   1.108 -			fi
   1.109 -			echo "$i" >> $ISODIR/packages-order.txt
   1.110 -			info "Make module of main package $i"
   1.111 -			cd $MODULES_DIR/$i
   1.112 -			mktaz2xz $i $ISODIR/$CDNAME/base
   1.113 -			cd $PROFILE
   1.114 +	local i
   1.115 +	for flavors in $FLAVORS_LIST; do
   1.116 +		if [ -f "$PROFILE/list/${flavors}.list" ]; then
   1.117 +			pkg_flavors_modules
   1.118  		fi
   1.119  	done
   1.120