4 TESTDIR
=$(readlink -f $(dirname $0)) 
   8 configarchitecture 
'amd64' 'i386' 
  10 # regression test for #754904 
  11 testfailureequal 
'E: Unsupported file /dev/null given on commandline' aptget 
install -qq /dev
/null
 
  13 # only consider .deb files 
  15 I'm not a deb, I'm a teapot. 
  17 testfailureequal 
'E: Unsupported file ./foo.rpm given on commandline' aptget 
install -qq .
/foo.rpm
 
  19 # and ensure we fail for invalid debs 
  21 testfailuremsg 
"E: Sub-process Popen returned an error code (2) 
  22 E: Encountered a section with no Package: header 
  23 E: Problem with MergeList ${TMPWORKINGDIRECTORY}/foo.deb 
  24 E: The package lists or status file could not be parsed or opened." aptget 
install .
/foo.deb
 
  26 buildsimplenativepackage 
'foo' 'i386,amd64' '1.0' 
  28 testfailureequal 
"Reading package lists... 
  29 Building dependency tree... 
  30 Note, selecting 'foo:i386' instead of './incoming/foo_1.0_i386.deb' 
  31 Note, selecting 'foo' instead of './incoming/foo_1.0_amd64.deb' 
  32 Some packages could not be installed. This may mean that you have 
  33 requested an impossible situation or if you are using the unstable 
  34 distribution that some required packages have not yet been created 
  35 or been moved out of Incoming. 
  36 The following information may help to resolve the situation: 
  38 The following packages have unmet dependencies: 
  39  foo:i386 : Conflicts: foo but 1.0 is to be installed 
  40  foo : Conflicts: foo:i386 but 1.0 is to be installed 
  41 E: Unable to correct problems, you have held broken packages." aptget 
install .
/incoming
/foo_1.0_i386.deb .
/incoming
/foo_1.0_amd64.deb 
-s 
  43 testdpkgnotinstalled 
'foo' 
  44 testsuccess aptget 
install .
/incoming
/foo_1.0_i386.deb 
-o Debug
::pkgCacheGen
=1 
  45 testdpkginstalled 
'foo:i386' 
  47 testsuccessequal 
"Reading package lists... 
  48 Building dependency tree... 
  49 Reading state information... 
  50 Note, selecting 'foo' instead of './incoming/foo_1.0_amd64.deb' 
  51 The following packages will be REMOVED: 
  53 The following NEW packages will be installed: 
  55 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. 
  57 Inst foo (1.0 local-deb [amd64]) 
  58 Conf foo (1.0 local-deb [amd64])" aptget 
install .
/incoming
/foo_1.0_amd64.deb 
-s 
  60 # Check that installing the local deb works if it is not the candidate 
  63 Pin-Priority: -1" > rootdir
/etc
/apt
/preferences
 
  65 testsuccessequal 
"Reading package lists... 
  66 Building dependency tree... 
  67 Reading state information... 
  68 Note, selecting 'foo' instead of './incoming/foo_1.0_amd64.deb' 
  69 The following packages will be REMOVED: 
  71 The following NEW packages will be installed: 
  73 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. 
  75 Inst foo (1.0 local-deb [amd64]) 
  76 Conf foo (1.0 local-deb [amd64])" aptget 
install .
/incoming
/foo_1.0_amd64.deb 
-s 
  80         mkdir -p .
/incoming
/$PKG/DEBIAN
 
  82                 echo -n "$2" >> .
/incoming
/$PKG/DEBIAN
/control
 
  87 Maintainer: No Body <no@example.org> 
  89 Description: test package" >> .
/incoming
/$PKG/DEBIAN
/control
 
  91                 echo -n "$3" >> .
/incoming
/$PKG/DEBIAN
/control
 
  93         testsuccess dpkg
-deb --build .
/incoming
/$PKG/ .
/incoming
 
  94         #dpkg-deb -I ./incoming/${PKG}_0_all.deb control 
  96 createpkg 
'as-it-should-be' 
  97 createpkg 
'leading-newline' ' 
 100 createpkg 
'trailing-newline' '' ' 
 103 testsuccess aptget 
install .
/incoming
/pkg
-as-it-should-be_0_all.deb
 
 104 testsuccess aptget 
install .
/incoming
/pkg
-leading-newline_0_all.deb
 
 105 testsuccess aptget 
install .
/incoming
/pkg
-trailing-newline_0_all.deb
 
 107 # see if permission dropping is checked before usage 
 108 if [ "$(id -u)" = '0' ]; then 
 111         testsuccess aptget 
install -y --allow-downgrades .
/incoming
/pkg
-as-it-should-be_0_all.deb
 
 113         testsuccesswithnotice aptget 
install -y --allow-downgrades .
/incoming
/pkg
-as-it-should-be_0_all.deb
 
 115         testsuccesswithnotice aptget 
install -y --allow-downgrades .
/incoming
/pkg
-as-it-should-be_0_all.deb