test-bug-686346-package-missing-architecture 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. insertinstalledpackage 'pkgb' 'none' '1'
  8. insertinstalledpackage 'pkgd' 'none' '1'
  9. insertpackage 'unstable' 'pkga' 'amd64' '2' 'Depends: pkgb'
  10. insertpackage 'unstable' 'pkgb' 'amd64' '2'
  11. insertpackage 'unstable' 'pkgc' 'amd64' '1' 'Conflicts: pkgb'
  12. insertpackage 'unstable' 'pkge' 'none' '1'
  13. setupaptarchive
  14. testequal 'Reading package lists...
  15. Building dependency tree...
  16. The following packages will be REMOVED:
  17. pkgb:none
  18. The following NEW packages will be installed:
  19. pkgc
  20. 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  21. Remv pkgb:none [1]
  22. Inst pkgc (1 unstable [amd64])
  23. Conf pkgc (1 unstable [amd64])' aptget install pkgc -s
  24. testequal 'Reading package lists...
  25. Building dependency tree...
  26. The following extra packages will be installed:
  27. pkgb
  28. The following packages will be REMOVED:
  29. pkgb:none
  30. The following NEW packages will be installed:
  31. pkga pkgb
  32. 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
  33. Remv pkgb:none [1]
  34. Inst pkgb (2 unstable [amd64])
  35. Inst pkga (2 unstable [amd64])
  36. Conf pkgb (2 unstable [amd64])
  37. Conf pkga (2 unstable [amd64])' aptget install pkga -s
  38. # ensure that arch-less stanzas from Packages files are ignored
  39. msgtest 'Package is distributed in the Packages files' 'pkge'
  40. grep -q 'Package: pkge' $(find aptarchive -name 'Packages') && msgpass || msgfail
  41. testnopackage pkge
  42. testnopackage pkge:none
  43. testnopackage pkge:*
  44. # do not automatically change from none-arch to whatever-arch as
  45. # this breaks other none packages and dpkg has this ruleset as
  46. # this difference seems so important that it has to be maintained …
  47. testequal 'Reading package lists...
  48. Building dependency tree...
  49. Calculating upgrade...
  50. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade -s
  51. # pkgd has no update with an architecture
  52. testdpkginstalled pkgd
  53. msgtest 'Test apt-get purge' 'pkgd'
  54. testsuccess --nomsg aptget purge pkgd -y
  55. testdpkgnotinstalled pkgd
  56. # there is a pkgb with an architecture
  57. testdpkginstalled pkgb
  58. msgtest 'Test apt-get purge' 'pkgb:none'
  59. testsuccess --nomsg aptget purge pkgb:none -y
  60. testdpkgnotinstalled pkgb
  61. # check that dependencies are created after the none package exists in the cache
  62. rm rootdir/var/cache/apt/*.bin
  63. insertinstalledpackage 'pkgb' 'none' '1'
  64. insertinstalledpackage 'pkgf' 'none' '1' 'Conflicts: pkgb'
  65. insertinstalledpackage 'pkgg' 'amd64' '1' 'Conflicts: pkgb'
  66. insertinstalledpackage 'pkgb' 'amd64' '2'
  67. testequalor2 "Reading package lists...
  68. Building dependency tree...
  69. Reading state information...
  70. You might want to run 'apt-get -f install' to correct these.
  71. The following packages have unmet dependencies:
  72. pkgb : Conflicts: pkgb:none but 1 is installed
  73. pkgb:none : Conflicts: pkgb but 2 is installed
  74. pkgf:none : Conflicts: pkgb:none but 1 is installed
  75. Conflicts: pkgb but 2 is installed
  76. pkgg : Conflicts: pkgb but 2 is installed
  77. Conflicts: pkgb:none but 1 is installed
  78. E: Unmet dependencies. Try using -f." "Reading package lists...
  79. Building dependency tree...
  80. Reading state information...
  81. You might want to run 'apt-get -f install' to correct these.
  82. The following packages have unmet dependencies:
  83. pkgb : Conflicts: pkgb:none but 1 is installed
  84. pkgb:none : Conflicts: pkgb but 2 is installed
  85. pkgf:none : Conflicts: pkgb but 2 is installed
  86. Conflicts: pkgb:none but 1 is installed
  87. pkgg : Conflicts: pkgb but 2 is installed
  88. Conflicts: pkgb:none but 1 is installed
  89. E: Unmet dependencies. Try using -f." aptget check
  90. # check that dependencies are generated for none-packages
  91. rm rootdir/var/lib/dpkg/status
  92. insertinstalledpackage 'pkgx' 'none' '1'
  93. insertinstalledpackage 'pkgy' 'none' '1' 'Depends: pkgz, pkgx (>= 1)'
  94. insertinstalledpackage 'pkgz' 'none' '1'
  95. testequal 'Reading package lists...
  96. Building dependency tree...
  97. Reading state information...
  98. The following packages will be REMOVED:
  99. pkgx:none* pkgy:none*
  100. 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
  101. Purg pkgy:none [1]
  102. Purg pkgx:none [1]' aptget purge pkgx -s
  103. testequal 'Reading package lists...
  104. Building dependency tree...
  105. Reading state information...
  106. The following packages will be REMOVED:
  107. pkgy:none* pkgz:none*
  108. 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
  109. Purg pkgy:none [1]
  110. Purg pkgz:none [1]' aptget purge pkgz -s