OpenSDE Packages Database (without history before r20070)
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.

78 lines
2.4 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../vserver/pkg_linux_post.conf
  5. # Copyright (C) 2006 - 2009 The OpenSDE Project
  6. # Copyright (C) 2004 - 2006 The T2 SDE Project
  7. # Copyright (C) 1998 - 2003 Clifford Wolf
  8. #
  9. # More information can be found in the files COPYING and README.
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; version 2 of the License. A copy of the
  14. # GNU General Public License can be found in the file COPYING.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. pkg_ctx_confdir=$base/package/*/vserver
  17. # tempdir
  18. pkg_ctx_tempdir=`mktemp -d`
  19. #hook_add postpatch 6 "rm -rf $pkg_ctx_tempdir"
  20. # detect /best fit/ linux patch
  21. pkg_ctx_lxver=${ver//-/.}.
  22. pkg_ctx_patch=
  23. while [ "$pkg_ctx_lxver" != "${pkg_ctx_lxver%.*}" -a -z "$pkg_ctx_patch" ]; do
  24. pkg_ctx_lxver=${pkg_ctx_lxver%.*}
  25. pkg_ctx_patch=`match_source_file -p " patch-${pkg_ctx_lxver}[^ ]*-vs[^ q].*.diff" vserver | head -n1`
  26. done
  27. [ -z "$pkg_ctx_patch" ] && abort "no vserver patch found for linux $ver"
  28. # find supplementary fixes
  29. pkg_ctx_fixes_pattern="`basename ${pkg_ctx_patch%.diff} .diff`[.].*[.]diff"
  30. pkg_ctx_fixes="`match_source_file -p " ${pkg_ctx_fixes_pattern}" vserver`"
  31. # find deltas
  32. # NOTE: these are version independent
  33. pkg_ctx_deltas="$( match_source_file -p 'delta-.*\.diff' vserver )"
  34. # prepare vserver patch
  35. pkg_ctx_ver=$( echo $pkg_ctx_patch | sed -n -e 's,.*-vs\(.*\).diff.*,\1,p' )
  36. # remove extraversion from patch and inject in lx_extraversion by hand
  37. [[ ${pkg_ctx_patch} == *.bz2 ]] && x=bzcat || x=cat
  38. $x ${pkg_ctx_patch} | gawk "
  39. BEGIN { FS=\"[ /\t]\"
  40. removethis=0
  41. }
  42. /^--- / {
  43. if ( \$3 == \"Makefile\" )
  44. removethis=1
  45. else
  46. removethis=0
  47. }
  48. /.*/ {
  49. if ( removethis != 1 )
  50. print
  51. }
  52. " > $pkg_ctx_tempdir/vserver-${pkg_ctx_ver}.patch
  53. # Append patch and fixes
  54. var_append patchfiles ' ' $pkg_ctx_tempdir/vserver-$pkg_ctx_ver.patch
  55. [ -n "${pkg_ctx_fixes}" ] && var_append patchfiles ' ' ${pkg_ctx_fixes}
  56. # Add a + at the version if we have deltas, and append them
  57. if [ -n "$pkg_ctx_deltas" ]; then
  58. pkg_ctx_ver="$pkg_ctx_ver+"
  59. for x in $pkg_ctx_deltas; do
  60. var_append patchfiles ' ' "$x"
  61. done
  62. fi
  63. echo_status "Including VServer ($pkg_ctx_ver) support."
  64. hook_add postpatch 5 "lx_extraversion=\$lx_extraversion-vs${pkg_ctx_ver}"
  65. var_insert lx_confmerge ' ' "$pkg_ctx_confdir/linux.cfg"