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.

86 lines
2.9 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 - 2003 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. while [ "$1" ] ; do
  27. case "$1" in
  28. -cfg)
  29. config=$2 ; shift ; shift ;;
  30. -ignore-chksum)
  31. ignore_chksum=1 ; shift ;;
  32. *)
  33. echo ; echo "Usage: $0 [ -cfg <config> ] [ -ignore-chksum ]"
  34. echo
  35. echo " Create a list of packages which are active in the current configuration and"
  36. echo " have changed since the binaries installed on the local system have been"
  37. echo " generated. The compare is done using the package source checksums stored"
  38. echo " in /var/adm/packages/<package-name>."
  39. echo
  40. echo " -cfg <config> only packages active in this configuration are checked"
  41. echo " -ignore-chksum ignore checksums on package source directories when"
  42. echo " determining changed packages"
  43. echo ; exit 1 ;;
  44. esac
  45. done
  46. . scripts/parse-config
  47. grep '^X' config/$config/packages | cut -f5 -d' ' | \
  48. egrep -vx 'rock-debug|rock-src' | \
  49. while read package ; do
  50. confdir=""
  51. for x in package/* ; do
  52. if [ -d "$x/$package" ] ; then
  53. if [ "$confdir" ] ; then confdir=X
  54. else confdir="$x/$package" ; fi
  55. fi
  56. done
  57. if [ -z "$confdir" ] ; then
  58. echo "$package: No such package."
  59. elif [ "$confdir" = X ] ; then
  60. echo "$package: Package in multiple trees."
  61. elif [ ! -f /var/adm/packages/$package ] ; then
  62. echo "$package: Not installed."
  63. else
  64. o_ver=$(grep '^Package Name and Version' \
  65. /var/adm/packages/$package | cut -f6 -d' ')
  66. n_ver=$(grep '^\[V\] ' $confdir/$package.desc | cut -f2 -d' ')
  67. if [ "$o_ver" != "$n_ver" -a "$n_ver" != "0000" ] ; then
  68. echo "$package: New version ($o_ver -> $n_ver)."
  69. else
  70. if [ $ignore_chksum = 0 ] ; then
  71. o_ck=$(grep '^ROCK Linux Package Source Checksum' \
  72. /var/adm/packages/$package | cut -f6 -d' ')
  73. n_ck=$(md5sum package/*/$package/* 2> /dev/null | \
  74. grep -v '\.cache$' | md5sum | cut -f1 -d' ')
  75. if [ "$o_ck" != "$n_ck" ] ; then
  76. echo "$package: New source checksum ($n_ck)."
  77. fi
  78. fi
  79. fi
  80. fi
  81. done