Ticket #19295: orphan-haiku

File orphan-haiku, 733 bytes (added by Bebert, 32 hours ago)

Script ( I am a very bad programmer )

Line 
1#! /bin/sh
2cd /tmpfs
3rm Provides.txt 2>/dev/null
4rm Requires.txt 2>/dev/null
5touch Provides.txt
6touch Requires.txt
7for i in $(ls /boot/system/packages/*.hpkg) ; do package list $i | tr ‘[A-Z]’ ‘[a-z]’ > tmp.txt ; cat tmp.txt | awk '/provides:/ { gsub("lib:",""); gsub("cmd:",""); toto = toto " "$2 ; } END {print toto;}' >> Provides.txt ; cat tmp.txt | awk '/requires:/ { gsub("lib:",""); gsub("cmd:",""); gsub("="," "); gsub("<"," "); gsub(">"," "); toto = toto "\n"$2 ; } END {print toto;}' >> Requires.txt ; done
8rm tmp.txt
9for i in $( cat Requires.txt |sort |uniq ) ; do grep -v $i Provides.txt > Provides2.txt; mv Provides2.txt Provides.txt ; done
10cat Provides.txt | awk '{print $1;}'
11rm Provides.txt
12rm Requires.txt