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.

76 lines
2.4 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 "Usage: $0 [ -cfg config ] [ -ignore-chksum ]" ; exit 1 ;;
  34. esac
  35. done
  36. . scripts/parse-config
  37. grep '^X' config/$config/packages | cut -f5 -d' ' | \
  38. egrep -vx 'rock-debug|rock-src' | \
  39. while read package ; do
  40. confdir=""
  41. for x in package/* ; do
  42. if [ -d "$x/$package" ] ; then
  43. if [ "$confdir" ] ; then confdir=X
  44. else confdir="$x/$package" ; fi
  45. fi
  46. done
  47. if [ -z "$confdir" ] ; then
  48. echo "$package: No such package."
  49. elif [ "$confdir" = X ] ; then
  50. echo "$package: Package in multiple trees."
  51. elif [ ! -f /var/adm/packages/$package ] ; then
  52. echo "$package: Not installed."
  53. else
  54. o_ver=$(grep '^Package Name and Version' \
  55. /var/adm/packages/$package | cut -f6 -d' ')
  56. n_ver=$(grep '^\[V\] ' $confdir/$package.desc | cut -f2 -d' ')
  57. if [ "$o_ver" != "$n_ver" -a "$n_ver" != "0000" ] ; then
  58. echo "$package: New version ($o_ver -> $n_ver)."
  59. else
  60. if [ $ignore_chksum = 0 ] ; then
  61. o_ck=$(grep '^ROCK Linux Package Source Checksum' \
  62. /var/adm/packages/$package | cut -f6 -d' ')
  63. n_ck=$(md5sum package/*/$package/* 2> /dev/null | \
  64. grep -v '\.cache$' | md5sum | cut -f1 -d' ')
  65. if [ "$o_ck" != "$n_ck" ] ; then
  66. echo "$package: New source checksum ($n_ck)."
  67. fi
  68. fi
  69. fi
  70. fi
  71. done