Debian Bug report logs - #21236
[DPKG-SOURCE][TRIVIAL] dpkg-source wipes out a .orig dir if it exists.

version graph

Package: dpkg-dev; Maintainer for dpkg-dev is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg-dev is src:dpkg (PTS, buildd, popcon).

Reported by: Santiago Vila <sanvila@unex.es>

Date: Thu, 16 Apr 1998 18:33:04 UTC

Severity: normal

Tags: patch

Found in version 1.4.0.22

Fixed in version dpkg/1.13.9

Done: Scott James Remnant <scott@netsplit.com>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Klee Dienes and Ian Jackson <dpkg-maint@chiark.greenend.org.uk>:
Bug#21236; Package dpkg-dev. (full text, mbox, link).


Acknowledgement sent to Santiago Vila <sanvila@unex.es>:
New bug report received and forwarded. Copy sent to Klee Dienes and Ian Jackson <dpkg-maint@chiark.greenend.org.uk>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Santiago Vila <sanvila@unex.es>
To: Debian Bugs <submit@bugs.debian.org>
Subject: dpkg-source wipes out a .orig dir if it exists.
Date: Thu, 16 Apr 1998 20:28:01 +0200 (CEST)
Package: dpkg-dev
Version: 1.4.0.22

My intention was to extract a source, mv the DIR to DIR.orig, extract
the source again, make some modifications inside DIR and then do a recursive
diff from DIR.orig to DIR by hand.

Well, dpkg-source did not let me to do that.

I dowloaded the source of gzip (as an example) and I did the following:

$ dpkg-source -x gzip_1.2.4-26.dsc
dpkg-source: extracting gzip in gzip-1.2.4
$ mv gzip-1.2.4 gzip-1.2.4.orig
$ dpkg-source -x gzip-1.2.4
dpkg-source: extracting gzip in gzip-1.2.4

At this point, the gzip-1.2.4.orig directory dissapeared.
This should not have happened, or there should be an option
to override it, since dpkg-source obviously can do its things
in whatever temporary directory to extract the sources properly.

Thanks.



Changed Bug title. Request was from Adam Heath <doogie@brainfood.com> to control@bugs.debian.org. (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#21236; Package dpkg-dev. (full text, mbox, link).


Acknowledgement sent to Matt Kraai <kraai@alumni.cmu.edu>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. (full text, mbox, link).


Message #12 received at 21236@bugs.debian.org (full text, mbox, reply):

From: Matt Kraai <kraai@alumni.cmu.edu>
To: 21236@bugs.debian.org, control@bugs.debian.org
Subject: tag 21236 patch: preserve .orig directory
Date: Tue, 16 Sep 2003 01:00:31 -0700
tag 21236 patch
thanks

The following patch moves the .orig out of the way while
extracting a source package, and restores it once the process is
complete.  I've tested it with native and non-native source
packages, and with existing and missing .orig directories.

diff -ur dpkg-1.10.10~/scripts/dpkg-source.pl dpkg-1.10.10/scripts/dpkg-source.pl
--- dpkg-1.10.10~/scripts/dpkg-source.pl	2003-09-16 00:34:17.000000000 -0700
+++ dpkg-1.10.10/scripts/dpkg-source.pl	2003-09-16 00:57:35.000000000 -0700
@@ -620,7 +620,10 @@
         || &syserr("write extracting message");
     
     &erasedir($newdirectory);
-    &erasedir("$newdirectory.orig");
+    ! -e "$newdirectory.orig"
+	|| rename("$newdirectory.orig","$newdirectory.orig.tmp-old")
+	|| &syserr("unable to rename \`$newdirectory.orig' "
+		   ."to \`$newdirectory.orig.tmp-old'");
 
     mkdir("$expectprefix.tmp-nest",0755)
 	|| &syserr("unable to create \`$expectprefix.tmp-nest'");
@@ -739,6 +742,10 @@
             &syserr(sprintf("cannot change mode of \`%s' to 0%o from 0%o",
                             $fn,$newmode,$mode));
     }
+    ! -e "$newdirectory.orig.tmp-old"
+	|| rename("$newdirectory.orig.tmp-old","$newdirectory.orig")
+	|| &syserr("unable to rename \`$newdirectory.orig.tmp-old' "
+		   ."to \`$newdirectory.orig'");
     exit(0);
 }
 

-- 
Matt



Tags added: patch Request was from Matt Kraai <kraai@alumni.cmu.edu> to control@bugs.debian.org. (full text, mbox, link).


Changed Bug title. Request was from Scott James Remnant <scott@netsplit.com> to control@bugs.debian.org. (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#21236; Package dpkg-dev. (full text, mbox, link).


Acknowledgement sent to Mike Hommey <mh@glandium.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. (full text, mbox, link).


Message #21 received at 21236@bugs.debian.org (full text, mbox, reply):

From: Mike Hommey <mh@glandium.org>
To: 21236@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Upgrading severity
Date: Mon, 25 Oct 2004 20:36:50 +0900
severity 21236 grave
thanks

Justification for severity upgrade: creates data loss.
I ran into this bug twice in one or two months, that is more than I can
bear. Yes I happen to have .orig directories containing stuff (often the
previous debian release to make a patch to sent to the BTS). Yes, I
should have used something else than .orig, especially since i knew the
bug, since I got it once and saw this report, but I'm also stupid, I
happen to forget bugs, especially when they were already reported.

Please fix it. If you find the already provided patch not satisfactory,
I can provide one with usage of mktemp or whatever else you might find
more suitable to fix the issue.

Thanks in advance,

Mike



Severity set to `grave'. Request was from Mike Hommey <mh@glandium.org> to control@bugs.debian.org. (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#21236; Package dpkg-dev. (full text, mbox, link).


Acknowledgement sent to Scott James Remnant <scott@netsplit.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. (full text, mbox, link).


Message #28 received at 21236@bugs.debian.org (full text, mbox, reply):

From: Scott James Remnant <scott@netsplit.com>
To: Mike Hommey <mh@glandium.org>, 21236@bugs.debian.org
Subject: Re: Bug#21236: Upgrading severity
Date: Mon, 25 Oct 2004 13:13:33 +0100
[Message part 1 (text/plain, inline)]
severity 21236 normal
thanks

On Mon, 2004-10-25 at 20:36 +0900, Mike Hommey wrote:

> Justification for severity upgrade: creates data loss.
> 
I don't believe this "surprisingly" causes data loss, and I don't agree
with this justification.

I'm downgrading this bug, please don't put it back up again -- you'll
just irritate me into not fixing it.  There's absolutely no way this fix
would be accepted into sarge anyway, so randomly increasing it to a
release critical bug because you forgot about a gotcha with dpkg-source
isn't going to help anyone.

> Please fix it. If you find the already provided patch not satisfactory,
> I can provide one with usage of mktemp or whatever else you might find
> more suitable to fix the issue.
> 
It will be fixed once the freeze is over, it's been triaged and the
patch looks reasonable.

Scott
-- 
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?
[signature.asc (application/pgp-signature, inline)]

Severity set to `normal'. Request was from Scott James Remnant <scott@netsplit.com> to control@bugs.debian.org. (full text, mbox, link).


Tags added: pending Request was from Scott James Remnant <scott@netsplit.com> to control@bugs.debian.org. (full text, mbox, link).


Reply sent to Scott James Remnant <scott@netsplit.com>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Santiago Vila <sanvila@unex.es>:
Bug acknowledged by developer. (full text, mbox, link).


Message #37 received at 21236-close@bugs.debian.org (full text, mbox, reply):

From: Scott James Remnant <scott@netsplit.com>
To: 21236-close@bugs.debian.org
Subject: Bug#21236: fixed in dpkg 1.13.9
Date: Sun, 12 Jun 2005 12:02:22 -0400
Source: dpkg
Source-Version: 1.13.9

We believe that the bug you reported is fixed in the latest version of
dpkg, which is due to be installed in the Debian FTP archive:

dpkg-dev_1.13.9_all.deb
  to pool/main/d/dpkg/dpkg-dev_1.13.9_all.deb
dpkg_1.13.9.dsc
  to pool/main/d/dpkg/dpkg_1.13.9.dsc
dpkg_1.13.9.tar.gz
  to pool/main/d/dpkg/dpkg_1.13.9.tar.gz
dpkg_1.13.9_i386.deb
  to pool/main/d/dpkg/dpkg_1.13.9_i386.deb
dselect_1.13.9_i386.deb
  to pool/main/d/dpkg/dselect_1.13.9_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 21236@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Scott James Remnant <scott@netsplit.com> (supplier of updated dpkg package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sun, 12 Jun 2005 15:52:43 +0100
Source: dpkg
Binary: dpkg dselect dpkg-dev
Architecture: source i386 all
Version: 1.13.9
Distribution: unstable
Urgency: low
Maintainer: Scott James Remnant <scott@netsplit.com>
Changed-By: Scott James Remnant <scott@netsplit.com>
Description: 
 dpkg       - Package maintenance system for Debian
 dpkg-dev   - Package building tools for Debian
 dselect    - a user tool to manage Debian packages
Closes: 21236 156317 193653 246802 249496 282323 304297 307139
Changes: 
 dpkg (1.13.9) unstable; urgency=low
 .
   The "On like Donkey Kong" Release.
 .
   * Only open the log file when we first need to write to it, this avoids
     the need to suppress errors when not root which fakeroot defeated anyway.
   * Stop dpkg-source clobbering an existing .orig directory during unpacking.
     Closes: #21236.
   * Allow an alternate output directory to be specified to dpkg-source by
     giving a second argument to -x.  Closes: #246802, #282323.
   * Added .arch-inventory to default diff ignore regexp.  Closes: #304297.
 .
   SELinux support (Manoj Srivastava):
   * On SELinux-enabled systems, try to set the security context when the
     package is unpacked.  Closes: #193653, #249496, #307139.
   * Added build-dependancy on libselinux1-dev.
 .
   Improvements to dpkg-source (Brendan O'Dea):
   * Support unpacking of "Wig And Pen" (Format 2.0) source packages.
   * Multiple pristine upstream tarballs allowed.
   * Native and upstream tarballs may be bzip2-compressed instead of gzip,
     as may the debian diff or tarball.
   * Unsupported format error fixed to output the unsupported format
     rather than the supported one.  Closes: #156317.
Files: 
 3de37042afe8c16293e23402936dba18 622 base required dpkg_1.13.9.dsc
 11351b33bcd380f849e3ce1e24b1ce2e 3557423 base required dpkg_1.13.9.tar.gz
 7c534ffbcdb85a133f33cfc5f60332e3 1781280 base required dpkg_1.13.9_i386.deb
 88135455172d9144ca78cdd06784cd1a 120494 base required dselect_1.13.9_i386.deb
 2450a224892ab56d6d9a9c19f10e7650 162762 utils standard dpkg-dev_1.13.9_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCrFjDIexP3IStZ2wRAkmIAJ0RPWcgEXgPIVo/qxUdkvIg4XT95QCgq5HA
6knfxRHT+I65fJDZ57H35rs=
=2sT8
-----END PGP SIGNATURE-----




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 25 16:47:37 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.