mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
3.1 KiB

  1. #!/bin/bash
  2. #
  3. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  4. #
  5. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  6. # Please add additional copyright information _after_ the line containing
  7. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  8. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  9. #
  10. # ROCK Linux: rock-src/scripts/Create-UpdList
  11. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  12. #
  13. # This program is free software; you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation; either version 2 of the License, or
  16. # (at your option) any later version. A copy of the GNU General Public
  17. # License can be found at Documentation/COPYING.
  18. #
  19. # Many people helped and are helping developing ROCK Linux. Please
  20. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  21. # file for details.
  22. #
  23. # --- ROCK-COPYRIGHT-NOTE-END ---
  24. config=default
  25. ignore_chksum=0
  26. root=
  27. while [ "$1" ] ; do
  28. case "$1" in
  29. -cfg)
  30. config=$2 ; shift ; shift ;;
  31. -root)
  32. root=$2 ; shift ; shift ;;
  33. -ignore-chksum)
  34. ignore_chksum=1 ; shift ;;
  35. *)
  36. echo ; echo "Usage: $0 [ -cfg <config> ] [ -ignore-chksum ]"
  37. echo
  38. echo " Create a list of packages which are active in the current configuration and"
  39. echo " have changed since the binaries installed on the local system have been"
  40. echo " generated. The compare is done using the package source checksums stored"
  41. echo " in /var/adm/packages/<package-name>."
  42. echo
  43. echo " -cfg <config> only packages active in this configuration are checked"
  44. echo " -ignore-chksum ignore checksums on package source directories when"
  45. echo " determining changed packages"
  46. echo ; exit 1 ;;
  47. esac
  48. done
  49. . scripts/parse-config
  50. . scripts/functions
  51. grep '^X' config/$config/packages | cut -f5 -d' ' | \
  52. egrep -vx 'rock-debug|rock-src' | \
  53. while read package ; do
  54. confdir=""
  55. pkg=${package%%=*}
  56. xpkg=${package##*=}
  57. for x in package/* ; do
  58. if [ -d "$x/$pkg" ] ; then
  59. if [ "$confdir" ] ; then confdir=X
  60. else confdir="$x/$pkg" ; fi
  61. fi
  62. done
  63. if [ -z "$confdir" ] ; then
  64. echo "$pkg: No such package."
  65. elif [ "$confdir" = X ] ; then
  66. echo "$pkg: Package in multiple trees."
  67. elif [ ! -f $root/var/adm/packages/$xpkg ] ; then
  68. echo "$xpkg: Not installed."
  69. else
  70. unset ${!desc_*}
  71. parse_desc $confdir/$pkg.desc
  72. o_ver=$(grep '^Package Name and Version' \
  73. $root/var/adm/packages/$xpkg | cut -f6 -d' ')
  74. n_ver=${desc_V##*
  75. }
  76. # this is not a typo! desc_V contains all [V] tags newline separated
  77. n_ver="${n_ver% }"
  78. if [ "$o_ver" != "$n_ver" -a "$n_ver" != "0000" ] ; then
  79. echo "$pkg=$xpkg: New version ($o_ver -> $n_ver)."
  80. else
  81. if [ $ignore_chksum = 0 ] ; then
  82. o_ck=$(grep '^ROCK Linux Package Source Checksum' \
  83. $root/var/adm/packages/$xpkg | cut -f6 -d' ')
  84. n_ck=$(md5sum package/*/$pkg/* 2> /dev/null | \
  85. grep -v '\.cache$' | md5sum | cut -f1 -d' ')
  86. if [ "$o_ck" != "$n_ck" ] ; then
  87. echo "$pkg=$xpkg: New source checksum ($n_ck)."
  88. fi
  89. fi
  90. fi
  91. fi
  92. done