Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package obs-service-download_files for 
openSUSE:Factory checked in at 2021-10-15 23:03:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/obs-service-download_files (Old)
 and      /work/SRC/openSUSE:Factory/.obs-service-download_files.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "obs-service-download_files"

Fri Oct 15 23:03:52 2021 rev:30 rq:925241 version:0.9.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/obs-service-download_files/obs-service-download_files.changes
    2021-05-04 22:01:29.348487937 +0200
+++ 
/work/SRC/openSUSE:Factory/.obs-service-download_files.new.1890/obs-service-download_files.changes
  2021-10-15 23:04:15.286109918 +0200
@@ -1,0 +2,20 @@
+Wed Oct 13 14:42:29 UTC 2021 - Adrian Schr??ter <[email protected]>
+
+- update to version 0.9.1:
+  * supporting alternative local filenames in spec and PKGBUILD
+  * Download files only on the "last" *.spec files
+  * fixes for silent download
+
+-------------------------------------------------------------------
+Tue Aug 24 13:14:05 UTC 2021 - [email protected]
+
+- Update to version 0.8.0:
+  * updated debian control and changelog
+  * added debian.dsc
+  * added 'make test' to spec file
+  * fix '--recompress'
+  * fix test suite
+  * added KankuFile
+  * added section 'clean' to Makefile
+
+-------------------------------------------------------------------

Old:
----
  _servicedata
  obs-service-download_files-0.7.2.tar.gz

New:
----
  obs-service-download_files-0.9.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ obs-service-download_files.spec ++++++
--- /var/tmp/diff_new_pack.qtuqdP/_old  2021-10-15 23:04:15.826110304 +0200
+++ /var/tmp/diff_new_pack.qtuqdP/_new  2021-10-15 23:04:15.830110306 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package obs-service-download_files
+# spec file
 #
 # Copyright (c) 2021 SUSE LLC
 #
@@ -16,28 +16,35 @@
 #
 
 
-#
+%define service download_files
 %if 0%{?fedora} || 0%{?rhel}
 %define build_pkg_name obs-build
 %else
 %define build_pkg_name build
 %endif
-
-%define service download_files
 Name:           obs-service-%{service}
-Version:        0.7.2
+Version:        0.9.1
 Release:        0
 Summary:        An OBS source service: download files
 License:        GPL-2.0-or-later
-Group:          Development/Tools/Building
 URL:            https://github.com/openSUSE/obs-service-%{service}
-Source:         %{name}-%{version}.tar.gz
+Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz
+BuildRequires:  %{build_pkg_name}
+BuildRequires:  bzip2
+BuildRequires:  tar
+BuildRequires:  (curl or curl-minimal)
+BuildRequires:  perl(File::Type)
+BuildRequires:  perl(FindBin)
+BuildRequires:  perl(HTTP::Server::Simple)
+BuildRequires:  perl(Path::Class)
+# provides: /usr/bin/prove
+BuildRequires:  perl(Test::Harness)
+BuildRequires:  perl(Test::More)
 Requires:       %{build_pkg_name} >= 2012.08.24
 Requires:       curl
 Requires:       diffutils
 # for appimage parser:
 Requires:       perl(YAML::XS)
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildArch:      noarch
 
 %description
@@ -46,16 +53,18 @@
 This service is parsing all spec files and downloads all Source files which 
are specified via a http, https or ftp url.
 
 %prep
-%setup -q
+%autosetup
 
 %build
-perl -p -i -e "s{#!/usr/bin/env bash}{#!/bin/bash}" download_files
+perl -p -i -e "s{#!%{_bindir}/env bash}{#!/bin/bash}" download_files
 
 %install
-%makeinstall
+%make_install
+
+%check
+%make_build test
 
 %files
-%defattr(-,root,root)
 %doc README.md
 %dir %{_prefix}/lib/obs
 %{_prefix}/lib/obs/service

++++++ PKGBUILD ++++++
--- /var/tmp/diff_new_pack.qtuqdP/_old  2021-10-15 23:04:15.858110327 +0200
+++ /var/tmp/diff_new_pack.qtuqdP/_new  2021-10-15 23:04:15.858110327 +0200
@@ -1,5 +1,5 @@
 pkgname=obs-service-download_files
-pkgver=0.7.2
+pkgver=0.9.1
 pkgrel=0
 pkgdesc="An OBS source service: download files"
 arch=(any)

++++++ _service ++++++
--- /var/tmp/diff_new_pack.qtuqdP/_old  2021-10-15 23:04:15.882110343 +0200
+++ /var/tmp/diff_new_pack.qtuqdP/_new  2021-10-15 23:04:15.882110343 +0200
@@ -1,10 +1,9 @@
 <services>
   <service mode="manual" name="tar_scm">
-    <param 
name="url">[email protected]:openSUSE/obs-service-download_files.git</param>
-    <param name="revision">0.7.2</param>
-    <param name="version">0.7.2</param>
+    <param 
name="url">https://github.com/openSUSE/obs-service-download_files.git</param>
+    <param name="revision">0.9.1</param>
+    <param name="version">0.9.1</param>
     <param name="scm">git</param>
-    <param name="changesgenerate">enable</param>
     <param name="extract">dist/obs-service-download_files.spec</param>
   </service>
   <service mode="manual" name="set_version"/>

++++++ debian.dsc ++++++
--- /var/tmp/diff_new_pack.qtuqdP/_old  2021-10-15 23:04:15.902110357 +0200
+++ /var/tmp/diff_new_pack.qtuqdP/_new  2021-10-15 23:04:15.906110360 +0200
@@ -1,6 +1,6 @@
 Format: 1.0
 Source: obs-service-download-files
-Version: 0.7.2-0
+Version: 0.9.1-0
 Binary: obs-service-download-files
 Maintainer: Hib Eris <[email protected]>
 Architecture: all
@@ -11,4 +11,4 @@
  libfile-type-perl, 
  libcgi-pm-perl,  
  build | obs-build, 
- wget,
+ curl,

++++++ obs-service-download_files-0.7.2.tar.gz -> 
obs-service-download_files-0.9.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-service-download_files-0.7.2/.gitignore 
new/obs-service-download_files-0.9.1/.gitignore
--- old/obs-service-download_files-0.7.2/.gitignore     1970-01-01 
01:00:00.000000000 +0100
+++ new/obs-service-download_files-0.9.1/.gitignore     2021-10-14 
13:14:24.000000000 +0200
@@ -0,0 +1,2 @@
+*.sw?
+t/tmp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-service-download_files-0.7.2/KankuFile 
new/obs-service-download_files-0.9.1/KankuFile
--- old/obs-service-download_files-0.7.2/KankuFile      1970-01-01 
01:00:00.000000000 +0100
+++ new/obs-service-download_files-0.9.1/KankuFile      2021-10-14 
13:14:24.000000000 +0200
@@ -0,0 +1,46 @@
+#
+domain_name: kanku-vm
+default_job: kanku-job
+login_user: root
+login_pass: kankudai
+
+jobs:
+ kanku-job:
+  -
+    use_module: Kanku::Handler::SetJobContext
+    options:
+      host_interface: eth0
+  -
+    use_module: Kanku::Handler::OBSCheck
+    options:
+      api_url: https://api.opensuse.org/public
+      # Please have a look at
+      # kanku lsi
+      # to find more official Images
+      project: devel:kanku:images
+      package: openSUSE-Tumbleweed-JeOS:ext4
+      repository: images_tumbleweed
+      arch: x86_64
+      use_oscrc: 0
+  -
+    use_module: Kanku::Handler::ImageDownload
+  -
+    use_module: Kanku::Handler::CreateDomain
+    options:
+      memory: 2G
+      vcpu: 2
+      use_9p: 1
+
+  -
+    use_module: Kanku::Handler::PrepareSSH
+  -
+    use_module: Kanku::Handler::ExecuteCommandViaSSH
+    options:
+      commands:
+        - zypper -n in perl-Path-Class perl-HTTP-Server-Simple perl-File-Type 
make tar build bzip2
+  -
+    use_module: Kanku::Handler::ExecuteCommandViaSSH
+    options:
+      username: kanku
+      commands:
+        - make -C /tmp/kanku clean test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-service-download_files-0.7.2/Makefile 
new/obs-service-download_files-0.9.1/Makefile
--- old/obs-service-download_files-0.7.2/Makefile       2021-04-27 
14:29:49.000000000 +0200
+++ new/obs-service-download_files-0.9.1/Makefile       2021-10-14 
13:14:24.000000000 +0200
@@ -18,4 +18,7 @@
 test:
        prove -v t/*.t
 
+clean:
+       rm -rf t/tmp/
+
 .PHONY: all install test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-service-download_files-0.7.2/debian/changelog 
new/obs-service-download_files-0.9.1/debian/changelog
--- old/obs-service-download_files-0.7.2/debian/changelog       2021-04-27 
14:29:49.000000000 +0200
+++ new/obs-service-download_files-0.9.1/debian/changelog       2021-10-14 
13:14:24.000000000 +0200
@@ -1,3 +1,11 @@
+obs-service-download-files (0.8.0) UNRELEASED; urgency=medium
+
+  * Fixed '--recompress' feature
+  * Fixed test suite
+  * Updated BuildDepends and Depends
+
+ -- Frank Schreiner <[email protected]>  Fri, 07 May 2021 09:34:27 +0200
+
 obs-service-download-files (0.6.0) stable; urgency=medium
 
   * Enforce SSL verification
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-service-download_files-0.7.2/debian/control 
new/obs-service-download_files-0.9.1/debian/control
--- old/obs-service-download_files-0.7.2/debian/control 2021-04-27 
14:29:49.000000000 +0200
+++ new/obs-service-download_files-0.9.1/debian/control 2021-10-14 
13:14:24.000000000 +0200
@@ -2,12 +2,6 @@
 Maintainer: Hib Eris <[email protected]>
 Section: devel
 Priority: extra
-Depends: build | obs-build,
- libcgi-pm-perl,
- libfile-type-perl,
- libhttp-server-simple-perl,
- libpath-class-perl,
- curl,
 Build-Depends: debhelper (>= 7),
  build | obs-build,
  libcgi-pm-perl,
@@ -15,6 +9,9 @@
  libhttp-server-simple-perl,
  libpath-class-perl,
  curl,
+ bzip2,
+ make,
+ tar
 Standards-Version: 3.9.6
 Homepage: https://github.com/openSUSE/obs-service-download_files
 
@@ -25,3 +22,9 @@
  .
  This service is parsing all spec files and downloads all Source files which
  are specified via a http, https or ftp url.
+Depends: build | obs-build,
+ libcgi-pm-perl,
+ libfile-type-perl,
+ libhttp-server-simple-perl,
+ libpath-class-perl,
+ curl,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-service-download_files-0.7.2/dist/debian.dsc 
new/obs-service-download_files-0.9.1/dist/debian.dsc
--- old/obs-service-download_files-0.7.2/dist/debian.dsc        1970-01-01 
01:00:00.000000000 +0100
+++ new/obs-service-download_files-0.9.1/dist/debian.dsc        2021-10-14 
13:14:24.000000000 +0200
@@ -0,0 +1,15 @@
+Format: 1.0
+Source: obs-service-download-files
+Version: 0.8.0-0
+Binary: obs-service-download-files
+Maintainer: Hib Eris <[email protected]>
+Architecture: all
+Standards-Version: 3.9.6
+Build-Depends: debhelper (>= 7), 
+ libpath-class-perl, 
+ libhttp-server-simple-perl, 
+ libfile-type-perl, 
+ libcgi-pm-perl,  
+ build | obs-build, 
+ curl,
+ netbase,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-download_files-0.7.2/dist/obs-service-download_files.spec 
new/obs-service-download_files-0.9.1/dist/obs-service-download_files.spec
--- old/obs-service-download_files-0.7.2/dist/obs-service-download_files.spec   
2021-04-27 14:29:49.000000000 +0200
+++ new/obs-service-download_files-0.9.1/dist/obs-service-download_files.spec   
2021-10-14 13:14:24.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package obs-service-download_files
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -14,27 +14,37 @@
 
 # Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
+
+
+%define service download_files
 %if 0%{?fedora} || 0%{?rhel}
 %define build_pkg_name obs-build
 %else
 %define build_pkg_name build
 %endif
-
-%define service download_files
 Name:           obs-service-%{service}
-Version:        0.6.2
+Version:        0.8.0
 Release:        0
 Summary:        An OBS source service: download files
 License:        GPL-2.0-or-later
-Group:          Development/Tools/Building
-Url:            https://github.com/openSUSE/obs-service-%{service}
-Source:         %{name}-%{version}.tar.gz
+URL:            https://github.com/openSUSE/obs-service-%{service}
+Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz
+BuildRequires:  %{build_pkg_name}
+BuildRequires:  (curl or curl-minimal)
+BuildRequires:  bzip2
+BuildRequires:  tar
+BuildRequires:  perl(File::Type)
+BuildRequires:  perl(FindBin)
+BuildRequires:  perl(HTTP::Server::Simple)
+BuildRequires:  perl(Path::Class)
+# provides: /usr/bin/prove
+BuildRequires:  perl(Test::Harness)
+BuildRequires:  perl(Test::More)
 Requires:       %{build_pkg_name} >= 2012.08.24
-Requires:       diffutils
 Requires:       curl
+Requires:       diffutils
 # for appimage parser:
 Requires:       perl(YAML::XS)
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildArch:      noarch
 
 %description
@@ -43,16 +53,18 @@
 This service is parsing all spec files and downloads all Source files which 
are specified via a http, https or ftp url.
 
 %prep
-%setup -q
+%autosetup
 
 %build
-perl -p -i -e "s{#!/usr/bin/env bash}{#!/bin/bash}" download_files
+perl -p -i -e "s{#!%{_bindir}/env bash}{#!/bin/bash}" download_files
 
 %install
-%makeinstall
+%make_install
+
+%check
+%make_build test
 
 %files
-%defattr(-,root,root)
 %doc README.md
 %dir %{_prefix}/lib/obs
 %{_prefix}/lib/obs/service
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-service-download_files-0.7.2/download_files 
new/obs-service-download_files-0.9.1/download_files
--- old/obs-service-download_files-0.7.2/download_files 2021-04-27 
14:29:49.000000000 +0200
+++ new/obs-service-download_files-0.9.1/download_files 2021-10-14 
13:14:24.000000000 +0200
@@ -1,6 +1,5 @@
 #!/usr/bin/env bash
-
-# downloads files specified in spec files
+# downloads files specified in spec files (or PKGBUILD, appimage.yml and so on)
 
 # config options for this host ?
 [[ -f /etc/obs/services/download_files ]] && . /etc/obs/services/download_files
@@ -218,13 +217,37 @@
 
 SRCDIR=$PWD
 
+declare -A spec_files
+for i in *.spec; do
+  basespec=$(echo ${i##*:})
+  existing_longest=$(echo ${spec_files[${basespec}]})
+  if [[ ${#i} -gt ${#existing_longest} ]]; then
+    spec_files[${basespec}]=$i
+  fi
+done
+
 RETURN=0
-for i in *.spec PKGBUILD appimage.yml; do
+for i in ${spec_files[@]} PKGBUILD appimage.yml; do
   test -e "$i" || continue
 
   for url in `perl -I/usr/lib/build -MBuild -e Build::show $default_config 
"$i" sources` `perl -I/usr/lib/build -MBuild -e Build::show $default_config 
"$i" patches`; do
    
     MYCACHEDIRECTORY="$CACHEDIRECTORY"
+    FILE=""
+    if [ "$i" = "PKGBUILD" ]; then
+      if [ -z "${url##*::*}" ]; then
+        FILE="${url%%::*}"
+        url="${url#*::}"
+      fi
+    else
+      # If file name has been specified in the Source: tag use it (Format: 
Source:  <URL>[#/filename]).
+      if [ -z "${url##*\#/*}" ]; then
+        FILE=${url##*#/}
+        url=${url%#/*}
+      fi
+    fi
+    [ -z "$FILE" ] && FILE="${url##*/}"
+
     PROTOCOL="${url%%:*}"
     SAMEFILEAFTERCOMPRESSION=
     [[ "${PROTOCOL}" != "http" && "${PROTOCOL}" != "https" && "${PROTOCOL}" != 
"ftp" ]] && continue
@@ -240,13 +263,11 @@
       echo "INFO: Taking file from local cache $FILE"
       cp -a -- "$MYCACHEDIRECTORY/file/$HASH" ./"$FILE"
     elif [ -z "$DORECOMPRESS" ]; then
-      FILE="${url##*/}"
-
       # avoid re-download if file exists with same modification time and we do 
not
       # enforce a download via enforceupstream.
-      [ -e "$SRCDIR/$FILE" -a "$ENFORCELOCAL" != "yes" -a "$ENFORCEUPSTREAM" 
!= "yes" ] && CURL=("${CURL[@]}" --time-cond $SRCDIR/$FILE)
+      [ -e "$SRCDIR/$FILE" -a "$ENFORCELOCAL" != "yes" -a "$ENFORCEUPSTREAM" 
!= "yes" ] && CURLCMD=("${CURL[@]}" --time-cond $SRCDIR/$FILE) || 
CURLCMD=("${CURL[@]}")
 
-      if ! "${CURL[@]}" -R --output "$FILE" "$url"; then
+      if ! "${CURLCMD[@]}" -R --output "$FILE" "$url"; then
         rm -f "$FILE"
         echo "ERROR: Failed to download \"$url\""
         exit 1
@@ -254,20 +275,30 @@
       RECOMPRESS=
     else
 
-      FILE="${url##*/}"
       FORMAT="${url##*\.}"
-      if "${CURL[@]}" -R --output "$FILE" "$url"; then
-        RECOMPRESS=
-      elif "${CURL[@]}" -R --output "${FILE%\.$FORMAT}.gz" 
"${url%\.$FORMAT}.gz"; then
-        RECOMPRESS="$FORMAT"
-        FILE="${FILE%\.$FORMAT}.gz"
-      elif "${CURL[@]}" -R --output "${FILE%\.$FORMAT}.bz2" 
"${url%\.$FORMAT}.bz2"; then
-        RECOMPRESS="$FORMAT"
-        FILE="${FILE%\.$FORMAT}.bz2"
-      elif "${CURL[@]}" -R --output "${FILE%\.$FORMAT}.xz" 
"${url%\.$FORMAT}.xz"; then
-        RECOMPRESS="$FORMAT"
-        FILE="${FILE%\.$FORMAT}.xz"
-      else
+      SUCCESS=0
+      for i in "" ".gz" ".bz2" ".xz"
+      do
+        if [ -n "$i" ];then
+         OF="${FILE%\.$FORMAT}$i"
+         URL="${url%\.$FORMAT}$i"
+         FMT=$FORMAT
+       else
+          OF=$FILE
+          URL=$url
+         FMT=
+       fi
+        HTTP_CODE=$("${CURL[@]}" -R --output "$OF" "$URL" --write-out 
"%{http_code}")
+       if [[ ${HTTP_CODE} -ge 200 && ${HTTP_CODE} -lt 299 ]] ; then
+         SUCCESS=1
+         FILE=$OF
+         RECOMPRESS="$FMT"
+         break
+       else
+         rm -f $OF
+       fi
+      done
+      if [ "$SUCCESS" -lt 1 ]; then
         echo "ERROR: Failed to download $url or any other compression format"
         exit 1
       fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-service-download_files-0.7.2/t/000_base.t 
new/obs-service-download_files-0.9.1/t/000_base.t
--- old/obs-service-download_files-0.7.2/t/000_base.t   2021-04-27 
14:29:49.000000000 +0200
+++ new/obs-service-download_files-0.9.1/t/000_base.t   2021-10-14 
13:14:24.000000000 +0200
@@ -3,63 +3,14 @@
 use warnings;
 use FindBin;
 use Cwd;
-
 use Path::Class qw/dir/;
-use Test::More tests => 5;
-
-{
-package MyWebServer;
-use strict;
-use warnings;
-
-use HTTP::Server::Simple::CGI;
-use Path::Class qw/file/;
-use base qw(HTTP::Server::Simple::CGI);
-use File::Type;
-
-my $document_root = $FindBin::Bin;
-
-my %dispatch = (
-);
-
-sub handle_request {
-   my $self = shift;
-   my $cgi  = shift;
-
-   my $path = $cgi->path_info();
-   my $handler = $dispatch{$path};
-
-   my $file = file($document_root,$path);
-
-   if (ref($handler) eq "CODE") {
-       print "HTTP/1.0 200 OK\r\n";
-       $handler->($path);
-   } elsif ( -f $file->stringify ) {
-       print "HTTP/1.0 200 OK\r\n";
-       file_handler($file);
-   } else {
-       print "HTTP/1.0 404 Not found\r\n";
-       print $cgi->header,
-             $cgi->start_html('Not found'),
-             $cgi->h1('Not found'),
-             $cgi->end_html;
-   }
-}
-
-sub file_handler {
-  my $f   = shift;
+use Test::More tests => 6;
 
-  my $fc  = $f->slurp();
-  my $l   = length($fc);
-  my $ct  = File::Type->new()->checktype_filename($f);
-
-  print "Content-Type: $ct\r\n";
-  print "Content-Length: $l\r\n\r\n";
-  print $fc;
+BEGIN {
+  unshift @::INC, "$FindBin::Bin/lib";
+};
 
-}
-
-}
+use MyHttpServer;
 
 my $dir     = getcwd();
 my $outdir  = dir($FindBin::Bin,"tmp");
@@ -74,21 +25,19 @@
   local *STDOUT;
   my $out="";
   open(STDOUT,'>',\$out);
-  $pid = MyWebServer->new(8080)->background();
+  $pid = MyHTTPServer->new(8080)->background();
 }
 
-
-
 # Checking command
 my $cmd="../download_files --outdir ".$outdir->stringify." --recompress yes";
-`$cmd`;
+my $out=`$cmd`;
 ok($? == 0,"Checking download with recompression");
+ok((-f $outdir->stringify."/Test-Simple-1.001014.tar.bz2"), "Checking 
downloaded file exists"); 
 
 # Checking file content
-my $tar = "tar tvjf ".$outdir->stringify."/Test-Simple-1.001014.tar.bz2";
+my $tar = "tar tf ".$outdir->stringify."/Test-Simple-1.001014.tar.bz2";
 `$tar`;
-ok($? == 0,"Checking extraction");
-
+ok($? == 0,"Checking extraction $tar");
 ok((-f $outdir->stringify."/patch1.diff"),"Checking patch1");
 ok((-f $outdir->stringify."/patch2.diff"),"Checking patch2");
 
@@ -99,7 +48,7 @@
 # cleanup
 $outdir->rmtree;
 kill 15, $pid;
-
+waitpid $pid, 0;
 chdir $dir;
 
 exit 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-download_files-0.7.2/t/lib/MyHttpServer.pm 
new/obs-service-download_files-0.9.1/t/lib/MyHttpServer.pm
--- old/obs-service-download_files-0.7.2/t/lib/MyHttpServer.pm  1970-01-01 
01:00:00.000000000 +0100
+++ new/obs-service-download_files-0.9.1/t/lib/MyHttpServer.pm  2021-10-14 
13:14:24.000000000 +0200
@@ -0,0 +1,50 @@
+package MyHTTPServer;
+use strict;
+use warnings;
+
+use HTTP::Server::Simple::CGI;
+use Path::Class qw/file/;
+use base qw(HTTP::Server::Simple::CGI);
+use File::Type;
+
+my $document_root = "$FindBin::Bin";
+
+my %dispatch = ();
+
+sub handle_request {
+   my $self = shift;
+   my $cgi  = shift;
+
+   my $path = $cgi->path_info();
+   my $handler = $dispatch{$path};
+   my $file = file($document_root,$path);
+
+   if (ref($handler) eq "CODE") {
+       print "HTTP/1.0 200 OK\r\n";
+       $handler->($path);
+   } elsif ( -f $file->stringify ) {
+       print "HTTP/1.0 200 OK\r\n";
+       file_handler($file);
+   } else {
+       print "HTTP/1.0 404 Not found\r\n";
+       print $cgi->header,
+             $cgi->start_html('Not found'),
+             $cgi->h1('Not found'),
+             $cgi->end_html;
+   }
+}
+
+sub file_handler {
+  my $f   = shift;
+
+  my $fc  = $f->slurp();
+  my $l   = length($fc);
+  my $ct  = File::Type->new()->checktype_filename($f);
+
+  print "Content-Type: $ct\r\n";
+  print "Content-Length: $l\r\n\r\n";
+  print $fc;
+
+}
+
+1;

Reply via email to