Bug 979378 - Upgrade problem from dpkg* < 1.16 to dpkg* >= 1.16
Upgrade problem from dpkg* < 1.16 to dpkg* >= 1.16
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dpkg (Show other bugs)
18
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Andrew Colin Kissa
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-28 07:19 EDT by Oron Peled
Modified: 2013-07-15 21:51 EDT (History)
3 users (show)

See Also:
Fixed In Version: dpkg-1.16.10-6.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-15 21:50:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to .spec file for fixing dpkg upgrade from <= 1.15 to >= 1.16 (3.20 KB, patch)
2013-06-28 17:22 EDT, Oron Peled
no flags Details | Diff
This move dpkg-buildflags and dpkg-mergechangelogs form dpkg to dpkg-dev (3.52 KB, patch)
2013-06-29 13:22 EDT, Oron Peled
no flags Details | Diff
remove multiple ownership of some manual pages (2.27 KB, patch)
2013-06-29 13:24 EDT, Oron Peled
no flags Details | Diff
move dpkg.cfg from /etc to /etc/dpkg (2.12 KB, patch)
2013-06-29 14:38 EDT, Oron Peled
no flags Details | Diff
fix some pkgdatadir, pkgconfdir file locations (2.70 KB, patch)
2013-06-29 14:42 EDT, Oron Peled
no flags Details | Diff
move "dpkg-dev.mo" files to dpkg-perl (1.05 KB, patch)
2013-06-29 15:04 EDT, Oron Peled
no flags Details | Diff
minor fix to dpkg-perl ownerships (2.51 KB, patch)
2013-06-29 15:14 EDT, Oron Peled
no flags Details | Diff
add patched /etc/logrotate.d/dpkg (2.45 KB, patch)
2013-06-30 03:54 EDT, Oron Peled
no flags Details | Diff
cleanup spec: s/$RPM_BUILD_ROOT/%{buildroot}/g (2.47 KB, patch)
2013-06-30 03:58 EDT, Oron Peled
no flags Details | Diff
added some new %doc and debian/copyright (1.19 KB, patch)
2013-06-30 03:59 EDT, Oron Peled
no flags Details | Diff
minor rpmlint cleanups (1.06 KB, patch)
2013-06-30 04:00 EDT, Oron Peled
no flags Details | Diff

  None (edit)
Description Oron Peled 2013-06-28 07:19:25 EDT
Steps to Reproduce (f18):
1. Install dpkg-devel.noarch (1.15*)
2. Try to install dpkg-dev (1.16*)

Actual results:

Yum/dnf check transaction, and RPM fails with conflicting files

Expected results:
1. dpkg-dev pulls dpkg-perl
2. dpkg-devel.noarch removed
3. If dpkg < 1.15 is present, it is upgraded to dpkg >= 1.16*

Additional info:
* Prepared and tested updated spec.
    SPEC URL: http://oron.fedorapeople.org/deb-package/dpkg.spec
* The .spec changes are commented and with description in %changelog
* Although the primary fix is for f18, I think its important to fix on all releases (e.g: it may fail people who try to upgrade f18 -> f19, etc.)
Comment 1 Oron Peled 2013-06-28 07:24:24 EDT
An irritating technicality:
 * There's no "version-not-equal" relation in dependencies.
 * So I "emulated" this with two "foo < version" and "foo > version" relations.
 * Any problems with this? (aside from aesthetics)
Comment 2 Oron Peled 2013-06-28 07:47:43 EDT
Re-tested the failure in different scenario:
 * Prepared test with dpkg-devel.noarch (<= 1.15*) installed
   - Which pulls dpkg (<= 1.15*)

 * Then "dnf update":
   - Pulls new dpkg-devel.<ARCH> as an update (interesting...)
   - Upgrade OK
   - Of course it doesn't know new dpkg-devel.<ARCH> is completely
     different from old dpkg-devel.noarch, but it's harmless for now.

 * Then try to "dnf install dh-make" (new one 0.61-1.fc18):
   - Pulls new dpkg-dev (1.16.10-4.fc18).
   - Which pulls new dpkg-perl.
   - Which fails because the following two files belong to old (<= 1.15*) dpkg:
        /usr/share/perl5/vendor_perl/Dpkg.pm
        /usr/share/perl5/vendor_perl/Dpkg/Gettext.pm

So passing through intermediate upgrade to dpkg-devel=1.16.10-4.fc18
solve some of the problems (dpkg-dev conflict with old dpkg-devel),
but not all -- there's still a conflict of dpkg-perl with old dpkg.
Comment 3 Sergio Monteiro Basto 2013-06-28 10:39:30 EDT
Hi, give us the diff of the spec , to analyze please
Comment 4 Oron Peled 2013-06-28 17:22:34 EDT
Created attachment 766737 [details]
Patch to .spec file for fixing dpkg upgrade from <= 1.15 to >= 1.16
Comment 5 Sergio Monteiro Basto 2013-06-28 21:48:44 EDT
+# Obsolete the old dpkg-devel.noarch (replaced by dpkg-dev)
+Obsoletes: dpkg-devel < 1.16

this one, ok !

>> - Which pulls new dpkg-perl. 
and fails because conflicts with old dpkg 
So dpkg-perl needs also Obsoletes dpkg < 1.16 
or even better 

I Drop Requirement dpkg of dpkg-perl (seems to me correct at the time ...) 
but that requirement solve this situation, so what do you think ?
 
dpkg-perl requires dpkg = %{version}-%{release}

instead 
+# We don't depend on dpkg, but we don't allow different version of it
+Conflicts: dpkg < %{version}-%{release}
+Conflicts: dpkg > %{version}-%{release}
+# We don't depend on dpkg-devel, but we don't allow different version of it
+Conflicts: dpkg-devel < %{version}-%{release}
+Conflicts: dpkg-devel > %{version}-%{release}
Comment 6 Oron Peled 2013-06-29 12:57:58 EDT
I've started looking deeper at the dependency relationships
and decided I'll compare a bit more the Debian/Fedora packages.

Here are some preliminary findings:
* Should be moved from dpkg to dpkg-dev:
  - dpkg-mergechangelogs and its man-pages
  - dpkg-buildflags and its man-pages

* /etc/dpkg.cfg should be in /etc/dpkg/dpkg.cfg

* There is a bunch of man pages owned both by dpkg and dpkg-dev
  (in many languages):
        dpkg-architecture.1.gz
        dpkg-buildflags.1.gz
        dpkg-buildpackage.1.gz
        dpkg-checkbuilddeps.1.gz
        dpkg-distaddfile.1.gz
        dpkg-genchanges.1.gz
        dpkg-gencontrol.1.gz
        dpkg-gensymbols.1.gz
        dpkg-mergechangelogs.1.gz
        dpkg-name.1.gz
        dpkg-parsechangelog.1.gz
        dpkg-scanpackages.1.gz
        dpkg-scansources.1.gz
        dpkg-shlibdeps.1.gz
        dpkg-source.1.gz
        dpkg-vendor.1.gz

* The dpkg-dev.mo translation files:
  - For some unknown reason, Debian maintain them in libdpkg-perl
  - In Fedora we assigned them to dpkg-dev
  - Although our assignment look more logical, this affect package dependencies.
  - As an example /usr/libexec/dpkg/parsechangelog/debian calls
    textdomain("dpkg-dev"). In Debian, both belog to libdpkg-perl.
    In Fedora, the files are in two separate packages.

This is for now. Later, I'll try to send patches for some of these problems.
Comment 7 Sergio Monteiro Basto 2013-06-29 13:12:33 EDT
(In reply to Oron Peled from comment #6)
> I've started looking deeper at the dependency relationships
> and decided I'll compare a bit more the Debian/Fedora packages.
> 
> Here are some preliminary findings:
> * Should be moved from dpkg to dpkg-dev:
>   - dpkg-mergechangelogs and its man-pages
>   - dpkg-buildflags and its man-pages

no problem I will do it right now ,

> 
> * /etc/dpkg.cfg should be in /etc/dpkg/dpkg.cfg

hum ok, see it later 
 
> * There is a bunch of man pages owned both by dpkg and dpkg-dev
>   (in many languages):
>         dpkg-architecture.1.gz
>         dpkg-buildflags.1.gz
>         dpkg-buildpackage.1.gz
>         dpkg-checkbuilddeps.1.gz
>         dpkg-distaddfile.1.gz
>         dpkg-genchanges.1.gz
>         dpkg-gencontrol.1.gz
>         dpkg-gensymbols.1.gz
>         dpkg-mergechangelogs.1.gz
>         dpkg-name.1.gz
>         dpkg-parsechangelog.1.gz
>         dpkg-scanpackages.1.gz
>         dpkg-scansources.1.gz
>         dpkg-shlibdeps.1.gz
>         dpkg-source.1.gz
>         dpkg-vendor.1.gz
> 

this is obvious bug in spec 

grep dpkg-architecture dpkg.spec 
%{_mandir}/man1/dpkg-architecture.1.gz
%{_mandir}/*/man1/dpkg-architecture.1.gz
%{_bindir}/dpkg-architecture
%{_mandir}/man1/dpkg-architecture.1.gz
%{_mandir}/*/man1/dpkg-architecture.1.gz

man are duplicated , and should be just in correspondent  package , I will commit the fix right now in master.
Comment 8 Oron Peled 2013-06-29 13:22:52 EDT
Created attachment 766926 [details]
This move dpkg-buildflags and dpkg-mergechangelogs form dpkg to dpkg-dev

* Move binaries and their man-pages from dpkg to dpkg-dev
Comment 9 Oron Peled 2013-06-29 13:24:10 EDT
Created attachment 766927 [details]
remove multiple ownership of some manual pages

* These all belong to dpkg-dev. So remove them from dpkg
Comment 11 Oron Peled 2013-06-29 14:38:25 EDT
Created attachment 766929 [details]
move dpkg.cfg from /etc to /etc/dpkg

Looking at upstream code -- all configuration files are under /etc/dpkg:
 * In lib/dpkg/options.c (line 197):
       m_asprintf(&file, "%s/%s.cfg", CONFIGDIR, prog);
 * The CONFIGDIR is passed from Makefile.am:
       -DCONFIGDIR=\"$(pkgconfdir)\"
 * In Makefile.am pkgconfdir is set:
       pkgconfdir = $(sysconfdir)/@PACKAGE@
Comment 12 Oron Peled 2013-06-29 14:42:46 EDT
Created attachment 766930 [details]
fix some pkgdatadir, pkgconfdir file locations

* Define pkgdatadir for consistency (just like upstream name in Makefile.am)
* Added missing shlibs.{default,override} (from debian/dpkg-dev.install)
* Move %{pkgdatadir}/abitable from dpkg-dev to dpkg (from debian/dpkg.install)
* Grab all %{pkgdatadir}/*.mk into dpkg-dev (from debian/dpkg-dev.install)
Comment 13 Oron Peled 2013-06-29 14:43:51 EDT
* Thanks for the quick update.
* Attached two more patches.
* If you have time now, we can continue this on IRC (#fedora-devel [oron])
Comment 14 Sergio Monteiro Basto 2013-06-29 14:57:34 EDT
(In reply to Oron Peled from comment #13)
> * If you have time now, we can continue this on IRC (#fedora-devel [oron])

Thanks , Now I going out, now , sorry .

what do you think ?  

about : dpkg-perl requires dpkg = %{version}-%{release} , 
instead 
+# We don't depend on dpkg, but we don't allow different version of it
+Conflicts: dpkg < %{version}-%{release}
+Conflicts: dpkg > %{version}-%{release}
+# We don't depend on dpkg-devel, but we don't allow different version of it
+Conflicts: dpkg-devel < %{version}-%{release}
+Conflicts: dpkg-devel > %{version}-%{release}

seems to me more clean .
Comment 15 Oron Peled 2013-06-29 15:04:09 EDT
Created attachment 766936 [details]
move "dpkg-dev.mo" files to dpkg-perl

* In upstream they also belong to libdpkg-perl and not dpkg-dev
* In dpkg-perl, they are used by /usr/libexec/dpkg/parsechangelog/debian:
        textdomain("dpkg-dev");
Comment 16 Oron Peled 2013-06-29 15:14:49 EDT
Created attachment 766937 [details]
minor fix to dpkg-perl ownerships

* Some directories were not owned (e.g: /usr/share/perl5/.../Dpkg/Compression)
* Use wildcards as in upstream debian/libdpkg-perl.install, so we don't
  have similar bugs in the future.
Comment 17 Oron Peled 2013-06-29 16:34:09 EDT
(In reply to Sergio from comment #14)

* I first wanted to make sure we have equivalent packages to Debian's
  (in terms of contained files). Otherwise, it's hard to compare dependencies.

* Checking now (after applying the patches in comment #15 and #16):
  - Upstream libdpkg-perl "Depends" on dpkg (specific version range)

  - Also, I've found specific perl modules that call dpkg commands:
    /usr/share/perl5/vendor_perl/Dpkg/Arch.pm run "dpkg --print-architecture"
    /usr/share/perl5/vendor_perl/Dpkg/Path.pm run "dpkg-query"
    /usr/share/perl5/vendor_perl/Dpkg/Source/Package.pm run "dpkg-source"

  - So not having "Requires: dpkg" for dpkg-perl was our mistake
    in the first place.

  - I also agree that we can have stricter version requirements than upstream.

  - So let's do what you suggested and add to dpkg-perl:
            Requires: dpkg = %{version}-%{release}

  - Since "dpkg-dev" already requires "dpkg-perl = %{version}-%{release},
    that means we don't need my first set of "Conflicts" (dpkg <> ...)
    Because dpkg-dev pulls same version of dpkg-perl and that will
    pull same version of dpkg.

* If you can review and commit:
  - First, my comment #15 and comment #16 (less conflicts for my git private
    branch).
  - Than your proposed "Requires:" for dpkg-perl
  - I'll re-sync and we can do final checks what to do with the other
    suggested Conflicts (dpkg-devel <> ...)
Comment 18 Sergio Monteiro Basto 2013-06-29 20:34:22 EDT
all 4 patches pushed more # Obsolete the old dpkg-devel.noarch (replaced by dpkg-dev) Obsoletes: dpkg-devel < 1.16
more add to dpkg-perl: Requires: dpkg = %{version}-%{release}

http://pkgs.fedoraproject.org/cgit/dpkg.git/patch/?id=6d0630eecf685c5fb9eb786ac48c0a10cc358ad3
Comment 19 Fedora Update System 2013-06-29 20:50:23 EDT
dpkg-1.16.10-5.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/dpkg-1.16.10-5.fc19
Comment 20 Fedora Update System 2013-06-29 21:07:11 EDT
dpkg-1.16.10-5.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/dpkg-1.16.10-5.fc18
Comment 21 Oron Peled 2013-06-30 03:54:59 EDT
Created attachment 766996 [details]
add patched /etc/logrotate.d/dpkg
Comment 22 Oron Peled 2013-06-30 03:58:31 EDT
Created attachment 766997 [details]
cleanup spec: s/$RPM_BUILD_ROOT/%{buildroot}/g

There was mixed use of $RPM_BUILD_ROOT and %{rpmbuild}
Comment 23 Oron Peled 2013-06-30 03:59:26 EDT
Created attachment 766998 [details]
added some new %doc and debian/copyright

* debian/copyright is up-to-date and include more info than old COPYING file
* Added other, missing docs
Comment 24 Oron Peled 2013-06-30 04:00:10 EDT
Created attachment 766999 [details]
minor rpmlint cleanups
Comment 25 Oron Peled 2013-06-30 04:07:15 EDT
(In reply to comment #19 and #20 -- bodhi updates)

* Oops, you are quick. I thought you'll just commit to git and we'll
  have a final round of cleanups before pushing to bodhi.

* Your version looks OK, but:
  - Maybe you want to push the last fixes before you push the new package.
    The logrotate may be important. (comments #21, #22, #23, #24)
  - If not, the fixes can wait in git for some other opportunity.
Comment 26 Sergio Monteiro Basto 2013-06-30 19:13:44 EDT
(In reply to Oron Peled from comment #25)
> (In reply to comment #19 and #20 -- bodhi updates)
> 
> * Oops, you are quick. I thought you'll just commit to git and we'll
>   have a final round of cleanups before pushing to bodhi.
> 
> * Your version looks OK, but:
>   - Maybe you want to push the last fixes before you push the new package.
>     The logrotate may be important. (comments #21, #22, #23, #24)
>   - If not, the fixes can wait in git for some other opportunity.

Hi, Thanks for the patches, I will include yours last 4 patches (all) , in git . Should I bump a release or we have more things to fix ?
Comment 27 Fedora Update System 2013-06-30 21:39:21 EDT
Package dpkg-1.16.10-5.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dpkg-1.16.10-5.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-11999/dpkg-1.16.10-5.fc18
then log in and leave karma (feedback).
Comment 28 Fedora Update System 2013-06-30 23:36:20 EDT
dpkg-1.16.10-6.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/dpkg-1.16.10-6.fc19
Comment 29 Fedora Update System 2013-06-30 23:47:21 EDT
dpkg-1.16.10-6.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/dpkg-1.16.10-6.fc18
Comment 30 Oron Peled 2013-07-01 03:02:10 EDT
Tested 1.16.10-6 (both f18 and f19) -- all well.
Comment 31 Fedora Update System 2013-07-15 21:50:02 EDT
dpkg-1.16.10-6.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 32 Fedora Update System 2013-07-15 21:51:45 EDT
dpkg-1.16.10-6.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.