Added installed version to packages database
This commit is contained in:
parent
c0077b11a7
commit
cac94f6008
3 changed files with 30 additions and 10 deletions
|
@ -37,6 +37,15 @@ get_pkg_ver() { # Find package version for a given package ID
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-----------------------#
|
||||||
|
get_installed_ver() { # Find installed package version for a given package ID
|
||||||
|
#-----------------------#
|
||||||
|
local pkg_id=$1
|
||||||
|
|
||||||
|
find $TRACKING_DIR -name "${pkg_id}-[[:digit:]]*" | sed "s/.*${pkg_id}-//"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#-----------------------#
|
#-----------------------#
|
||||||
generate_packages() { # Master packages file
|
generate_packages() { # Master packages file
|
||||||
#-----------------------#
|
#-----------------------#
|
||||||
|
@ -49,7 +58,8 @@ generate_packages() { # Master packages file
|
||||||
for file in `find $BLFS_XML -name "*.xml"` ; do
|
for file in `find $BLFS_XML -name "*.xml"` ; do
|
||||||
pkg_id=$(grep "sect1 id" $file | sed -e 's/<sect1 id="//;s/".*//')
|
pkg_id=$(grep "sect1 id" $file | sed -e 's/<sect1 id="//;s/".*//')
|
||||||
pkg_ver=$(get_pkg_ver $pkg_id)
|
pkg_ver=$(get_pkg_ver $pkg_id)
|
||||||
[[ ! -z "$pkg_id" ]] && echo -e "$pkg_id\t$file\t$pkg_ver" >> packages.tmp
|
installed_ver=$(get_installed_ver $pkg_id)
|
||||||
|
[[ ! -z "$pkg_id" ]] && echo -e "$pkg_id\t$file\t$pkg_ver\t$installed_ver" >> packages.tmp
|
||||||
done
|
done
|
||||||
|
|
||||||
# IDs clean-up (unuseful pages or commented-out packages, could be more)
|
# IDs clean-up (unuseful pages or commented-out packages, could be more)
|
||||||
|
@ -65,19 +75,27 @@ generate_packages() { # Master packages file
|
||||||
GNOME_VER=$(get_pkg_ver gnome)
|
GNOME_VER=$(get_pkg_ver gnome)
|
||||||
GNOME_MINOR_VER=$(get_pkg_ver gnome-minor)
|
GNOME_MINOR_VER=$(get_pkg_ver gnome-minor)
|
||||||
KDE_VER=$(get_pkg_ver kde)
|
KDE_VER=$(get_pkg_ver kde)
|
||||||
|
KDE_INST_VER=$(get_installed_ver kde)
|
||||||
KDE_KOFFICE_VER=$(get_pkg_ver koffice)
|
KDE_KOFFICE_VER=$(get_pkg_ver koffice)
|
||||||
XORG7_VER=$(get_pkg_ver xorg7)
|
XORG7_VER=$(get_pkg_ver xorg7)
|
||||||
|
|
||||||
|
# Meta-packages installed version
|
||||||
|
ALSA_INST_VER=$(get_installed_ver alsa)
|
||||||
|
GNOME_INST_VER=$(get_installed_ver gnome)
|
||||||
|
KDE_INST_VER=$(get_installed_ver kde)
|
||||||
|
KDE_KOFFICE_INST_VER=$(get_installed_ver koffice)
|
||||||
|
XORG7_INST_VER=$(get_installed_ver xorg7)
|
||||||
|
|
||||||
# Add header with meta-packages pseudo Id
|
# Add header with meta-packages pseudo Id
|
||||||
{
|
{
|
||||||
cat << EOF
|
cat << EOF
|
||||||
alsa $BLFS_XML $ALSA_VER
|
alsa $BLFS_XML $ALSA_VER $ALSA_INST_VER
|
||||||
gnome-core $BLFS_XML $GNOME_VER$GNOME_MINOR_VER
|
gnome-core $BLFS_XML $GNOME_VER$GNOME_MINOR_VER $GNOME_INST_VER
|
||||||
gnome-full $BLFS_XML $GNOME_VER$GNOME_MINOR_VER
|
gnome-full $BLFS_XML $GNOME_VER$GNOME_MINOR_VER $GNOME_INST_VER
|
||||||
kde-core $BLFS_XML $KDE_VER
|
kde-core $BLFS_XML $KDE_VER $KDE_INST_VER
|
||||||
kde-full $BLFS_XML $KDE_VER
|
kde-full $BLFS_XML $KDE_VER $KDE_INST_VER
|
||||||
kde-koffice $BLFS_XML $KDE_KOFFICE_VER
|
kde-koffice $BLFS_XML $KDE_KOFFICE_VER $KDE_KOFFICE_INST
|
||||||
xorg7 $BLFS_XML $XORG7_VER
|
xorg7 $BLFS_XML $XORG7_VER $XORG7_INST_VER
|
||||||
EOF
|
EOF
|
||||||
} >> packages.tmp
|
} >> packages.tmp
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@ TREE=$3 # SVN tree for the BLFS book version
|
||||||
[[ -z $DOC_MODE ]] && DOC_MODE=update
|
[[ -z $DOC_MODE ]] && DOC_MODE=update
|
||||||
[[ -z $TREE ]] && TREE=trunk/BOOK
|
[[ -z $TREE ]] && TREE=trunk/BOOK
|
||||||
|
|
||||||
|
TRACKING_DIR=tracking-dir
|
||||||
|
|
||||||
#---------------------
|
#---------------------
|
||||||
# packages module
|
# packages module
|
||||||
source libs/func_packages
|
source libs/func_packages
|
||||||
|
|
4
blfs
4
blfs
|
@ -124,9 +124,9 @@ rm -rf menu/.svn
|
||||||
rm -rf menu/lxdialog/.svn
|
rm -rf menu/lxdialog/.svn
|
||||||
|
|
||||||
|
|
||||||
# Set some harcoded values to the proper values
|
# Set some harcoded envars to their proper values
|
||||||
sed -i 's,blfs-xml,'$BLFS_XML',' update_book.sh libs/book.xsl
|
sed -i 's,blfs-xml,'$BLFS_XML',' update_book.sh libs/book.xsl
|
||||||
sed -i 's,tracking-dir,'$TRACKING_DIR',' gen_config.sh
|
sed -i 's,tracking-dir,'$TRACKING_DIR',' update_book.sh gen_config.sh
|
||||||
|
|
||||||
# Fetch book sources and create packages and GNOME/KDE dependencies files
|
# Fetch book sources and create packages and GNOME/KDE dependencies files
|
||||||
if [[ -d $BLFS_XML ]] ; then
|
if [[ -d $BLFS_XML ]] ; then
|
||||||
|
|
Reference in a new issue