"Fossies" - the Fresh Open Source Software Archive

Member "apt-2.2.4/test/integration/test-uri-encode-filename-field" (10 Jun 2021, 1048 Bytes) of package /linux/misc/apt-2.2.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 set -e
    3 
    4 TESTDIR="$(readlink -f "$(dirname "$0")")"
    5 . "$TESTDIR/framework"
    6 setupenvironment
    7 configarchitecture 'amd64'
    8 
    9 buildsimplenativepackage 'foo' 'all' '0+0~0'
   10 setupaptarchive --no-update
   11 
   12 runtest() {
   13     rm -rf rootdir/var/lib/apt/lists
   14     testsuccess apt update
   15 
   16     cd downloaded
   17     testsuccess apt download foo
   18     testsuccess rm 'foo_0+0~0_all.deb'
   19     testsuccess apt install foo
   20 
   21     mv '../aptarchive/pool/foo_0+0~0_all.deb' '../aptarchive/pool/foo_0%3a0+0~0_all.deb'
   22     testsuccess apt purge foo -y
   23     testfailure apt download foo
   24     testfailure apt install foo
   25 
   26     sed -i -e 's#_0+0~0_#_0%3a0+0~0_#' ../rootdir/var/lib/apt/lists/*Packages
   27     testsuccess apt download foo
   28     # FIXME: we shouldn't take filename from file:/ in 'apt download'
   29     if [ "$1" = 'file' ]; then
   30         testsuccess rm 'foo_0%3a0+0~0_all.deb'
   31     else
   32         testsuccess rm 'foo_0+0~0_all.deb'
   33     fi
   34     testsuccess apt install foo
   35 
   36     cd "$TMPWORKINGDIRECTORY" >/dev/null
   37     mv 'aptarchive/pool/foo_0%3a0+0~0_all.deb' 'aptarchive/pool/foo_0+0~0_all.deb'
   38 }
   39 
   40 runtest 'file'
   41 changetowebserver
   42 runtest 'http'