r3031 - in jhalfs/branches/experimental: . BLFS BLFS/libs

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Mon Aug 21 14:09:17 PDT 2006


Author: manuel
Date: 2006-08-21 15:09:16 -0600 (Mon, 21 Aug 2006)
New Revision: 3031

Modified:
   jhalfs/branches/experimental/BLFS/libs/func_packages
   jhalfs/branches/experimental/BLFS/update_book.sh
   jhalfs/branches/experimental/blfs
Log:
Added installed version to packages database

Modified: jhalfs/branches/experimental/BLFS/libs/func_packages
===================================================================
--- jhalfs/branches/experimental/BLFS/libs/func_packages	2006-08-21 20:18:26 UTC (rev 3030)
+++ jhalfs/branches/experimental/BLFS/libs/func_packages	2006-08-21 21:09:16 UTC (rev 3031)
@@ -38,6 +38,15 @@
 }
 
 #-----------------------#
+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
 #-----------------------#
   local pkg_id file pkg_ver
@@ -49,7 +58,8 @@
   for file in `find $BLFS_XML -name "*.xml"` ; do
     pkg_id=$(grep "sect1 id" $file | sed -e 's/<sect1 id="//;s/".*//')
     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
 
   # IDs clean-up (unuseful pages or commented-out packages, could be more)
@@ -65,19 +75,27 @@
   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_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
 {
   cat << EOF
-alsa	$BLFS_XML	$ALSA_VER
-gnome-core	$BLFS_XML	$GNOME_VER$GNOME_MINOR_VER
-gnome-full	$BLFS_XML	$GNOME_VER$GNOME_MINOR_VER
-kde-core	$BLFS_XML	$KDE_VER
-kde-full	$BLFS_XML	$KDE_VER
-kde-koffice	$BLFS_XML	$KDE_KOFFICE_VER
-xorg7	$BLFS_XML	$XORG7_VER
+alsa	$BLFS_XML	$ALSA_VER	$ALSA_INST_VER
+gnome-core	$BLFS_XML	$GNOME_VER$GNOME_MINOR_VER	$GNOME_INST_VER
+gnome-full	$BLFS_XML	$GNOME_VER$GNOME_MINOR_VER	$GNOME_INST_VER
+kde-core	$BLFS_XML	$KDE_VER	$KDE_INST_VER
+kde-full	$BLFS_XML	$KDE_VER	$KDE_INST_VER
+kde-koffice	$BLFS_XML	$KDE_KOFFICE_VER	$KDE_KOFFICE_INST
+xorg7	$BLFS_XML	$XORG7_VER	$XORG7_INST_VER
 EOF
 } >> packages.tmp
 

Modified: jhalfs/branches/experimental/BLFS/update_book.sh
===================================================================
--- jhalfs/branches/experimental/BLFS/update_book.sh	2006-08-21 20:18:26 UTC (rev 3030)
+++ jhalfs/branches/experimental/BLFS/update_book.sh	2006-08-21 21:09:16 UTC (rev 3031)
@@ -14,6 +14,8 @@
 [[ -z $DOC_MODE ]] && DOC_MODE=update
 [[ -z $TREE ]] && TREE=trunk/BOOK
 
+TRACKING_DIR=tracking-dir
+
 #---------------------
 # packages module
 source libs/func_packages

Modified: jhalfs/branches/experimental/blfs
===================================================================
--- jhalfs/branches/experimental/blfs	2006-08-21 20:18:26 UTC (rev 3030)
+++ jhalfs/branches/experimental/blfs	2006-08-21 21:09:16 UTC (rev 3031)
@@ -124,9 +124,9 @@
 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,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
 if [[ -d $BLFS_XML ]] ; then




More information about the alfs-log mailing list