# HG changeset patch # User Aleksej Bobylev # Date 1367690573 0 # Node ID 24dbe04170be6f08a5d4ccccdcd14cbac35e1bfe # Parent f3eb8e8e9d2e3feb36196114bf3f1dc7ac3f9295 Apply common stylesheet for docs; light reformatting of html code; add experimental (unfinished) '--cdeps' option to cook. diff -r f3eb8e8e9d2e -r 24dbe04170be cook --- a/cook Fri Apr 05 13:48:40 2013 +0200 +++ b/cook Sat May 04 18:02:53 2013 +0000 @@ -50,6 +50,7 @@ --getsrc|-gs Cook : $(_ "get the package source tarball.") --block|-b Cook : $(_ "block a package so cook will skip it.") --unblock|-ub Cook : $(_ "unblock a blocked package.") + --cdeps Cook : $(_ "check dependencies of cooked package.") --pack Cook : $(_ "repack an already built package.") --interactive|-x New : $(_ "create a receipt interactively.") --wok Setup: $(_ "clone the cooking wok from Hg repo.") @@ -948,6 +949,69 @@ fi } +# Search file in mirrored packages +search_file_mirror() +{ + busybox unlzma -c $DB/files.list.lzma | grep $1\$ | cut -d: -f1 | sort -u +} + +# Search file in local wok packages +search_file_local() +{ + # existing packages have precedence over the package/taz folder + srch=$1 + { for package in $(find $PKGS -name '*.tazpkg'); do + if [ ! "x$(busybox cpio --to-stdout --quiet -i files.list < $package | grep /$srch\$)" == "x" ]; then + busybox cpio -i receipt < $package | fgrep PACKAGE | cut -d\" -f2 + fi + done } | sort -u +} + +# Ask in multiple choice +ask_multiple() +{ + local multiples first my_choice + multiples="$1" + first=$(echo "$multiples" | head -n1) + newline; _ "Multiple choice:\n$multiples\n" + _ "Select one [$first]: "; read my_choice + [ "x$my_choice" == "x" ] && my_choice="$first" + found=$my_choice +} + +# Search file in local cache (fast), local wok packages, mirrored packages +search_file() +{ + local srch cache missing + srch=$1 + cache=/var/cache/ldsearch.cache + missing=/var/cache/missing.file + touch $cache $missing + found=$(grep $srch $cache | cut -d' ' -f2) + if [ "x$found" == "x" ]; then + found=$(search_file_local $srch) + if [ "x$found" != "x" ]; then + if [ $(echo "$found" | wc -l) -gt 1 ]; then + ask_multiple "$found" + fi + echo "$srch $found" >> $cache + else + found=$(search_file_mirror $srch) + if [ "x$found" != "x" ]; then + if [ $(echo "$found" | wc -l) -gt 1 ]; then + ask_multiple "$found" + fi + echo "$srch $found" >> $cache + else + echo "$srch" >> $missing + fi + fi + fi +} + + + + # # Commands # @@ -1377,6 +1441,30 @@ _ "Need to build \$pkg." && exit 0 fi exit 0 ;; + --cdeps) + [ ! -d $WOK/$pkg/taz ] && _ "Need to build \$pkg." && exit 0 + _ "Checking depends"; separator + lddlist=/tmp/lddlist; touch $lddlist + missing=/var/cache/missing.file + # find all deps using ldd + for exe in $(find $WOK/$pkg/taz -type f -perm +111); do + [ "x$(dd if=$exe bs=4 count=1 2>/dev/null)" == "xELF" ] && + ldd $exe | sed 's| ||' | cut -d' ' -f1 >> $lddlist + done + # remove exe/so duplicates + sort -u $lddlist > $lddlist.sorted + # search packages + for exefile in $(cat $lddlist.sorted); do + search_file $exefile + echo $found >> $lddlist.pkgs + echo -n "." + done + echo + # remove packages duplicates + sort -u $lddlist.pkgs > $lddlist.final + sort -u $missing > $missing.final + rm -f $lddlist $lddlist.sorted $lddlist.pkgs $missing + exit 0 ;; esac # Check if wanted is built now so we have separate log files. diff -r f3eb8e8e9d2e -r 24dbe04170be doc/cookutils.en.html --- a/doc/cookutils.en.html Fri Apr 05 13:48:40 2013 +0200 +++ b/doc/cookutils.en.html Sat May 04 18:02:53 2013 +0000 @@ -1,15 +1,16 @@ - + + Cookutils Documentation - - + + - - +
@@ -193,8 +194,7 @@ # cook pkgdb - -

The Cooker

+

The Cooker

The Cooker is a Build Bot, its first function is to check for commits in a wok, create an ordered cooklist and cook all modified packages. It can also be @@ -271,8 +271,7 @@ # cooker rev 9496 - -

Blocked packages

+

Blocked packages

Cook and the Cooker handle a file with a list of blocked package so they will not cook when commits happen or if a cooklist is used. This is very useful @@ -391,10 +390,9 @@

- + - diff -r f3eb8e8e9d2e -r 24dbe04170be doc/cookutils.pt.html --- a/doc/cookutils.pt.html Fri Apr 05 13:48:40 2013 +0200 +++ b/doc/cookutils.pt.html Sat May 04 18:02:53 2013 +0000 @@ -1,16 +1,16 @@ - - + + + Documentação do Cookutils - - + + - - +
@@ -205,8 +205,7 @@ # cook pkgdb - -

O comando 'cooker'

+

O comando 'cooker'

O cooker é um robô de compilação, que tem por função checar por commits em um wok, criar uma listagem da ordem de compilação (cooklist) e compilar @@ -287,8 +286,7 @@ # cooker rev 9496 - -

Pacotes bloqueados

+

Pacotes bloqueados

O 'cook' e o 'cooker' utilizam uma lista de pacotes bloqueados, nos quais são indicados quais pacotes não compilar quando acontece algum commit ou @@ -418,10 +416,9 @@

- + - diff -r f3eb8e8e9d2e -r 24dbe04170be doc/cookutils.ru.html --- a/doc/cookutils.ru.html Fri Apr 05 13:48:40 2013 +0200 +++ b/doc/cookutils.ru.html Sat May 04 18:02:53 2013 +0000 @@ -1,14 +1,16 @@ - - + + Документация CookUtils - + + - +
@@ -376,9 +378,9 @@
- + diff -r f3eb8e8e9d2e -r 24dbe04170be doc/style.css --- a/doc/style.css Fri Apr 05 13:48:40 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* CSS style for SliTaz Doc */ - -body { - font: 88% "DejaVu Sans", Ubuntu, "Droid Sans", "Liberation Sans", FreeSans, sans-serif; - margin: 0; -} -h1 { margin: 0; padding: 8px; color: #fff; font-size: 20px; } -h2 { color: #444; } h3 { color: #666; font-size: 140%; } -a:hover { text-decoration: none; } -pre { - background-color: #f8f8f8; - border: 1px solid #ddd; - padding: 10px; - border-radius: 4px; -} - -#header { - background: #351a0a; - height: 40px; - border-bottom: 8px solid #d66018; -} - -#content { - margin: 40px 80px; - text-align: justify; -} - -#footer { - text-align: center; - padding: 20px; - border-top: 1px solid #ddd; -}