test-architecture-specification-parsing 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. # we need this construct here as it isn't really possible to fake native arch for dpkg-* tools
  7. NATIVE="$(command dpkg --print-architecture)"
  8. configarchitecture "${NATIVE}" 'armel'
  9. buildsimplenativepackage 'pkg-arch-foo' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [${NATIVE} !${NATIVE}]
  10. Depends: foo [${NATIVE} !${NATIVE}]"
  11. buildsimplenativepackage 'pkg-arch-no-foo' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [!${NATIVE} ${NATIVE}]
  12. Depends: foo [!${NATIVE} ${NATIVE}]"
  13. buildsimplenativepackage 'pkg-arch-foo-unrelated-no' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [!someos-any ${NATIVE}]
  14. Depends: foo [!someos-any ${NATIVE}]"
  15. buildsimplenativepackage 'pkg-arch-foo-unrelated-no2' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [${NATIVE} !someos-any]
  16. Depends: foo [${NATIVE} !someos-any]"
  17. buildsimplenativepackage 'no-depends' 'armel' '1.0' 'stable' 'Build-Depends: foo [armeb], bar [arm]
  18. Depends: foo [armeb], bar [arm]'
  19. buildsimplenativepackage 'foo' "$NATIVE" '1.0' 'stable'
  20. insertinstalledpackage 'build-essential' 'all' '11.5' 'Multi-Arch: foreign'
  21. setupaptarchive
  22. testequal "Reading package lists...
  23. Building dependency tree...
  24. The following extra packages will be installed:
  25. foo
  26. The following NEW packages will be installed:
  27. foo pkg-arch-foo
  28. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  29. Inst foo (1.0 stable [${NATIVE}])
  30. Inst pkg-arch-foo (1.0 stable [${NATIVE}])
  31. Conf foo (1.0 stable [${NATIVE}])
  32. Conf pkg-arch-foo (1.0 stable [${NATIVE}])" aptget install pkg-arch-foo -s
  33. testequal "Reading package lists...
  34. Building dependency tree...
  35. The following NEW packages will be installed:
  36. pkg-arch-no-foo
  37. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  38. Inst pkg-arch-no-foo (1.0 stable [${NATIVE}])
  39. Conf pkg-arch-no-foo (1.0 stable [${NATIVE}])" aptget install pkg-arch-no-foo -s
  40. testequal "Reading package lists...
  41. Building dependency tree...
  42. The following extra packages will be installed:
  43. foo
  44. The following NEW packages will be installed:
  45. foo pkg-arch-foo-unrelated-no
  46. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  47. Inst foo (1.0 stable [${NATIVE}])
  48. Inst pkg-arch-foo-unrelated-no (1.0 stable [${NATIVE}])
  49. Conf foo (1.0 stable [${NATIVE}])
  50. Conf pkg-arch-foo-unrelated-no (1.0 stable [${NATIVE}])" aptget install pkg-arch-foo-unrelated-no -s
  51. testequal "Reading package lists...
  52. Building dependency tree...
  53. The following extra packages will be installed:
  54. foo
  55. The following NEW packages will be installed:
  56. foo pkg-arch-foo-unrelated-no2
  57. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  58. Inst foo (1.0 stable [${NATIVE}])
  59. Inst pkg-arch-foo-unrelated-no2 (1.0 stable [${NATIVE}])
  60. Conf foo (1.0 stable [${NATIVE}])
  61. Conf pkg-arch-foo-unrelated-no2 (1.0 stable [${NATIVE}])" aptget install pkg-arch-foo-unrelated-no2 -s
  62. testequal "Reading package lists...
  63. Building dependency tree...
  64. The following NEW packages will be installed:
  65. foo
  66. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  67. Inst foo (1.0 stable [${NATIVE}])
  68. Conf foo (1.0 stable [${NATIVE}])" aptget build-dep pkg-arch-foo -s
  69. testequal 'Reading package lists...
  70. Building dependency tree...
  71. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget build-dep pkg-arch-no-foo -s
  72. testequal "Reading package lists...
  73. Building dependency tree...
  74. The following NEW packages will be installed:
  75. foo
  76. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  77. Inst foo (1.0 stable [${NATIVE}])
  78. Conf foo (1.0 stable [${NATIVE}])" aptget build-dep pkg-arch-foo-unrelated-no -s
  79. testequal "Reading package lists...
  80. Building dependency tree...
  81. The following NEW packages will be installed:
  82. foo
  83. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  84. Inst foo (1.0 stable [${NATIVE}])
  85. Conf foo (1.0 stable [${NATIVE}])" aptget build-dep pkg-arch-foo-unrelated-no2 -s
  86. testequal 'Reading package lists...
  87. Building dependency tree...
  88. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget build-dep no-depends -s
  89. # this is not really testing APT - more that dpkg is in line with us
  90. configarchitecture 'amd64' 'armel'
  91. testequal 'Reading package lists...
  92. Building dependency tree...
  93. The following NEW packages will be installed:
  94. no-depends:armel
  95. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  96. Inst no-depends:armel (1.0 stable [armel])
  97. Conf no-depends:armel (1.0 stable [armel])' aptget install no-depends -s