[oe-commits] org.oe.angstrom-2007.12-stable angstrom contrib: add feed sorting script

koen commit openembedded-commits at lists.openembedded.org
Thu Jan 10 09:22:21 UTC 2008


angstrom contrib: add feed sorting script

Author: koen at openembedded.org
Branch: org.openembedded.angstrom-2007.12-stable
Revision: 9b3e17e604e26d2520ee89e9e049edf7b063a240
ViewMTN: http://monotone.openembedded.org/revision/info/9b3e17e604e26d2520ee89e9e049edf7b063a240
Files:
1
contrib/angstrom/sort.sh
mtn:execute
true
Diffs:

#
# mt diff -rb45d6188d2da1ecef4a5da29ec77f43f837936ca -r9b3e17e604e26d2520ee89e9e049edf7b063a240
#
# 
# 
# add_file "contrib/angstrom/sort.sh"
#  content [a3978706f372d41e00a924be5aa44b95b478fb4e]
# 
#   set "contrib/angstrom/sort.sh"
#  attr "mtn:execute"
# value "true"
# 
============================================================
--- contrib/angstrom/sort.sh	a3978706f372d41e00a924be5aa44b95b478fb4e
+++ contrib/angstrom/sort.sh	a3978706f372d41e00a924be5aa44b95b478fb4e
@@ -0,0 +1,133 @@
+#!/bin/bash
+
+# Angstrom feed sorting script
+
+
+rm Packages* >& /dev/null
+
+# Find ipkg files in unsorted/ and remove stale ones
+echo "Deleting morgue directories "
+find . -name morgue | xargs rm -rf 
+echo "Moving packages to the top level directory"
+find */ -name  "*.ipk" -exec mv  '{}'  ./ \;
+
+# Make a list of ipkg files already present in feeds and in unsorted
+echo "Making a list"
+for i in $(find ../ -name "*.ipk"| grep -v unsorted) ; do basename $i ; done > files-sorted
+for i in $(find . -name "*.ipk") ; do basename $i ; done > files-unsorted
+
+# Make a list of duplicates and delete those
+echo "Checking it twice"
+cat files-sorted files-unsorted | sort | uniq -d > files-duplicate
+cat files-duplicate | xargs rm -f
+
+do_sort() {
+archdir=$arch
+
+case "$arch" in
+	"arm-oabi")
+			machines="h3600 h3800 collie simpad htcwallaby" ;;
+	"armv4t")
+			machines="ep93xx h6300 fic-gta01 fic-gta02" ;;
+	"armv5te")
+			machines="davinci-dvevm gumstix-connex gumstix-verdex gumstix e680 a780 a1200 at91sam9263ek rokre6 rokre2 rokr-e2 akita c7x0 h2200 h3900 h4000 h5000 htcapache htctornado htcblueangel htcuniversal hx4700 nslu2le hx2000 ixp4xxle magician netbook-pro nokia770 qemuarm omap5912osk poodle spitz tosa" ;;
+	"armv5teb")
+			machines="ixp4xxbe nslu2be" ;;
+	"armv6")	
+			machines="mx31ads nokia800" ;;
+	"avr32")
+			machines="atngw100 at32stk1000" ;;
+	"bfin")
+			archdir="blackfin"
+			machines="adsp-bf537-stamp" ;;
+	"geode")
+			machines="alix" ;;
+	"i486")
+			machines="x86" ;;
+	"i586")
+			machines="epia qemux86" ;;
+	"i686")
+			machines="guinness progear" ;;
+	"iwmmxt")
+			machines="" ;;
+	"ppc405")	
+			machines="dht-walnut" ;;
+	"ppc603e")
+			machines="efika" ;;
+	"sparc")
+			machines="" ;;
+esac
+
+echo "Sorting $arch"
+for i in `find . -name  "*.ipk"| grep $arch` ; do mkdir -p ../$archdir/base/ || true ;mv $i ../$archdir/base/ ; done
+        for machine in $machines ; do
+                for i in `find . -name  "*_$machine.ipk"| grep $machine` ; do mkdir -p ../$archdir/machine/$machine || true ;mv $i ../$archdir/machine/$machine ; done
+	done
+(cd ../$archdir && do_index )
+
+}
+
+do_index() {
+ipkg_tools_path="/usr/local/bin"
+echo "Processing $(basename $PWD) packages...."
+
+BPWD=`pwd`
+
+cd base
+
+mkdir -p ../debug ../perl ../python ../gstreamer ../locales/en || true
+
+#split the feeds based on names
+mv python* ../python/ >& /dev/null
+mv perl* ../perl/ >& /dev/null
+mv *-dbg* ../debug/ >& /dev/null
+mv gst* ../gstreamer >& /dev/null
+
+for i in ../* ; do
+  if [ -d $i ]; then
+      cd $i
+      echo -n "building index for $i:" |sed s:\.\./::
+      ${ipkg_tools_path}/ipkg-make-index -p Packages -l Packages.filelist  -m -L ../locales  . >& /dev/null
+      echo " DONE"
+  fi
+done
+cd ${BPWD}/machine
+
+for i in ./* ; do
+  if [ -d $i ]; then
+     cd $i
+     echo -n "building index for machine $i:"
+     ${ipkg_tools_path}/ipkg-make-index -p Packages -l Packages.filelist  -m  . >& /dev/null
+     echo " DONE"
+     cd ../
+  fi
+done
+
+cd ${BPWD}/locales/en/
+echo -n "building index for locales:"
+for i in ../* ; do
+  if [ -d $i ]; then
+   echo -n " $i" |sed s:\.\./::
+   ${ipkg_tools_path}/ipkg-make-index -p Packages -l Packages.filelist  -m . >& /dev/null;
+   cd $i
+  fi
+ done
+echo " DONE"
+cd ${BPWD}
+
+echo -n "Stripping source lines from Package files"
+for i in `find . -name Packages` ; do grep -v ^Source: $i|gzip -c9>$i.gz ;gunzip -c $i.gz>$i ; done
+echo " DONE"
+}
+
+for i in `find . -name  "*.ipk"| grep _all` ; do mkdir -p ../all/ || true ;mv $i ../all/ ; done
+ (cd ../all && ipkg-make-index -p Packages -m . >& /dev/null)
+
+for arch in arm-oabi armv4t armv5teb armv5te armv6 avr32 bfin geode i486 i586 i686 iwmmxt ppc405 ppc603e sparc ; do 
+	do_sort
+done
+
+
+
+
+






More information about the Openembedded-commits mailing list