wok rev 14203

linux-libre: fix check_modules.sh
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Mar 14 10:38:19 2013 +0100 (2013-03-14)
parents 2b1b306b8dde
children b586d42f05bb
files linux-libre/stuff/check_modules.sh
line diff
     1.1 --- a/linux-libre/stuff/check_modules.sh	Thu Mar 14 05:13:26 2013 +0000
     1.2 +++ b/linux-libre/stuff/check_modules.sh	Thu Mar 14 10:38:19 2013 +0100
     1.3 @@ -9,46 +9,47 @@
     1.4  #WOK=$LOCAL_REPOSITORY/wok
     1.5  WOK=$(cd `dirname $0` && pwd | sed 's/wok.*/wok/')
     1.6  VERSION=`grep  ^VERSION= $WOK/linux-libre/receipt | cut -d "=" -f2 | sed -e 's/"//g'`
     1.7 -src="$WOK/linux-libre/linux-$VERSION"
     1.8 +src="$WOK/linux-libre/source/linux-$VERSION"
     1.9  
    1.10  cd $src
    1.11 -mkdir -p $WOK/$PACKAGE/tmp
    1.12 -rm -f $WOK/$PACKAGE/tmp/*
    1.13 +tmp=$WOK/${PACKAGE:-linux-libre}/tmp
    1.14 +mkdir -p $tmp 2>/dev/null
    1.15 +rm -f $tmp/*
    1.16  
    1.17  echo -e "\nChecking for modules selected in .config but not in linux-libre-* pkgs"
    1.18  echo "======================================================================"
    1.19  
    1.20  # create a packaged modules list
    1.21 -cat ../stuff/modules-"$VERSION".list >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list 
    1.22 +cat $WOK/linux-libre/stuff/modules-"$VERSION".list >> $tmp/pkgs-modules-"$VERSION".list 
    1.23  
    1.24 -for i in $(cd $WOK; ls -d linux-libre-*)
    1.25 +for i in $(cd $WOK; grep -l '^WANTED="linux-libre"' */receipt | sed 's|/receipt||g')
    1.26  do
    1.27 -	tazpath="taz/$i-$VERSION"
    1.28 -		for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko.gz")
    1.29 +	tazpath="taz/$i-*"
    1.30 +		for j in $(cat $WOK/$i/$tazpath/files.list | grep ".ko..z")
    1.31  		do
    1.32 -			basename $j >> $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list	
    1.33 +			basename $j >> $tmp/pkgs-modules-"$VERSION".list	
    1.34  		done
    1.35  done
    1.36  # get the original list in .config
    1.37 -for i in $(find $_pkg -iname "*.ko.gz")
    1.38 +for i in $(find $_pkg -iname "*.ko.?z")
    1.39  do
    1.40 -	basename $i >> $WOK/$PACKAGE/tmp/originial-"$VERSION".list
    1.41 -done
    1.42 +	basename $i
    1.43 +done > $tmp/original-"$VERSION".list
    1.44  # compare original .config and pkged modules
    1.45 -for i in $(cat $WOK/$PACKAGE/tmp/originial-$VERSION.list)
    1.46 +for i in $(cat $tmp/original-$VERSION.list)
    1.47  do
    1.48 -	if ! grep -qs "$i" $WOK/$PACKAGE/tmp/pkgs-modules-"$VERSION".list ; then
    1.49 +	if ! grep -qs "$i" $tmp/pkgs-modules-"$VERSION".list ; then
    1.50  		modpath=`find $_pkg -iname "$i"`
    1.51  		echo "Orphan module: $i"
    1.52 -		echo "$i : $modpath" >> $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list
    1.53 +		echo "$i : $modpath" >> $tmp/unpackaged-modules-"$VERSION".list
    1.54  	fi
    1.55  done
    1.56 -if [ -f $WOK/$PACKAGE/tmp/unpackaged-modules-"$VERSION".list ]; then
    1.57 +if [ -f $tmp/unpackaged-modules-"$VERSION".list ]; then
    1.58  	echo "======================================================================"
    1.59  	echo -e "Check linux-libre/tmp/unpackaged-modules-$VERSION.list for mod path\n"
    1.60  else
    1.61  	echo -e "\nAll modules are packaged\n"
    1.62  	echo "======================================================================"
    1.63  	echo ""
    1.64 -	rm -rf $WOK/$PACKAGE/tmp
    1.65 +	rm -rf $tmp
    1.66  fi