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.
 
 
 
 
 
 

114 lines
4.1 KiB

  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. setupaptarchive
  13. testsuccessequal 'Reading package lists...
  14. Building dependency tree...
  15. The following packages will be REMOVED:
  16. pkgb:none
  17. The following NEW packages will be installed:
  18. pkgc
  19. 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  20. Remv pkgb:none [1]
  21. Inst pkgc (1 unstable [amd64])
  22. Conf pkgc (1 unstable [amd64])' aptget install pkgc -s
  23. testsuccessequal 'Reading package lists...
  24. Building dependency tree...
  25. The following additional packages will be installed:
  26. pkgb
  27. The following packages will be REMOVED:
  28. pkgb:none
  29. The following NEW packages will be installed:
  30. pkga pkgb
  31. 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
  32. Remv pkgb:none [1]
  33. Inst pkgb (2 unstable [amd64])
  34. Inst pkga (2 unstable [amd64])
  35. Conf pkgb (2 unstable [amd64])
  36. Conf pkga (2 unstable [amd64])' aptget install pkga -s
  37. # do not automatically change from none-arch to whatever-arch as
  38. # this breaks other none packages and dpkg has this ruleset as
  39. # this difference seems so important that it has to be maintained …
  40. testsuccessequal 'Reading package lists...
  41. Building dependency tree...
  42. Calculating upgrade...
  43. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade -s
  44. # pkgd has no update with an architecture
  45. testdpkginstalled pkgd
  46. msgtest 'Test apt-get purge' 'pkgd'
  47. testsuccess --nomsg aptget purge pkgd -y
  48. testdpkgnotinstalled pkgd
  49. # there is a pkgb with an architecture
  50. testdpkginstalled pkgb
  51. msgtest 'Test apt-get purge' 'pkgb:none'
  52. testsuccess --nomsg aptget purge pkgb:none -y
  53. testdpkgnotinstalled pkgb
  54. # check that dependencies are created after the none package exists in the cache
  55. rm rootdir/var/cache/apt/*.bin
  56. insertinstalledpackage 'pkgb' 'none' '1'
  57. insertinstalledpackage 'pkgf' 'none' '1' 'Conflicts: pkgb'
  58. insertinstalledpackage 'pkgg' 'amd64' '1' 'Conflicts: pkgb'
  59. insertinstalledpackage 'pkgb' 'amd64' '2'
  60. testequalor2 "Reading package lists...
  61. Building dependency tree...
  62. Reading state information...
  63. You might want to run 'apt --fix-broken install' to correct these.
  64. The following packages have unmet dependencies:
  65. pkgb : Conflicts: pkgb:none but 1 is installed
  66. pkgb:none : Conflicts: pkgb but 2 is installed
  67. pkgf:none : Conflicts: pkgb:none but 1 is installed
  68. Conflicts: pkgb but 2 is installed
  69. pkgg : Conflicts: pkgb but 2 is installed
  70. Conflicts: pkgb:none but 1 is installed
  71. E: Unmet dependencies. Try using --fix-broken." "Reading package lists...
  72. Building dependency tree...
  73. Reading state information...
  74. You might want to run 'apt --fix-broken install' to correct these.
  75. The following packages have unmet dependencies:
  76. pkgb : Conflicts: pkgb:none but 1 is installed
  77. pkgb:none : Conflicts: pkgb but 2 is installed
  78. pkgf:none : Conflicts: pkgb but 2 is installed
  79. Conflicts: pkgb:none but 1 is installed
  80. pkgg : Conflicts: pkgb but 2 is installed
  81. Conflicts: pkgb:none but 1 is installed
  82. E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)." aptget check
  83. # check that dependencies are generated for none-packages
  84. rm rootdir/var/lib/dpkg/status
  85. insertinstalledpackage 'pkgx' 'none' '1'
  86. insertinstalledpackage 'pkgy' 'none' '1' 'Depends: pkgz, pkgx (>= 1)'
  87. insertinstalledpackage 'pkgz' 'none' '1'
  88. testsuccessequal 'Reading package lists...
  89. Building dependency tree...
  90. Reading state information...
  91. The following packages will be REMOVED:
  92. pkgx:none* pkgy:none*
  93. 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
  94. Purg pkgy:none [1]
  95. Purg pkgx:none [1]' aptget purge pkgx -s
  96. testsuccessequal 'Reading package lists...
  97. Building dependency tree...
  98. Reading state information...
  99. The following packages will be REMOVED:
  100. pkgy:none* pkgz:none*
  101. 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
  102. Purg pkgy:none [1]
  103. Purg pkgz:none [1]' aptget purge pkgz -s