Let gen-makefile.sh to get package version from packages database.

This commit is contained in:
Manuel Canales Esparcia 2006-08-19 14:45:07 +00:00
parent 7b08c36afb
commit 5743d54b57

View file

@ -50,10 +50,18 @@ __wrt_touch() { #
#----------------------------------#
local pkg_name=$1
local pkg_ver=$2
if [[ -n "$pkg_ver" ]] ; then
(
cat << EOF
@touch \$(TRACKING_DIR)/${pkg_name#*-?-}-${pkg_ver}
EOF
) >> $MKFILE.tmp
fi
(
cat << EOF
@touch \$@ && \\
touch \$(TRACKING_DIR)/${pkg_name#*-?-}-${pkg_ver} && \\
sleep .25 && \\
echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
@ -67,7 +75,7 @@ __write_entry() { #
#----------------------------#
local script_name=$1
local pkg_ver=$2
echo -n "${tab_}${tab_} entry for <$script_name>"
#--------------------------------------------------------------------#
@ -103,12 +111,10 @@ generate_Makefile () { #
for package_script in scripts/* ; do
this_script=`basename $package_script`
script_ver=$(xmllint --noent ../blfs-xml/book/bookinfo.xml 2>/dev/null | \
grep -i " ${this_script#*-?-}-version " | \
cut -d "\"" -f2 )
pkg_ver=$(grep "^${this_script#*-?-}[[:space:]]" ../packages | cut -f3)
if [ ! -e $TRACKING_DIR/${this_script#*-?-}-$script_ver ]; then
pkg_list="$pkg_list ${this_script}"
__write_entry "${this_script}" "${script_ver}"
__write_entry "${this_script}" "${pkg_ver}"
PREV_PACKAGE=${this_script}
fi
done