cookutils rev 550 slitaz-tank
libcookorder.sh: Add more comments for explaining functions.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Tue Oct 16 15:32:05 2012 +0000 (2012-10-16) |
parents | ad9af7bfcc78 |
children | c2a20cfc1197 |
files | lib/libcookorder.sh |
line diff
1.1 --- a/lib/libcookorder.sh Tue Oct 16 15:02:10 2012 +0000 1.2 +++ b/lib/libcookorder.sh Tue Oct 16 15:32:05 2012 +0000 1.3 @@ -446,6 +446,7 @@ 1.4 fi 1.5 } 1.6 1.7 +# update wanted.txt database 1.8 update_wan_db() 1.9 { 1.10 local PACKAGE=$PACKAGE 1.11 @@ -517,6 +518,8 @@ 1.12 tac $tmp/fullco >> $fullco 1.13 } 1.14 1.15 +# check for missing $PACKAGE in wok 1.16 +# used in scan function only 1.17 check_for_missing() 1.18 { 1.19 local PACKAGE=$PACKAGE 1.20 @@ -537,6 +540,8 @@ 1.21 done 1.22 } 1.23 1.24 +# look to see if package is missing in 1.25 +# $INCOMING/packages.txt and $PKGS/packages.txt 1.26 look_for_missing_pkg() 1.27 { 1.28 for pkg in $(cat $1); do 1.29 @@ -847,6 +852,7 @@ 1.30 fi 1.31 } 1.32 1.33 +# check recook reverse depends 1.34 check_recook_rdeps() 1.35 { 1.36 # Recook of reverse-depends if package was broken. 1.37 @@ -865,6 +871,7 @@ 1.38 sed "/^$PACKAGE$/d" -i $cooklist 1.39 } 1.40 1.41 +# remove source folder 1.42 remove_src() 1.43 { 1.44 [ "$WANTED" ] && return 1.45 @@ -884,6 +891,7 @@ 1.46 [ -d $WOK/$PACKAGE/source ] && rm -rf $WOK/$PACKAGE/source 1.47 } 1.48 1.49 +# check for varable modification 1.50 check_for_var_modification() 1.51 { 1.52 for var in $@; do 1.53 @@ -897,6 +905,7 @@ 1.54 echo -n "" 1.55 } 1.56 1.57 +# clean $WOK/$PACKAGE folder 1.58 clean() 1.59 { 1.60 cd $WOK/$PACKAGE 1.61 @@ -920,6 +929,7 @@ 1.62 done 1.63 } 1.64 1.65 +# put $PACKAGE in $broken file if not already there 1.66 set_pkg_broken() 1.67 { 1.68 grep -q ^$PACKAGE$ $broken || echo $PACKAGE >> $broken 1.69 @@ -943,6 +953,7 @@ 1.70 cook_code=1 1.71 } 1.72 1.73 +# start package database 1.74 packages_db_start() 1.75 { 1.76 if [ ! -s packages.txt ]; then 1.77 @@ -966,6 +977,7 @@ 1.78 fi 1.79 } 1.80 1.81 +# erase previous package info 1.82 erase_package_info() 1.83 { 1.84 cd $pkg_repository 1.85 @@ -982,6 +994,7 @@ 1.86 $erase_package_info_extracmd 1.87 } 1.88 1.89 +# make the end of the package database 1.90 packages_db_end() 1.91 { 1.92 cd $pkg_repository 1.93 @@ -1005,6 +1018,7 @@ 1.94 [ -f packages.equiv ] || touch packages.equiv 1.95 } 1.96 1.97 +# get packages info 1.98 get_packages_info() 1.99 { 1.100 # If there's no taz folder in the wok, extract info from the 1.101 @@ -1061,6 +1075,7 @@ 1.102 $get_packages_info_extracmd 1.103 } 1.104 1.105 +# gen packages database 1.106 gen_packages_db() 1.107 { 1.108 [ "$pkg_repository" ] || pkg_repository=$PKGS 1.109 @@ -1091,6 +1106,7 @@ 1.110 packages_db_end 1.111 } 1.112 1.113 +# update package database 1.114 update_packages_db() 1.115 { 1.116 [ "$pkg_repository" ] || pkg_repository=$PKGS 1.117 @@ -1161,6 +1177,8 @@ 1.118 packages_db_end 1.119 } 1.120 1.121 +# make package database 1.122 +# $1 = incoming/packages or the folder of the package repo 1.123 pkgdb() 1.124 { 1.125 case "$1" in 1.126 @@ -1212,6 +1230,7 @@ 1.127 echo "" && rm -f $command 1.128 } 1.129 1.130 +# clean chroot 1.131 clean_chroot() 1.132 { 1.133 # Remove packages which was not in the chroot at creation time. 1.134 @@ -1237,6 +1256,7 @@ 1.135 fi 1.136 } 1.137 1.138 +# update library database file 1.139 update_lib_db() 1.140 { 1.141 # Update lib_db 1.142 @@ -1272,6 +1292,7 @@ 1.143 fi 1.144 } 1.145 1.146 +# get $PACKAGE wanted and depends info into wanted.txt and depends.txt files 1.147 get_packages_info_main() 1.148 { 1.149 erase_package_info_main 1.150 @@ -1279,6 +1300,7 @@ 1.151 echo -e "$PACKAGE\t "$DEPENDS" \t "$BUILD_DEPENDS" " >> depends.txt 1.152 } 1.153 1.154 +# erase $PACKAGE line in wanted.txt and depends.txt 1.155 erase_package_info_main() 1.156 { 1.157 for i in wanted.txt depends.txt; do