2006-07-16 12:29:37 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
set -e
|
|
|
|
|
2006-08-24 22:38:22 +02:00
|
|
|
#-----------------------#
|
|
|
|
get_pkg_ver() { # Find package version for a given package ID
|
|
|
|
#-----------------------#
|
|
|
|
local pkg_id=$1
|
|
|
|
|
|
|
|
case ${pkg_id} in
|
|
|
|
# ALSA packages version
|
|
|
|
alsa* ) pkg_id=alsa ;;
|
|
|
|
|
|
|
|
# KDE packages version
|
|
|
|
kdevelop ) : ;;
|
|
|
|
kde*config ) : ;;
|
|
|
|
kde* ) pkg_id=kde ;;
|
|
|
|
|
|
|
|
# Xorg7 packages version
|
|
|
|
xorg7-server ) pkg_id=xorg-server ;;
|
|
|
|
xterm2 ) pkg_id=xterm ;;
|
|
|
|
xorg7* ) pkg_id=xorg7 ;;
|
|
|
|
|
|
|
|
# Others (ID value don't match entity name)
|
|
|
|
wireless_tools ) pkg_id=wireless-tools ;;
|
|
|
|
bind-utils ) pkg_id=bind ;;
|
|
|
|
html-tidy ) pkg_id=tidy ;;
|
|
|
|
jdk ) pkg_id=jdk-src ;;
|
|
|
|
reiserfs ) pkg_id=reiser ;;
|
|
|
|
xfs ) pkg_id=xfsprogs ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
xmllint --noent ./${BLFS_XML}/book/bookinfo.xml 2>/dev/null | \
|
|
|
|
grep -i " ${pkg_id}-version " | cut -d "\"" -f2
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#-----------------------#
|
|
|
|
get_installed_ver() { # Find installed package version for a given package ID
|
|
|
|
#-----------------------#
|
|
|
|
local pkg_id=$1
|
|
|
|
|
2007-08-11 00:47:19 +02:00
|
|
|
|
|
|
|
case ${pkg_id} in
|
|
|
|
html-tidy )
|
|
|
|
find $TRACKING_DIR -name "${pkg_id}-cvs_[[:digit:]]*" | sed "s/.*${pkg_id}-//"
|
|
|
|
;;
|
|
|
|
cdparanoia )
|
|
|
|
find $TRACKING_DIR -name "${pkg_id}-III-[[:digit:]]*" | sed "s/.*${pkg_id}-//"
|
|
|
|
;;
|
2007-08-11 13:24:47 +02:00
|
|
|
ffmpeg )
|
|
|
|
find $TRACKING_DIR -name "${pkg_id}-svn_[[:digit:]]*" | sed "s/.*${pkg_id}-//"
|
|
|
|
;;
|
2007-08-11 00:47:19 +02:00
|
|
|
psutils )
|
|
|
|
find $TRACKING_DIR -name "${pkg_id}-p[[:digit:]]*" | sed "s/.*${pkg_id}-//"
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
find $TRACKING_DIR -name "${pkg_id}-[[:digit:]]*" | sed "s/.*${pkg_id}-//"
|
|
|
|
;;
|
|
|
|
esac
|
2006-08-24 22:38:22 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2006-07-16 12:29:37 +02:00
|
|
|
#-----------------------#
|
|
|
|
generate_packages() { # Master packages file
|
|
|
|
#-----------------------#
|
2006-08-24 22:38:22 +02:00
|
|
|
local pkg_id file pkg_ver
|
|
|
|
local ALSA_VER GNOME_VER GNOME_MINOR_VER KDE_VER KDE_KOFFICE_VER XORG7_VER
|
2006-07-16 12:29:37 +02:00
|
|
|
|
|
|
|
> packages.tmp
|
|
|
|
|
|
|
|
# Extract Id and path for sect1 files
|
|
|
|
for file in `find $BLFS_XML -name "*.xml"` ; do
|
2006-08-24 22:38:22 +02:00
|
|
|
pkg_id=$(grep "sect1 id" $file | sed -e 's/<sect1 id="//;s/".*//')
|
|
|
|
pkg_ver=$(get_pkg_ver $pkg_id)
|
|
|
|
installed_ver=$(get_installed_ver $pkg_id)
|
|
|
|
[[ ! -z "$pkg_id" ]] && echo -e "$pkg_id\t$file\t$pkg_ver\t$installed_ver" >> packages.tmp
|
2006-07-16 12:29:37 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
# IDs clean-up (unuseful pages or commented-out packages, could be more)
|
2007-07-25 23:32:33 +02:00
|
|
|
sed -i '/template/d;/ntroduction/d;/preface/d;/alsa.xml/d;/xorg.xml/d' packages.tmp
|
2007-08-11 00:47:19 +02:00
|
|
|
sed -i '/obsolete/d;/ispell\t/d;/postlfs-/d;/-client.xml/d;/xorg7.xml/d' packages.tmp
|
2007-04-13 19:58:45 +02:00
|
|
|
sed -i '/courier.xml/d;/-other\t/d;/others-/d;/other-/d;/^ash\t/d' packages.tmp
|
2006-08-24 22:38:22 +02:00
|
|
|
sed -i '/fw-firewall\t/d;/gcc2\t/d;/cvsserver\t/d;/svnserver\t/d' packages.tmp
|
|
|
|
sed -i '/fam\t/d;/libungif\t/d;/ncpfs\t/d;/slrn\t/d;/konq\t/d' packages.tmp
|
2007-08-11 00:47:19 +02:00
|
|
|
sed -i '/gst-plugins\t/d;/gimp-print\t/d;/openquicktime\t/d;/compressdoc\t/d' packages.tmp
|
2007-02-11 11:33:46 +01:00
|
|
|
sed -i '/errata\t/d;/foreword\t/d;/organization\t/d;/whoread\t/d' packages.tmp
|
2006-08-24 22:38:22 +02:00
|
|
|
|
|
|
|
# Meta-packages version
|
|
|
|
ALSA_VER=$(get_pkg_ver alsa)
|
|
|
|
GNOME_VER=$(get_pkg_ver gnome)
|
|
|
|
GNOME_MINOR_VER=$(get_pkg_ver gnome-minor)
|
|
|
|
KDE_VER=$(get_pkg_ver kde)
|
|
|
|
KDE_INST_VER=$(get_installed_ver kde)
|
|
|
|
KDE_KOFFICE_VER=$(get_pkg_ver koffice)
|
|
|
|
XORG7_VER=$(get_pkg_ver xorg7)
|
|
|
|
|
|
|
|
# Meta-packages installed version
|
|
|
|
ALSA_INST_VER=$(get_installed_ver alsa)
|
|
|
|
GNOME_CORE_INST_VER=$(get_installed_ver gnome-core)
|
|
|
|
GNOME_FULL_INST_VER=$(get_installed_ver gnome-full)
|
|
|
|
KDE_CORE_INST_VER=$(get_installed_ver kde-core)
|
|
|
|
KDE_FULL_INST_VER=$(get_installed_ver kde-full)
|
|
|
|
KDE_KOFFICE_INST_VER=$(get_installed_ver kde-koffice)
|
|
|
|
XORG7_INST_VER=$(get_installed_ver xorg7)
|
2006-07-16 12:29:37 +02:00
|
|
|
|
|
|
|
# Add header with meta-packages pseudo Id
|
|
|
|
{
|
|
|
|
cat << EOF
|
2006-08-24 22:38:22 +02:00
|
|
|
alsa $BLFS_XML $ALSA_VER $ALSA_INST_VER
|
|
|
|
gnome-core $BLFS_XML $GNOME_VER$GNOME_MINOR_VER $GNOME_CORE_INST_VER
|
|
|
|
gnome-full $BLFS_XML $GNOME_VER$GNOME_MINOR_VER $GNOME_FULL_INST_VER
|
|
|
|
kde-core $BLFS_XML $KDE_VER $KDE_CORE_INST_VER
|
|
|
|
kde-full $BLFS_XML $KDE_VER $KDE_FULL_INST_VER
|
|
|
|
kde-koffice $BLFS_XML $KDE_KOFFICE_VER $KDE_KOFFICE_INST_VER
|
|
|
|
xorg7 $BLFS_XML $XORG7_VER $XORG7_INST_VER
|
2006-07-16 12:29:37 +02:00
|
|
|
EOF
|
2006-08-24 22:38:22 +02:00
|
|
|
} >> packages.tmp
|
2006-07-16 12:29:37 +02:00
|
|
|
|
|
|
|
# Dump packages list
|
2006-08-24 22:38:22 +02:00
|
|
|
sort packages.tmp -b --key=2 --field-separator=/ --output=packages
|
2006-07-16 12:29:37 +02:00
|
|
|
|
|
|
|
# Clean up
|
|
|
|
rm packages.tmp
|
|
|
|
}
|
|
|
|
|
|
|
|
# Pre-made *.dep files for meta-packages
|
|
|
|
|
|
|
|
#--------------------------#
|
|
|
|
generate_gnome_core() { # GNOME core
|
|
|
|
#--------------------------#
|
|
|
|
local line base_xml package
|
|
|
|
|
|
|
|
> gnome-core.dep.tmp
|
|
|
|
|
|
|
|
for line in `grep "xi:include" $BLFS_XML/gnome/core/core.xml` ; do
|
|
|
|
base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
|
|
|
package=`grep "gnome/core/$base_xml" packages | cut -f1`
|
|
|
|
[[ -n "$package" ]] && echo $package >> gnome-core.dep.tmp
|
|
|
|
done
|
|
|
|
|
2006-08-24 22:38:22 +02:00
|
|
|
# Replace dummy packages with the proper ones
|
|
|
|
sed -i 's/GNOME-//g' gnome-core.dep.tmp
|
|
|
|
|
2006-07-16 12:29:37 +02:00
|
|
|
tac gnome-core.dep.tmp > libs/gnome-core.dep
|
|
|
|
rm gnome-core.dep.tmp
|
|
|
|
}
|
|
|
|
|
|
|
|
#--------------------------#
|
|
|
|
generate_gnome_full() { # GNOME full
|
|
|
|
#--------------------------#
|
|
|
|
local line base_xml package
|
|
|
|
|
|
|
|
echo "gnome-core" > gnome-full.dep.tmp
|
|
|
|
|
|
|
|
for line in `grep "xi:include" $BLFS_XML/gnome/add/add.xml` ; do
|
|
|
|
base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
|
|
|
package=`grep "gnome/add/$base_xml" packages | cut -f1`
|
|
|
|
[[ -n "$package" ]] && echo $package >> gnome-full.dep.tmp
|
|
|
|
done
|
|
|
|
|
|
|
|
tac gnome-full.dep.tmp > libs/gnome-full.dep
|
|
|
|
rm gnome-full.dep.tmp
|
|
|
|
}
|
|
|
|
|
|
|
|
#--------------------------#
|
|
|
|
generate_kde_core() { # KDE core
|
|
|
|
#--------------------------#
|
|
|
|
local line base_xml package
|
|
|
|
|
|
|
|
> kde-core.dep.tmp
|
|
|
|
|
|
|
|
for line in `grep "xi:include" $BLFS_XML/kde/core/core.xml` ; do
|
|
|
|
base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
|
|
|
package=`grep "kde/core/$base_xml" packages | cut -f1`
|
|
|
|
[[ -n "$package" ]] && echo $package >> kde-core.dep.tmp
|
|
|
|
done
|
|
|
|
|
|
|
|
tac kde-core.dep.tmp > libs/kde-core.dep
|
|
|
|
rm kde-core.dep.tmp
|
|
|
|
}
|
|
|
|
|
|
|
|
#--------------------------#
|
|
|
|
generate_kde_full() { # KDE full
|
|
|
|
#--------------------------#
|
|
|
|
local line base_xml package
|
|
|
|
|
|
|
|
echo "kde-core" > kde-full.dep.tmp
|
|
|
|
|
|
|
|
for line in `grep "xi:include" $BLFS_XML/kde/add/add.xml` ; do
|
|
|
|
base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
|
|
|
package=`grep "kde/add/$base_xml" packages | cut -f1`
|
|
|
|
[[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
|
|
|
|
done
|
|
|
|
|
|
|
|
for line in `grep "xi:include" $BLFS_XML/kde/devel/devel.xml` ; do
|
|
|
|
base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
|
|
|
|
package=`grep "kde/devel/$base_xml" packages | cut -f1`
|
|
|
|
[[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
|
|
|
|
done
|
|
|
|
|
|
|
|
tac kde-full.dep.tmp > libs/kde-full.dep
|
|
|
|
rm kde-full.dep.tmp
|
|
|
|
}
|
2006-08-24 22:38:22 +02:00
|
|
|
|
|
|
|
#--------------------------#
|
|
|
|
generate_kde_koffice() { # KDE full + Koffice
|
|
|
|
#--------------------------#
|
|
|
|
echo -e "koffice\nkde-full\nkde-core" > libs/kde-koffice.dep
|
|
|
|
}
|
|
|
|
|
|
|
|
#--------------------------#
|
|
|
|
generate_alsa() { # ALSA packages
|
|
|
|
#--------------------------#
|
|
|
|
echo -e "alsa-oss\nalsa-firmware\nalsa-tools\nalsa-utils\n\
|
|
|
|
alsa-plugins\nalsa-lib" > libs/alsa.dep
|
|
|
|
}
|
|
|
|
|
|
|
|
#--------------------------#
|
|
|
|
generate_xorg7() { # Xorg7 packages
|
|
|
|
#--------------------------#
|
|
|
|
echo -e "x-config\nx-setup\nrman\nxterm2\nxorg7-driver\nxorg7-server\nluit\n\
|
2007-07-25 23:32:33 +02:00
|
|
|
xkeyboard-config\nxorg7-font\nxorg7-data\nxorg7-app\nmesalib\nlibdrm\nxbitmaps\n\
|
|
|
|
xorg7-lib\nlibxcb\nxcb-proto\nlibXdmcp\nlibXau\nxorg7-util\nxorg7-proto" > libs/xorg7.dep
|
2006-08-24 22:38:22 +02:00
|
|
|
}
|