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.

89 lines
3.0 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 - 2004 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. grep '^X' config/$config/packages | cut -f5 -d' ' | \
  51. egrep -vx 'rock-debug|rock-src' | \
  52. while read package ; do
  53. confdir=""
  54. for x in package/* ; do
  55. if [ -d "$x/$package" ] ; then
  56. if [ "$confdir" ] ; then confdir=X
  57. else confdir="$x/$package" ; fi
  58. fi
  59. done
  60. if [ -z "$confdir" ] ; then
  61. echo "$package: No such package."
  62. elif [ "$confdir" = X ] ; then
  63. echo "$package: Package in multiple trees."
  64. elif [ ! -f $root/var/adm/packages/$package ] ; then
  65. echo "$package: Not installed."
  66. else
  67. o_ver=$(grep '^Package Name and Version' \
  68. $root/var/adm/packages/$package | cut -f6 -d' ')
  69. n_ver=$(grep '^\[V\] ' $confdir/$package.desc | cut -f2 -d' ')
  70. if [ "$o_ver" != "$n_ver" -a "$n_ver" != "0000" ] ; then
  71. echo "$package: New version ($o_ver -> $n_ver)."
  72. else
  73. if [ $ignore_chksum = 0 ] ; then
  74. o_ck=$(grep '^ROCK Linux Package Source Checksum' \
  75. $root/var/adm/packages/$package | cut -f6 -d' ')
  76. n_ck=$(md5sum package/*/$package/* 2> /dev/null | \
  77. grep -v '\.cache$' | md5sum | cut -f1 -d' ')
  78. if [ "$o_ck" != "$n_ck" ] ; then
  79. echo "$package: New source checksum ($n_ck)."
  80. fi
  81. fi
  82. fi
  83. fi
  84. done