Package: dpkg-dev
Version: 1.13.11
Severity: normal
File: /usr/bin/dpkg-source
Tags: patch

Hi,

I recently had an upload rejected with the following:

Rejected: 'dpkg-source -x' failed for rpm_4.4.1-5.dsc [return code: 2304].
 [dpkg-source output:] dpkg-source: error: expected ^--- in line 1 of diff

It turns out that I had run 'diff -p' and that that places commentry
after each hunk identifier. For example:

@@ -1142,7 +1142,7 @@ static void genCpioListAndHeader(/[EMAIL PROTECTED]

     sxfn = rpmGetPath("%{?_build_file_context_path}", NULL);
     if (sxfn != NULL && *sxfn != '\0')
-       sx = rpmsxNew(sxfn);
+       matchpathcon_init(sxfn);

     for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) {
        const char *s;

Attached is a patch to dpkg-source that allows it to ignore the commentry
(it is helpful in large files, patch can make use of them -- as well as
humans to better determine where the hunk should apply) and allow
dpkg-source to work in this situation.

--- /usr/bin/dpkg-source        2005-08-17 13:56:02.000000000 +1000
+++ /home/anand/bin/dpkg-source 2005-12-27 19:21:10.000000000 +1100
@@ -1083,7 +1083,7 @@
            # read hunk header (@@)
            s/\n$// or &error("diff `$diff' is missing trailing
newline");
            next if /^\\ No newline/;
-           /^@@ -\d+(,(\d+))? \+\d+(,(\d+))? @[EMAIL PROTECTED]/ or
+           /^@@ -\d+(,(\d+))? \+\d+(,(\d+))? @[EMAIL PROTECTED]/ or
                &error("Expected [EMAIL PROTECTED]@ in line $. of diff 
`$diff'");
            my ($olines, $nlines) = ($1 ? $2 : 1, $3 ? $4 : 1);
            ++$hunk;

Thanks,
Anand

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (650, 'testing'), (600, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-rc3
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)

Versions of packages dpkg-dev depends on:
ii  binutils             2.16.1cvs20051117-1 The GNU assembler, linker and bina
ii  cpio                 2.6-9               GNU cpio -- a program to manage ar
ii  dpkg                 1.13.11.0.1         package maintenance system for Deb
ii  make                 3.80-11             The GNU version of the "make" util
ii  patch                2.5.9-2             Apply a diff file to an original
ii  perl [perl5]         5.8.7-9             Larry Wall's Practical Extraction 
ii  perl-modules         5.8.7-9             Core Perl modules

Versions of packages dpkg-dev recommends:
ii  bzip2                         1.0.2-11   high-quality block-sorting file co
ii  gcc [c-compiler]              4:4.0.2-2  The GNU C compiler
ii  gcc-3.3 [c-compiler]          1:3.3.6-10 The GNU C compiler
ii  gcc-3.4 [c-compiler]          3.4.5-1    The GNU C compiler
ii  gcc-4.0 [c-compiler]          4.0.2-5    The GNU C compiler

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to