# HG changeset patch # User Christopher Rogers # Date 1350399730 0 # Node ID ad9af7bfcc780d9f8d13e89eb94cf33e1da846b3 # Parent 48d59c7cd0b63a1abe3962ab42316fc13c02219d libcookorder.sh: Add comments to explain lots of functions. More to come. diff -r 48d59c7cd0b6 -r ad9af7bfcc78 cook --- a/cook Tue Oct 16 00:14:04 2012 +0000 +++ b/cook Tue Oct 16 15:02:10 2012 +0000 @@ -71,6 +71,7 @@ -e s'|\[0;39m \]||' $LOGS/$pkg.log } +# check if $value is empty if_empty_value() { if [ -z "$value" ]; then gettext "QA: empty variable:"; echo -e " ${var}=\"\"\n" diff -r 48d59c7cd0b6 -r ad9af7bfcc78 lib/libcookorder.sh --- a/lib/libcookorder.sh Tue Oct 16 00:14:04 2012 +0000 +++ b/lib/libcookorder.sh Tue Oct 16 15:02:10 2012 +0000 @@ -57,6 +57,7 @@ echo -e " $pkg\n" && exit 1 } +# rsync wok-hg with wok rsync_wok() { if [ -d "$WOKHG" ]; then echo "Updating build wok" @@ -97,6 +98,7 @@ done } +# gen_wan_db is to make the wanted.txt gen_wan_db() { local receipt @@ -113,6 +115,7 @@ fi } +# gen_dep_db is to make the depends.txt gen_dep_db() { local pkg receipt @@ -130,6 +133,8 @@ fi } +# gen_wok_db is to create the wok cooklist database +# This helps create the wanted.txt, depends.txt and fullco.txt gen_wok_db() { echo "Generating wok database" @@ -145,39 +150,46 @@ sort_db } +# look for $PACKAGE in $dep_db look_for_dep() { grep -m1 ^$PACKAGE$'\t' $dep_db | \ cut -f 2 } +# look for all $PACKAGE depends and build depends in $dep_db look_for_all() { grep -m1 ^$PACKAGE$'\t' $dep_db | \ cut -f 2,3 | sed 's/ / /' } +# same as look_for_all function look_for_bdep() { look_for_all } +# reverse depend look up look_for_rdep() { fgrep ' '$PACKAGE' ' $dep_db | cut -f 1 } +# reverse build depend look up look_for_rbdep() { fgrep ' '$PACKAGE' ' $dep_db | \ cut -f 1,3 | fgrep ' '$PACKAGE' ' | cut -f 1 } +# look for wanted $PACKAGE in wanted.txt look_for_wanted() { grep -m1 ^$PACKAGE$'\t' $wan_db | cut -f 2 } +# look for reverse wanted $PACKAGE in wanted.txt look_for_rwanted() { for rwanted in $(grep $'\t'$PACKAGE$ $wan_db | cut -f 1); do @@ -187,6 +199,7 @@ done } +# look for -dev $WANTED packages in wanted.txt look_for_dev() { WANTED=$(look_for_wanted) @@ -196,6 +209,7 @@ [ -f "$WOK/$PACKAGE-dev/receipt" ] && echo $PACKAGE-dev } +# make list with $PACKAGE and $PACKAGE-dev with_dev() { for PACKAGE in $(cat); do @@ -204,6 +218,7 @@ done } +# make list with $PACKAGE and all its wanted receipt with_wanted() { for PACKAGE in $(cat); do @@ -253,6 +268,7 @@ fi } +# add changed md5sum receipts to $commits set_commited() { grep -q ^$PACKAGE$ $commits || echo $PACKAGE >> $commits @@ -260,6 +276,7 @@ update_dep_db } +# gen md5 files for receipt and stuff files gen_cookmd5() { # md5sum of cooking stuff make tazwok able to check for changes @@ -448,12 +465,14 @@ unset wanted_list } +# update depends.txt file update_dep_db() { sed "/^$PACKAGE\t/d" -i $dep_db echo -e $PACKAGE"\t "$DEPENDS" \t "$BUILD_DEPENDS' ' >> $dep_db } +# create sorted fullco.txt file sort_db() { #echo "Generating full cookorder (fullco)" @@ -535,6 +554,7 @@ grep -m1 -A1 -sh ^$PACKAGE$ $1/packages.txt | tail -1 | sed 's/ *//' } +# remove previous package remove_previous_package() { if [ "$prev_VERSION" ] && [ "$VERSION$EXTRAVERSION" != "$prev_VERSION" ]; then @@ -543,6 +563,7 @@ return 0 } +# create cook list gen_cook_list() { #echo "Scanning wok" @@ -577,6 +598,7 @@ sort_cooklist } +# sort cooklist sort_cooklist() { if [ "$(sed 1!d $fullco)" = "#PlanSort" ]; then @@ -652,6 +674,7 @@ return 1 } +# check $INCOMING packages into $PKGS check_for_incoming() { echo "Checking that all packages were cooked OK" @@ -757,6 +780,7 @@ done } +# get package files for building libraries.txt, files.list.lzma, and packages.desc get_pkg_files() { pkg_files_dir=/tmp/cook/$(basename ${1%.tazpkg}) @@ -767,6 +791,7 @@ cpio --quiet -idm library.list < $1 2>/dev/null } +# check .so files check_so_files() { pwd=$(pwd)