The branch, dpkg-shlibdeps-buxy has been updated
       via  8584f930e4085af71cb0b2bfddfde912c35176ac (commit)
       via  cff7c6ef26150d2c215eaef5ce52d9d75dd4ceb9 (commit)
       via  ba56d637aa7c4792c477bae452cbecb3211a8a7c (commit)
       via  eee7d3c8a14bc91f8b9b426f5b519b4ca1c3b40e (commit)
       via  85637101b5df1ce82c845f55949c7ba607763716 (commit)
       via  ca39b2a4cc4b32422453d27030ab86930f51cd4d (commit)
       via  a7e7e93cdd9c0b3f76a70ff5e36466de6ccd24bc (commit)
       via  e198bcd50eb4f58db87b652810e1ef598bc8cabf (commit)
       via  0638079f21df8b999d8d970e2ac1d13437ab458f (commit)
       via  9fd3cf39315b929aedeb40aa459fd00e7aaf0893 (commit)
       via  dc69e6c35cda3b9b58c8faf880b69967ac7b8eb4 (commit)
       via  826db4452b743ddf206662dc17cec5f097836933 (commit)
       via  07d95556ecc863d969e4c9ac09d398c55c37b082 (commit)
       via  fff26432579324a49d2b3b4c5db6f9e90317c409 (commit)
       via  ca909d6711804e51f48415d31aa2fc630943cd03 (commit)
       via  840db1577ff84427dd18abf1a90e2c713956fa43 (commit)
       via  498c0ce2988af4d3732d51870717dd811c522d08 (commit)
       via  2f19acb3b8c48c4d55073c017bfe7cc1843ee14f (commit)
       via  995ba1937f883be2a45e56974d18409ba647bf5b (commit)
       via  317b4f1dcc46fc145ad651c1566e39422e716d9a (commit)
       via  f063c7ce5025c086ddfc35950e1b8f5a3b2b32a7 (commit)
       via  f2ce3447b10ef91b5688483421ccb5f5cb0e45fa (commit)
       via  c258829c1fc114a86707b7f5f24b94e559fe1efa (commit)
       via  7fd5b6d604ae9b50a340664f702e85cd235ff561 (commit)
       via  577eba0c5b1ba169562a97f8f57b80d5947021f0 (commit)
       via  099bff47424099f00cb22e9b419a37513b72510c (commit)
       via  a6357b5e46db94ed75a35b606764576e7a22aca7 (commit)
       via  1cb3e24dc2073a5987a2d8e302cd9c4e2a2e527b (commit)
       via  e1b3b73d0960704da3b3250f05c8d8d9541a68c5 (commit)
       via  23193925a813a86014d5fee11c4b99fa2887d305 (commit)
       via  227ecffffa426bdb71004003ca1ff51b73afd984 (commit)
       via  3f0020be7eac8357f5ce53f978b63f1fd4181be2 (commit)
       via  25b4639cae981a221b70bb601ecbc6dde4529cfb (commit)
       via  b10d66f07b63c7d151817b62cc0b5a429fc644d6 (commit)
       via  f0ea9fec991a03dcd99e6562e6cce8430b1ff5d8 (commit)
       via  f4c126adf8a8058a977e3a4b4cf9f9aaf714e53b (commit)
       via  c5d3a32688c7506862d3c9da8fc4489001f10cf9 (commit)
       via  d550c7c26f09ab834ebc26eb752e5ecc32349b68 (commit)
       via  a36a1c4cb58522165b6aee5e3b40dd8b9ba753b0 (commit)
       via  faf1411ff0462855ea26ee90bce16264fd8be418 (commit)
       via  742ee18220519f4f0554a0041098e1f1010ebef5 (commit)
       via  da24c2f7431a3449b17f906212d4ef99a83653b0 (commit)
       via  21bde772d050711d5c8a3b63ede91771e9eeaefd (commit)
       via  a8b1d3898ac92128138d3bc77c1ed310925367b4 (commit)
       via  1ff00e53dfbd8681c8586d7349ccc5a94d78280f (commit)
       via  54bcd093c6c209694ed5193ecd485a397ea1fdfc (commit)
       via  db7a614d140e8c54f994dc2023f6b10ce38ba9c4 (commit)
       via  d8ce44bf7cee58d66601b23f782af0eac8f062ac (commit)
       via  d9fa5a8a2bedbccd5c3d976a27ba550b2bcfa20d (commit)
       via  bf730717d937d8f2a43220768d6b390c4e0155ec (commit)
       via  7e94efde1ea7789c06ae4de0b1a9a0193decf2f9 (commit)
       via  4b786e829f07cde1346e6c6d6ecab8388ab765b1 (commit)
       via  2b1f89602b1286be40cb584b5911fafe4fe20888 (commit)
       via  8327948db994a300f75ed1b2c33823fc5c24ccf0 (commit)
       via  e7263176af2bf1fd8f09784cd50fffdd8368515d (commit)
       via  765a0ada5eca247694e1ceb196b6467c71490833 (commit)
       via  4c14545bd0b45309a4c95833b93a03c4b949253f (commit)
       via  a3883b2558a5435b6e9a372f0fc1ce8308e7aeb6 (commit)
       via  0aff794d30f17540a76c6b231e783cf2180fe9ef (commit)
       via  9196af928cf0e41c734e1fd8116418ae4184e045 (commit)
       via  dad76d89187e8084c175809ca83c3cc331f77418 (commit)
       via  04171475eb48bca0361348ab44d9d3c3ba6bb1b2 (commit)
       via  4e640e72f23e91d95d067c7c21b9c3452356cdae (commit)
       via  47a32499a47ee38dd0fbae6924dc09b0c5021e08 (commit)
       via  fd7fb7a4bcd1869000d6968b9b76907f82d15a24 (commit)
       via  f836cd4fe6925a990347766d78653859ca7f9d00 (commit)
       via  608a665319ae00ea6ebf9737d3064c2ad7e337ff (commit)
       via  9482bd74a984a1e3798558cd7326ba073279d5e9 (commit)
       via  81b142ec721849dbb087f86139c81c6f6ff0252e (commit)
       via  db992d8325dd60f99e6df8f9621496f36e33caec (commit)
       via  100797ea7b93078fa9c6fd4e2f2ac8249d4dcfda (commit)
       via  06cd68c9e7769e331b019e23e334912ff67017c3 (commit)
       via  bff40a52e3efa6f47e9217ab435055edd2cff503 (commit)
       via  b4e29ae7627f9d32174d1fa3541df05f00d7de34 (commit)
       via  411db7ad741a17d42316e1c9d1d31cad99eb6123 (commit)
       via  6b141855beaaab94be0e0095ca17fd6e8cf93c4e (commit)
       via  0f30749238d3c4872dfb747f7727db522cb55ab7 (commit)
       via  bda692a3d5387cf14cc3c75c7ed9f20fa8e7c085 (commit)
       via  3269c079e51ca1fd1bd08becf51f56b6adeb1f80 (commit)
       via  aa3fa50d22dcca22e61d511ac7305f55dd3cc3f3 (commit)
       via  161985a220fdca1bc5328b359a4db128f4205756 (commit)
       via  3ff4c4e7f98e784b9c8d9eaad501dafbabdea563 (commit)
       via  0fafaf6a2f43c487167a9bfa3f7abc55dcde582c (commit)
       via  89da651919808b9a732de7dc692f0eca8f14fc01 (commit)
       via  4e5846ccd3dcc33504aba8ef35a8962bccfd562e (commit)
       via  864201bea42d2d1d2c284e63800f8cb7ac2841fb (commit)
       via  85849a460dbedc4e9464725c7d317bedc76049df (commit)
       via  36c7e5ae5ccdc10fac5b5d42ecf9206181c941c1 (commit)
       via  b301c0e71a5314bb4560111c6cf1602269f6f672 (commit)
       via  b31f79e7ef0e8b958442fbb55d08c11b404812ad (commit)
       via  5789109124b8b3fb230248d0ca50cf2e92b9abd7 (commit)
       via  c734f340ef9dff8cfeacba5f60902534f81f5d3f (commit)
       via  181e0a542823dde246bb49bd007db83bee2a6dc3 (commit)
       via  086325b3214da82c17d5b4cd6c0e79854f99039c (commit)
       via  cdf93f6ddbe5fb702e71e643bfa173546fe580ac (commit)
       via  5ba1afb0b9c2b7d8ecef961b4652dc682e529840 (commit)
       via  736203d039207a21009860e95b2bd03b4e4d98dd (commit)
       via  c7ebd8b367036dbe5bb5e1d38ff5c0c3deb42ca1 (commit)
       via  29792aab8d678334616f86a13b2ed23980d7324e (commit)
       via  f8546db483936bdddaf8d10ce8cbcdad7206ab60 (commit)
       via  785c5bbf02e7f787f3ac919a932464719eb64583 (commit)
       via  ee1e799575b0dbd78d2732671342e41384062a3a (commit)
       via  62eeaefb16dd8b98f499765cfcbe5583ab768dff (commit)
       via  26ea7f927b726fc74f2fcd014a6d5089b9f3b183 (commit)
       via  bb1fd0b50d46191dfb4c6b22d5203ad7c9da5d0c (commit)
       via  1fc6618454c451a7f133f4b5d5d92c8b8b70c502 (commit)
       via  77b67b1fec60aaf0b9966db9997f8c652d44438a (commit)
       via  4fd55eebec41f2d61de71573a1bfe5621bdfbeab (commit)
       via  9b489e448d701dd6fcdc7782d8a80d630112e62c (commit)
       via  35162fad237c04fa4ecd9213bb45659e3a14ae0c (commit)
       via  964d5dc8d7bf2eed8e9351df574d240aa499fc2f (commit)
       via  ae27816eb23e25952f7d5d94863867b5fa5d3d57 (commit)
       via  ad9c08b6d964efed0c1c0a5137089f80a35eb7ac (commit)
       via  4cf1fc0345f57ea3868a9ff9352388a624f2d78c (commit)
       via  88b5c9eda4c0461e6b569b541e75d3f2a88070aa (commit)
       via  4ac562be525c209e4a11f2fb69fa617115241085 (commit)
       via  ef958d8b14545d59cf9929ff8551076c29b0ab9a (commit)
       via  368267f858dfd98f4c278e87a6c696460c51dbb1 (commit)
       via  f8ffd9ce38867fc2698ad6367071eeba8b129716 (commit)
       via  dbfb4d94aa2c6128d6a00f018e4003ff2dc013e2 (commit)
       via  edf5d9dc0812e29a1cad85c2cce44ff39ac59869 (commit)
       via  590f96b04b515dcb819dcfbc87cbf61fb8a0b2ba (commit)
       via  c8ebd51878302c7a7cbb76412b9891f073e060b0 (commit)
       via  17c84cddde8ef332fff150ec32f37b97eb5c5976 (commit)
       via  31ab40f4275170559d8c9f83a58e473e2c455f2d (commit)
       via  5d4c8914c08a4b108693895a477e4ca6d33c6b2b (commit)
       via  0975870bb1631379f2da798fa78736a4fe32960a (commit)
       via  0dc487336120d7f2b2fa228aa61bd0f906a6795a (commit)
       via  a4d5c5647a59d18a3d9e5a52c6d82c20b0fbeb0d (commit)
       via  4ad79c1cd00aed31ace3b1e366939c3fa038b3cd (commit)
       via  3cd101f18784d8f49b774d7c6e2952d8ca6007a6 (commit)
       via  ae44c7ad2e13699ad7b8002fa56b3f4227366522 (commit)
       via  a5e3f549182cb5776bba9e1b1fd8bac409fab842 (commit)
       via  dfd0e4dc80ad2b6b8c3a1870f9fd0f2eea5b47fc (commit)
       via  0fd3df5984ca415ac7fde3d1db12d6b6b4380828 (commit)
       via  4620b1ee22cf2aebd127effed2db2bde89ca3a0f (commit)
       via  82cabaf094ccc499ac4fe4d773bdf51457563f85 (commit)
       via  84d98bc2c957bfe8534eab9cca9f75b08729cf81 (commit)
       via  3ecb2636750a5b19aa92ed4ea18f8f58636d6fc4 (commit)
       via  2e53e8f3404574c0aba33455aa3fb38ba123690a (commit)
       via  0c384a7c531260947e42925eddb4167ca787b778 (commit)
       via  a82b56c69f6a6b850fb2899e70b569872760e08a (commit)
       via  b41384d3b26db2552a627997774dd6af7e535686 (commit)
       via  7d480421c2dbe335bac01f92e3f5683f4262820d (commit)
       via  fd1905d9f9fc8277b3a5db999cd36d93007291ad (commit)
       via  96e9b040374e99b08c307e859ba7e9a7c19dd90e (commit)
       via  e2375e56ed8fc93668414f5fa3f447c19f5c5212 (commit)
       via  29f836743bff7c0576f00866f981f45a522892f4 (commit)
       via  7e44a73c0aa24b1a275214bfaf8aa645f91cf627 (commit)
       via  53547128f3b8d03e07ac09ae633181e0b19dd51b (commit)
       via  eb32fbed8f2977e2a3ba93dea5c8bfd9d7f89ad8 (commit)
       via  1735d395ff234dc34d94d88189a213e06458ca6f (commit)
       via  4d452ec8276e5054e69ed5998051c9821e1a29e5 (commit)
       via  0cd4746197ea2f24e64b73ede304cc28f5d42407 (commit)
       via  cd7acad8353c0d3db6e07d00d4b4fc1dba072f23 (commit)
       via  abcc82a521877173693aaee05b653da0dff3d152 (commit)
       via  64fff6ec7b4e6af759d276c6d8dfe9a3e30f058b (commit)
      from  61ad4f1bc2ffd18706dea3b3226dd6f57bbce625 (commit)


- Shortlog ------------------------------------------------------------
8584f93 Dpkg::Version: Add new function compare_versions
cff7c6e dpkg-shlibdeps: Fix handling of shlib types
ba56d63 dpkg-shlibdeps: Close file descriptor after use
eee7d3c Adapt installation method of Perl modules to 'master'
8563710 Merge branch 'master' into dpkg-shlibdeps-buxy

Summary of changes:
 COPYING                        |   27 +-
 ChangeLog                      |  336 ++
 THANKS                         |    4 +-
 TODO                           |   14 +-
 configure.ac                   |    3 +-
 debian/changelog               |  126 +-
 debian/control                 |    6 +-
 debian/dpkg-dev.install        |    5 +-
 debian/dpkg.install            |    3 +-
 dpkg-deb/.gitignore            |    1 +
 dpkg-deb/build.c               |   27 +-
 dpkg-deb/extract.c             |    5 +-
 dpkg-deb/info.c                |    5 +-
 dpkg-split/.gitignore          |    1 +
 dpkg-split/main.c              |    2 +-
 dselect/.gitignore             |    1 +
 dselect/po/ChangeLog           |   20 +
 dselect/po/et.po               |   60 +-
 dselect/po/fr.po               |   16 +-
 dselect/po/ko.po               |   31 +-
 dselect/po/pt.po               |   21 +-
 dselect/po/ro.po               |    7 +-
 dselect/po/ru.po               |   71 +-
 dselect/po/sv.po               |   51 +-
 getopt/.gitignore              |    1 +
 lib/.gitignore                 |    1 +
 lib/mlib.c                     |    4 +-
 lib/parsehelp.c                |   10 +-
 m4/perl.m4                     |    2 +
 man/ChangeLog                  |  139 +-
 man/Makefile.am                |   11 +
 man/cleanup-info.8             |    8 +-
 man/deb-control.5              |   18 +-
 man/deb-substvars.5            |    9 +-
 man/dpkg-buildpackage.1        |   20 +-
 man/dpkg-checkbuilddeps.1      |    8 +-
 man/dpkg-deb.1                 |   22 +-
 man/dpkg-divert.8              |   16 +-
 man/dpkg-genchanges.1          |   78 +-
 man/dpkg-name.1                |   14 +-
 man/dpkg-query.1               |   23 +-
 man/dpkg-scanpackages.1        |    6 +-
 man/dpkg-source.1              |   96 +-
 man/dpkg-split.1               |   15 +-
 man/dpkg-statoverride.8        |    6 +-
 man/dpkg.1                     |  127 +-
 man/install-info.8             |   14 +-
 man/po/de.po                   | 4311 +++++++++++++++------------
 man/po/dpkg-man.pot            | 3133 ++++++++++----------
 man/po/es.po                   | 3778 +++++++++++++-----------
 man/po/fr.po                   | 3905 +++++++++++++-----------
 man/po/hu.po                   | 3617 ++++++++++++-----------
 man/po/ja.po                   | 3741 ++++++++++++-----------
 man/po/pl.po                   | 3703 ++++++++++++-----------
 man/po/pt_BR.po                | 3631 ++++++++++++-----------
 man/po/ru.po                   | 3643 ++++++++++++-----------
 man/po/sv.add                  |    5 +-
 man/po/sv.po                   | 6539 ++++++++++++++++++++++------------------
 man/start-stop-daemon.8        |    4 +-
 man/update-alternatives.8      |   20 +-
 po/ChangeLog                   |   73 +-
 po/bs.po                       | 1123 ++++----
 po/ca.po                       | 1184 ++++----
 po/cs.po                       | 1179 ++++----
 po/da.po                       | 1268 +++++----
 po/de.po                       | 1168 ++++----
 po/dpkg.pot                    | 1110 ++++----
 po/dz.po                       | 1273 +++++----
 po/el.po                       | 1183 ++++----
 po/es.po                       | 1183 ++++----
 po/et.po                       | 1236 ++++----
 po/eu.po                       | 1640 ++++++-----
 po/fr.po                       | 1189 ++++----
 po/gl.po                       | 1180 ++++----
 po/hu.po                       | 1168 ++++----
 po/id.po                       | 1181 ++++----
 po/it.po                       | 1184 ++++----
 po/ja.po                       | 1180 ++++----
 po/km.po                       | 1179 ++++----
 po/ko.po                       | 1253 ++++----
 po/ku.po                       | 1130 ++++----
 po/mr.po                       | 1180 ++++----
 po/nb.po                       | 1180 ++++----
 po/ne.po                       | 1345 +++++----
 po/nl.po                       | 1182 ++++----
 po/nn.po                       | 1183 ++++----
 po/pa.po                       | 1140 ++++----
 po/pl.po                       | 1196 ++++----
 po/pt.po                       | 1336 +++++----
 po/pt_BR.po                    | 1184 ++++----
 po/ro.po                       | 1189 ++++----
 po/ru.po                       | 1270 ++++----
 po/sk.po                       | 1180 ++++----
 po/sv.po                       | 1278 +++++----
 po/tl.po                       | 1185 ++++----
 po/vi.po                       | 1876 +++++++------
 po/zh_CN.po                    | 1183 ++++----
 po/zh_TW.po                    | 1179 ++++----
 scripts/822-date.pl            |    7 +-
 scripts/Dpkg.pm                |   17 +
 scripts/Dpkg/Makefile.am       |    7 -
 scripts/Dpkg/Version.pm        |   30 +
 scripts/Makefile.am            |   22 +-
 scripts/changelog/debian.pl    |   10 +-
 scripts/cleanup-info.pl        |    7 +-
 scripts/controllib.pl          |   18 +-
 scripts/dpkg-architecture.pl   |    7 +-
 scripts/dpkg-buildpackage.sh   |   16 +-
 scripts/dpkg-checkbuilddeps.pl |    8 +-
 scripts/dpkg-distaddfile.pl    |    7 +-
 scripts/dpkg-divert.pl         |   22 +-
 scripts/dpkg-genchanges.pl     |   21 +-
 scripts/dpkg-gencontrol.pl     |   41 +-
 scripts/dpkg-gettext.pl        |   36 -
 scripts/dpkg-name.sh           |    2 +-
 scripts/dpkg-parsechangelog.pl |    7 +-
 scripts/dpkg-scanpackages.pl   |   14 +-
 scripts/dpkg-scansources.pl    |   14 +-
 scripts/dpkg-shlibdeps.pl      |   21 +-
 scripts/dpkg-source.pl         |   26 +-
 scripts/dpkg-statoverride.pl   |   14 +-
 scripts/install-info.pl        |   12 +-
 scripts/po/ChangeLog           |   22 +
 scripts/po/LINGUAS             |    2 +
 scripts/po/ca.po               |  795 +++---
 scripts/po/dpkg-dev.pot        |  795 +++---
 scripts/po/fr.po               | 1204 ++++----
 scripts/po/sv.po               | 2551 ++++++++++++++++
 scripts/t/100_Dpkg_Version.t   |   36 +-
 scripts/update-alternatives.pl |   51 +-
 src/.gitignore                 |    1 +
 src/archives.c                 |  241 ++-
 src/archives.h                 |    2 +
 src/cleanup.c                  |   49 +-
 src/configure.c                |   20 +-
 src/depcon.c                   |   45 +-
 src/help.c                     |   12 +-
 src/main.c                     |    3 +-
 src/main.h                     |    7 +-
 src/packages.c                 |   77 +-
 src/processarc.c               |   84 +-
 src/query.c                    |  107 +-
 src/remove.c                   |   19 +-
 utils/.gitignore               |    1 +
 144 files changed, 51373 insertions(+), 42188 deletions(-)
-----------------------------------------------------------------------
Details of changes:

commit 8584f930e4085af71cb0b2bfddfde912c35176ac
Author: Frank Lichtenheld <[EMAIL PROTECTED]>
Date:   Sat Sep 22 23:00:44 2007 +0200

    Dpkg::Version: Add new function compare_versions
    
    Emulates the dpkg --compare-versions behaviour (Doesn't support
    the -nl operators yet, though). This is often easier to write and
    read instead of using vercmp directly.
    
    Also add tests for the new function.

diff --git a/scripts/Dpkg/Version.pm b/scripts/Dpkg/Version.pm
index 6a9a168..abebd16 100644
--- a/scripts/Dpkg/Version.pm
+++ b/scripts/Dpkg/Version.pm
@@ -162,6 +162,36 @@ sub vercmp ($$)
     return verrevcmp($version{revision}, $refversion{revision});
 }
 
+=item compare_versions
+
+Emulates dpkg --compare-versions. Takes two versions as arguments
+one and three and one operator as argument two. Supports the following
+operators: 'gt', 'ge', 'eq', 'le', 'lt', and '>>', '>=', '=', '<=', '<<'.
+Returns a true value if the specified condition is true, a false value
+otherwise.
+
+=cut
+
+sub compare_versions ($$$)
+{
+    my $rel = $_[1];
+    my $res = vercmp($_[0], $_[2]);
+
+    if ($rel eq 'gt' or $rel =~ />?>/) {
+       return $res > 0;
+    } elsif ($rel eq 'ge' or $rel eq '>=') {
+       return $res >= 0;
+    } elsif ($rel eq 'eq' or $rel eq '=') {
+       return $res == 0;
+    } elsif ($rel eq 'le' or $rel eq '<=') {
+       return $res <= 0;
+    } elsif ($rel eq 'lt' or $rel =~ /<?</) {
+       return $res < 0;
+    } else {
+       die "bad relation '$rel'";
+    }
+}
+
 =back
 
 =head1 AUTHOR
diff --git a/scripts/t/100_Dpkg_Version.t b/scripts/t/100_Dpkg_Version.t
index 0e7e02f..553a0f9 100644
--- a/scripts/t/100_Dpkg_Version.t
+++ b/scripts/t/100_Dpkg_Version.t
@@ -26,9 +26,33 @@ my @versions = ({a      => '1.0-1',
                 result => 0,
                 relation => 'eq',
                },
+               {a      => '1.0000-1',
+                b      => '1.0-1',
+                result => 0,
+                relation => 'ge',
+               },
+               {a      => '1',
+                b      => '0:1',
+                result => 0,
+                relation => 'eq',
+               },
+               {a      => '2:2.5',
+                b      => '1:7.5',
+                result => 1,
+                relation => 'gt',
+               },
               );
+my @test_failure = ({a      => '1.0-1',
+                    b      => '2.0-2',
+                    relation => 'gt',
+                   },
+                   {a      => '2.2~rc-4',
+                    b      => '2.2-1',
+                    relation => 'eq',
+                   },
+                  );
 
-plan tests => @versions * 2 + 1;
+plan tests => @versions * 3 + @test_failure * 2 + 1;
 
 sub dpkg_vercmp{
      my ($a,$b,$cmp) = @_;
@@ -41,8 +65,16 @@ use_ok('Dpkg::Version');
 
 for my $version_cmp (@versions) {
      ok(Dpkg::Version::vercmp($$version_cmp{a},$$version_cmp{b}) == 
$$version_cmp{result},
-       "Version $$version_cmp{a} $$version_cmp{relation} $$version_cmp{b} ok");
+       "vercmp: Version $$version_cmp{a} $$version_cmp{relation} 
$$version_cmp{b} ok");
+     
ok(Dpkg::Version::compare_versions($$version_cmp{a},$$version_cmp{relation},$$version_cmp{b}),
+       "compare_versions: Version $$version_cmp{a} $$version_cmp{relation} 
$$version_cmp{b} ok");
      ok(dpkg_vercmp($$version_cmp{a},$$version_cmp{b},$$version_cmp{relation}),
        "Dpkg concures: Version $$version_cmp{a} $$version_cmp{relation} 
$$version_cmp{b}");
 }
 
+for my $version_cmp (@test_failure) {
+     
ok(!Dpkg::Version::compare_versions($$version_cmp{a},$$version_cmp{relation},$$version_cmp{b}),
+       "compare_versions: Version $$version_cmp{a} $$version_cmp{relation} 
$$version_cmp{b} false");
+     
ok(!dpkg_vercmp($$version_cmp{a},$$version_cmp{b},$$version_cmp{relation}),
+       "Dpkg concures: Version $$version_cmp{a} $$version_cmp{relation} 
$$version_cmp{b}");
+}

commit cff7c6ef26150d2c215eaef5ce52d9d75dd4ceb9
Author: Frank Lichtenheld <[EMAIL PROTECTED]>
Date:   Sat Sep 22 21:50:16 2007 +0200

    dpkg-shlibdeps: Fix handling of shlib types
    
    shlibs with no specified type should be valid for all types,
    not only for "deb".

diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index 327f319..fbb8b60 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@ -336,8 +336,7 @@ sub extract_from_shlibs {
            warning(sprintf(_g("shared libs info file \`%s' line %d: bad line 
\`%s'"), $shlibfile, $., $_));
            next;
        }
-       my $type = defined($1) ? $1 : "deb";
-       next if $type ne $packagetype;
+       next if defined($1) and $1 ne $packagetype;
        if (($libname eq $2) && ($libversion eq $3)) {
            $dep = $4;
            last;

commit ba56d637aa7c4792c477bae452cbecb3211a8a7c
Author: Frank Lichtenheld <[EMAIL PROTECTED]>
Date:   Sat Sep 22 21:49:20 2007 +0200

    dpkg-shlibdeps: Close file descriptor after use
    
    Unneeded file descriptors should be closed ASAP.

diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index 7fa7e99..327f319 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@ -200,6 +200,7 @@ if ($stdout) {
            print(NEW $entry) ||
                syserr(sprintf(_g("copy old entry to new varlist file \`%s'"), 
"$varlistfile.new"));
        }
+       close(OLD);
     }
     $fh = \*NEW;
 }

commit eee7d3c8a14bc91f8b9b426f5b519b4ca1c3b40e
Author: Frank Lichtenheld <[EMAIL PROTECTED]>
Date:   Sat Sep 22 21:30:58 2007 +0200

    Adapt installation method of Perl modules to 'master'
    
    master and dpkg-shlibdeps-buxy used two different methods
    for installing the Perl modules. Use the one from master.

diff --git a/configure.ac b/configure.ac
index 123cb4e..5e2eb92 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,7 +112,6 @@ AC_CONFIG_FILES([ Makefile
                  origins/Makefile
                  po/Makefile.in
                  scripts/Makefile
-                 scripts/Dpkg/Makefile
                  scripts/po/Makefile.in
                  src/Makefile
                  utils/Makefile ])
diff --git a/debian/dpkg-dev.install b/debian/dpkg-dev.install
index ae1a2e4..2b72995 100644
--- a/debian/dpkg-dev.install
+++ b/debian/dpkg-dev.install
@@ -16,8 +16,11 @@ usr/bin/dpkg-scansources
 usr/bin/dpkg-shlibdeps
 usr/bin/dpkg-source
 usr/lib/dpkg/controllib.pl
-usr/lib/dpkg/Dpkg
 usr/lib/dpkg/parsechangelog
+usr/share/perl5/Dpkg/Version.pm
+usr/share/perl5/Dpkg/ErrorHandling.pm
+usr/share/perl5/Dpkg/Shlibs.pm
+usr/share/perl5/Dpkg/Shlibs
 usr/share/locale/*/LC_MESSAGES/dpkg-dev.mo
 usr/share/man/*/*/822-date.1
 usr/share/man/*/822-date.1
diff --git a/scripts/Dpkg/Makefile.am b/scripts/Dpkg/Makefile.am
deleted file mode 100644
index abbccf3..0000000
--- a/scripts/Dpkg/Makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
-
-shlibsmodulesdir=$(pkglibdir)/Dpkg/Shlibs
-dpkgmodulesdir=$(pkglibdir)/Dpkg
-
-dist_shlibsmodules_DATA = Shlibs/Objdump.pm Shlibs/SymbolFile.pm
-dist_dpkgmodules_DATA = ErrorHandling.pm Gettext.pm Shlibs.pm Version.pm
-
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index c1d2ed2..d5e54b2 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = po Dpkg
+SUBDIRS = po
 
 bin_SCRIPTS = \
        822-date \
@@ -57,7 +57,12 @@ CLEANFILES = \
 
 perllibdir = $(PERL_LIBDIR)
 nobase_dist_perllib_DATA = \
+       Dpkg/Shlibs.pm \
+       Dpkg/Shlibs/Objdump.pm \
+       Dpkg/Shlibs/SymbolFile.pm \
+       Dpkg/ErrorHandling.pm \
        Dpkg/Gettext.pm \
+       Dpkg/Version.pm \
        Dpkg.pm
 
 dist_pkglib_SCRIPTS = \

commit 85637101b5df1ce82c845f55949c7ba607763716
Merge: 61ad4f1bc2ffd18706dea3b3226dd6f57bbce625 
ca39b2a4cc4b32422453d27030ab86930f51cd4d
Author: Frank Lichtenheld <[EMAIL PROTECTED]>
Date:   Sat Sep 22 18:36:11 2007 +0200

    Merge branch 'master' into dpkg-shlibdeps-buxy
    
    Conflicts:
    
        scripts/dpkg-shlibdeps.pl

diff --combined configure.ac
index 2ea178a,5e2eb92..123cb4e
--- a/configure.ac
+++ b/configure.ac
@@@ -1,7 -1,7 +1,7 @@@
  # Process this file with autoconf to produce a configure script.
  
  AC_PREREQ(2.59)
- AC_INIT([dpkg], [1.14.5~], [EMAIL PROTECTED])
+ AC_INIT([dpkg], [1.14.7~], [EMAIL PROTECTED])
  AC_CONFIG_SRCDIR([lib/dpkg.h])
  AC_CONFIG_MACRO_DIR([m4])
  AC_CONFIG_AUX_DIR([config])
@@@ -112,7 -112,6 +112,7 @@@ AC_CONFIG_FILES([ Makefil
                  origins/Makefile
                  po/Makefile.in
                  scripts/Makefile
 +                scripts/Dpkg/Makefile
                  scripts/po/Makefile.in
                  src/Makefile
                  utils/Makefile ])
diff --combined man/Makefile.am
index 8f501eb,f219ff3..98fcc82
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@@ -27,6 -27,17 +27,17 @@@ install-data-local
                fi \
        done
  
+ uninstall-local:
+       for lang in $(LINGUAS); do \
+               if [ -d $(srcdir)/$$lang ]; then \
+                       files=$$(echo $(srcdir)/$$lang/*.[1-9]); \
+                       $(MAKE) uninstall-man \
+                               mandir="$(mandir)/$$lang" \
+                               man_MANS="" \
+                               dist_man_MANS="$$files"; \
+               fi \
+       done
+ 
  dist-hook: man.stamp
        cp $(srcdir)/man.stamp $(distdir)/
        for lang in $(LINGUAS); do \
@@@ -42,7 -53,6 +53,7 @@@ dist_man_MANS = 
        deb-control.5 \
        deb-shlibs.5 \
        deb-substvars.5 \
 +      deb-symbols.5 \
        deb-old.5 \
        deb-override.5 \
        deb.5 \
@@@ -54,7 -64,6 +65,7 @@@
        dpkg-divert.8 \
        dpkg-genchanges.1 \
        dpkg-gencontrol.1 \
 +      dpkg-gensymbols.1 \
        dpkg-name.1 \
        dpkg-parsechangelog.1 \
        dpkg-query.1 \
diff --combined scripts/Makefile.am
index 277a521,454db54..c1d2ed2
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@@ -1,6 -1,6 +1,6 @@@
  ## Process this file with automake to produce Makefile.in
  
 -SUBDIRS = po
 +SUBDIRS = po Dpkg
  
  bin_SCRIPTS = \
        822-date \
@@@ -10,7 -10,6 +10,7 @@@
        dpkg-distaddfile \
        dpkg-genchanges \
        dpkg-gencontrol \
 +      dpkg-gensymbols \
        dpkg-name \
        dpkg-parsechangelog \
        dpkg-scanpackages \
@@@ -37,7 -36,6 +37,7 @@@ EXTRA_DIST = 
        dpkg-distaddfile.pl \
        dpkg-genchanges.pl \
        dpkg-gencontrol.pl \
 +      dpkg-gensymbols.pl \
        dpkg-name.sh \
        dpkg-parsechangelog.pl \
        dpkg-scanpackages.pl \
@@@ -55,10 -53,13 +55,13 @@@ CLEANFILES = 
        $(bin_SCRIPTS) $(sbin_SCRIPTS) $(changelog_SCRIPTS) \
        install-info install-info-stamp
  
+ perllibdir = $(PERL_LIBDIR)
+ nobase_dist_perllib_DATA = \
+       Dpkg/Gettext.pm \
+       Dpkg.pm
  
  dist_pkglib_SCRIPTS = \
-       controllib.pl \
-       dpkg-gettext.pl
+       controllib.pl
  
  
  do_perl_subst = sed -e "s:^\#![:space:]*/usr/bin/perl:\#!$(PERL):" \
@@@ -96,12 -97,14 +99,20 @@@ install-data-local
        $(mkdir_p) $(DESTDIR)$(sysconfdir)/alternatives
        $(INSTALL_DATA) $(srcdir)/README.alternatives 
$(DESTDIR)$(sysconfdir)/alternatives/README
  
+ # Ideally we'd use 'sed -i', but unfortunately that's not portable.
+ install-data-hook:
+       cp -p $(DESTDIR)$(perllibdir)/Dpkg.pm \
+             $(DESTDIR)$(perllibdir)/Dpkg.pm.tmp
+       $(do_perl_subst) <$(DESTDIR)$(perllibdir)/Dpkg.pm.tmp \
+                        >$(DESTDIR)$(perllibdir)/Dpkg.pm
+       rm $(DESTDIR)$(perllibdir)/Dpkg.pm.tmp
+ 
  uninstall-local:
        rm -f $(DESTDIR)$(sysconfdir)/alternatives/README
        rm -f $(DESTDIR)$(sbindir)/install-info
 +
 +TEST_FILES= t/*.t
 +TEST_VERBOSE= 0
 +
 +test:
 +      PERL_DL_NONLAZY=1 $(PERL) "-MExtUtils::Command::MM" "-e" 
"test_harness($(TEST_VERBOSE), '.')" $(TEST_FILES)
diff --combined scripts/dpkg-shlibdeps.pl
index a31bdc5,95795fd..7fa7e99
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@@ -1,265 -1,37 +1,258 @@@
 -#! /usr/bin/perl
 -#
 -# dpkg-shlibdeps
 -# $Id$
 +#!/usr/bin/perl -w
  
  use strict;
  use warnings;
  
- our $progname;
- our $version;
- our $dpkglibdir;
- my $admindir = "/var/lib/dpkg";
- 
- BEGIN {
-     $version="1.14.4"; # This line modified by Makefile
-     $dpkglibdir="."; # This line modified by Makefile
-     push(@INC,$dpkglibdir);
- }
- 
+ use English;
+ use POSIX qw(:errno_h :signal_h);
+ use Dpkg;
+ use Dpkg::Gettext;
 +use Dpkg::Version qw(vercmp);
 +use Dpkg::Shlibs qw(find_library);
 +use Dpkg::Shlibs::Objdump;
 +use Dpkg::Shlibs::SymbolFile;
 +
 +our $host_arch= `dpkg-architecture -qDEB_HOST_ARCH`;
 +chomp $host_arch;
 +
 +# By increasing importance
 +my @depfields= qw(Suggests Recommends Depends Pre-Depends);
 +my $i=0; my %depstrength = map { $_ => $i++ } @depfields;
 +
++push(@INC, $dpkglibdir);
 +require 'controllib.pl';
- require 'dpkg-gettext.pl';
 +textdomain("dpkg-dev");
  
  my $shlibsoverride= '/etc/dpkg/shlibs.override';
  my $shlibsdefault= '/etc/dpkg/shlibs.default';
  my $shlibslocal= 'debian/shlibs.local';
 -my $shlibsppdir;
 -my $shlibsppext= '.shlibs';
 -my $varnameprefix= 'shlibs';
 +my $packagetype= 'deb';
  my $dependencyfield= 'Depends';
  my $varlistfile= 'debian/substvars';
 -my $packagetype= 'deb';
 +my $varnameprefix= 'shlibs';
 +my $debug= 0;
  
 -my @depfields= qw(Suggests Recommends Depends Pre-Depends);
 -my %depstrength;
 -my $i=0; grep($depstrength{$_}= ++$i, @depfields);
 +my (@pkg_shlibs, @pkg_symbols);
 +if (-d "debian") {
 +    push @pkg_symbols, <debian/*/DEBIAN/symbols>;
 +    push @pkg_shlibs, <debian/*/DEBIAN/shlibs>;
 +}
  
 -push(@INC,$dpkglibdir);
 -require 'controllib.pl';
 +my ($stdout, %exec);
 +foreach (@ARGV) {
 +    if (m/^-T(.*)$/) {
 +      $varlistfile= $1;
 +    } elsif (m/^-p(\w[-:0-9A-Za-z]*)$/) {
 +      $varnameprefix= $1;
 +    } elsif (m/^-L(.*)$/) {
 +      $shlibslocal= $1;
 +    } elsif (m/^-O$/) {
 +      $stdout= 1;
 +    } elsif (m/^-(h|-help)$/) {
 +      usage(); exit(0);
 +    } elsif (m/^--version$/) {
 +      version(); exit(0);
 +    } elsif (m/^--admindir=(.*)$/) {
 +      $admindir = $1;
 +      -d $admindir ||
 +          error(sprintf(_g("administrative directory '%s' does not exist"),
 +                        $admindir));
 +    } elsif (m/^-d(.*)$/) {
 +      $dependencyfield= capit($1);
 +      defined($depstrength{$dependencyfield}) ||
 +          warning(sprintf(_g("unrecognised dependency field \`%s'"), 
$dependencyfield));
 +    } elsif (m/^-e(.*)$/) {
 +      $exec{$1} = $dependencyfield;
 +    } elsif (m/^-t(.*)$/) {
 +      $packagetype = $1;
 +    } elsif (m/-v$/) {
 +      $debug = 1;
 +    } elsif (m/^-/) {
 +      usageerr(sprintf(_g("unknown option \`%s'"), $_));
 +    } else {
 +      $exec{$_} = $dependencyfield;
 +    }
 +}
  
 -textdomain("dpkg-dev");
 +scalar keys %exec || usageerr(_g("need at least one executable"));
 +
 +my %dependencies;
 +my %shlibs;
 +
 +my $cur_field;
 +foreach my $file (keys %exec) {
 +    $cur_field = $exec{$file};
 +    print "Scanning $file (for $cur_field field)\n" if $debug;
 +
 +    my $obj = Dpkg::Shlibs::Objdump::Object->new($file);
 +    my @sonames = $obj->get_needed_libraries;
 +
 +    # Load symbols files for all needed libraries (identified by SONAME)
 +    my %libfiles;
 +    foreach my $soname (@sonames) {
 +      my $file = my_find_library($soname, $obj->{RPATH}, $obj->{format});
 +      warning("Couldn't find library $soname.") unless defined($file);
 +      $libfiles{$file} = $soname if defined($file);
 +    }
 +    my $file2pkg = find_packages(keys %libfiles);
 +    my $symfile = Dpkg::Shlibs::SymbolFile->new();
 +    my $dumplibs_wo_symfile = Dpkg::Shlibs::Objdump->new();
 +    my @soname_wo_symfile;
 +    foreach my $file (keys %libfiles) {
 +      my $soname = $libfiles{$file};
 +      if (not exists $file2pkg->{$file}) {
 +          # If the library is not available in an installed package,
 +          # it's because it's in the process of being built
 +          # Empty package name will lead to consideration of symbols
 +          # file from the package being built only
 +          $file2pkg->{$file} = [""];
 +      }
 +
 +      # Load symbols/shlibs files from packages providing libraries
 +      foreach my $pkg (@{$file2pkg->{$file}}) {
 +          my $dpkg_symfile;
 +          if ($packagetype eq "deb") {
 +              # Use fine-grained dependencies only on real deb
 +              $dpkg_symfile = find_symbols_file($pkg, $soname);
 +          }
 +          if (defined $dpkg_symfile) {
 +              # Load symbol information
 +              print "Using symbols file $dpkg_symfile for $soname\n" if 
$debug;
 +              $symfile->load($dpkg_symfile);
 +              # Initialize dependencies as an unversioned dependency
 +              my $dep = $symfile->get_dependency($soname);
 +              foreach my $subdep (split /\s*,\s*/, $dep) {
 +                  if (not exists $dependencies{$cur_field}{$subdep}) {
 +                      $dependencies{$cur_field}{$subdep} = '';
 +                  }
 +              }
 +          } else {
 +              # No symbol file found, fall back to standard shlibs
 +              $dumplibs_wo_symfile->parse($file);
 +              push @soname_wo_symfile, $soname;
 +              add_shlibs_dep($soname, $pkg);
 +          }
 +      }
 +    }
 +
 +    # Scan all undefined symbols of the binary and resolve to a
 +    # dependency
 +    my %used_sonames = map { $_ => 0 } @sonames;
 +    foreach my $sym ($obj->get_undefined_dynamic_symbols()) {
 +      my $name = $sym->{name};
 +      if ($sym->{version}) {
 +          $name .= "[EMAIL PROTECTED]>{version}";
 +      } else {
 +          $name .= "[EMAIL PROTECTED]";
 +      }
 +      my $symdep = $symfile->lookup_symbol($name, [EMAIL PROTECTED]);
 +      if (defined($symdep)) {
 +          my ($d, $m) = ($symdep->{depends}, $symdep->{minver});
 +          $used_sonames{$symdep->{soname}}++;
 +          foreach my $subdep (split /\s*,\s*/, $d) {
 +              if (exists $dependencies{$cur_field}{$subdep} and
 +                  defined($dependencies{$cur_field}{$subdep}))
 +              {
 +                  if ($dependencies{$cur_field}{$subdep} eq '' or
 +                      vercmp($m, $dependencies{$cur_field}{$subdep}) > 0)
 +                  {
 +                      $dependencies{$cur_field}{$subdep} = $m;
 +                  }
 +              } else {
 +                  $dependencies{$cur_field}{$subdep} = $m;
 +              }
 +          }
 +      } else {
 +          my $syminfo = $dumplibs_wo_symfile->locate_symbol($name);
 +          if (not defined($syminfo)) {
 +              my $print_name = $name;
 +              # Drop the default suffix for readability
 +              $print_name =~ s/[EMAIL PROTECTED]//;
 +              warning(sprintf(
 +                  _g("symbol %s used by %s found in none of the libraries."),
 +                  $print_name, $file)) unless $sym->{weak};
 +          } else {
 +              $used_sonames{$syminfo->{soname}}++;
 +          }
 +      }
 +    }
 +    # Warn about un-NEEDED libraries
 +    foreach my $soname (@sonames) {
 +      unless ($used_sonames{$soname}) {
 +          warning(sprintf(
 +              _g("%s shouldn't be linked with %s (it uses none of its 
symbols)."),
 +              $file, $soname));
 +      }
 +    }
 +}
 +
 +# Open substvars file
 +my $fh;
 +if ($stdout) {
 +    $fh = \*STDOUT;
 +} else {
 +    open(NEW, ">", "$varlistfile.new") ||
 +      syserr(sprintf(_g("open new substvars file \`%s'"), 
"$varlistfile.new"));
 +    if (-e $varlistfile) {
 +      open(OLD, "<", $varlistfile) ||
 +          syserr(sprintf(_g("open old varlist file \`%s' for reading"), 
$varlistfile));
 +      foreach my $entry (grep { not m/^\Q$varnameprefix\E:/ } (<OLD>)) {
 +          print(NEW $entry) ||
 +              syserr(sprintf(_g("copy old entry to new varlist file \`%s'"), 
"$varlistfile.new"));
 +      }
 +    }
 +    $fh = \*NEW;
 +}
 +
 +# Write out the shlibs substvars
 +my %depseen;
 +foreach my $field (reverse @depfields) {
 +    my $dep = "";
 +    if (exists $dependencies{$field} and scalar keys 
%{$dependencies{$field}}) {
 +      $dep = join ", ",
 +          map {
 +              # Translate dependency templates into real dependencies
 +              if ($dependencies{$field}{$_}) {
 +                  s/#MINVER#/(>= $dependencies{$field}{$_})/g;
 +              } else {
 +                  s/#MINVER#//g;
 +              }
 +              s/\s+/ /g;
 +              $_;
 +          } grep {
 +              # Don't include dependencies if they are already
 +              # mentionned in a higher priority field
 +              if (not defined($depseen{$_})) {
 +                  $depseen{$_} = $dependencies{$field}{$_};
 +                  1;
 +              } else {
 +                  # Since dependencies can be versionned, we have to
 +                  # verify if the dependency is stronger than the
 +                  # previously seen one
 +                  if (vercmp($depseen{$_}, $dependencies{$field}{$_}) > 0) {
 +                      0;
 +                  } else {
 +                      $depseen{$_} = $dependencies{$field}{$_};
 +                      1;
 +                  }
 +              }
 +          } keys %{$dependencies{$field}};
 +    }
 +    if ($dep) {
 +      print $fh "$varnameprefix:$field=$dep\n";
 +    }
 +}
 +
 +# Replace old file by new one
 +if (!$stdout) {
 +    close($fh);
 +    rename("$varlistfile.new",$varlistfile) ||
 +      syserr(sprintf(_g("install new varlist file \`%s'"), $varlistfile));
 +}
  
 -#use strict;
 -#use warnings;
 +##
 +## Functions
 +##
  
  sub version {
      printf _g("Debian %s version %s.\n"), $progname, $version;
@@@ -267,9 -39,7 +260,9 @@@
      printf _g("
  Copyright (C) 1996 Ian Jackson.
  Copyright (C) 2000 Wichert Akkerman.
 -Copyright (C) 2006 Frank Lichtenheld.");
 +Copyright (C) 2006 Frank Lichtenheld.
 +Copyright (C) 2007 Raphael Hertzog.
 +");
  
      printf _g("
  This is free software; see the GNU General Public Licence version 2 or
@@@ -301,130 -71,376 +294,130 @@@ Dependency fields recognised are
  "), $progname, join("/",@depfields);
  }
  
 -my ($stdout, @exec, @execfield);
 -foreach (@ARGV) {
 -    if (m/^-T/) {
 -      $varlistfile= $POSTMATCH;
 -    } elsif (m/^-p(\w[-:0-9A-Za-z]*)$/) {
 -      $varnameprefix= $1;
 -    } elsif (m/^-L/) {
 -      $shlibslocal= $POSTMATCH;
 -    } elsif (m/^-O$/) {
 -      $stdout= 1;
 -    } elsif (m/^-(h|-help)$/) {
 -      usage; exit(0);
 -    } elsif (m/^--version$/) {
 -      version; exit(0);
 -    } elsif (m/^--admindir=/) {
 -      $admindir = $POSTMATCH;
 -      -d $admindir ||
 -          error(sprintf(_g("administrative directory '%s' does not exist"),
 -                           $admindir));
 -    } elsif (m/^-d/) {
 -      $dependencyfield= capit($POSTMATCH);
 -      defined($depstrength{$dependencyfield}) ||
 -          warning(sprintf(_g("unrecognised dependency field '%s'"), 
$dependencyfield));
 -    } elsif (m/^-e/) {
 -      push(@exec,$POSTMATCH); push(@execfield,$dependencyfield);
 -    } elsif (m/^-t/) {
 -      $packagetype= $POSTMATCH;
 -    } elsif (m/^-/) {
 -      usageerr(sprintf(_g("unknown option \`%s'"), $_));
 -    } else {
 -      push(@exec,$_); push(@execfield,$dependencyfield);
 +sub add_shlibs_dep {
 +    my ($soname, $pkg) = @_;
 +    foreach my $file ($shlibslocal, $shlibsoverride, @pkg_shlibs,
 +                      "$admindir/info/$pkg.shlibs",
 +                      $shlibsdefault)
 +    {
 +      next if not -e $file;
 +      my $dep = extract_from_shlibs($soname, $file);
 +      if (defined($dep)) {
 +          foreach (split(/,\s*/, $dep)) {
 +              $dependencies{$cur_field}{$_} = 1;
 +          }
 +          last;
 +      }
      }
  }
  
 -$shlibsppdir = "$admindir/info";
 -
 [EMAIL PROTECTED] || usageerr(_g("need at least one executable"));
 -
 -sub isbin {
 -    open (F, $_[0]) || die(sprintf(_g("unable to open '%s' for test"), 
$_[0]));
 -    my $d;
 -    if (read (F, $d, 4) != 4) {
 -       die (sprintf(_g("unable to read first four bytes of '%s' as magic 
number"), $_[0]));
 -    }
 -    if ($d =~ /^\177ELF$/) { # ELF binary
 -       return 1;
 -    } elsif (unpack ('N', $d) == 0x8086010B) { # obsd dyn bin
 -       return 1;
 -    } elsif (unpack ('N', $d) ==   0x86010B) { # obsd stat bin
 -       return 1;
 -    } elsif ($d =~ /^\#\!..$/) { # shell script
 -       return 0;
 -    } elsif (unpack ('N', $d) == 0xcafebabe) { # JAVA binary
 -       return 0;
 +sub extract_from_shlibs {
 +    my ($soname, $shlibfile) = @_;
 +    my ($libname, $libversion);
 +    # Split soname in name/version
 +    if ($soname =~ /^(.*)\.so\.(.*)$/) {
 +      $libname = $1; $libversion = $2;
 +    } elsif ($soname =~ /^(.*)-(.*)\.so$/) {
 +      $libname = $1; $libversion = $2;
      } else {
 -       die(sprintf(_g("unrecognized file type for '%s'"), $_[0]));
 +      warning(sprintf(_g("Can't extract name and version from library name 
\`%s'"), $soname));
 +      return;
      }
 -}
 -
 -my @librarypaths = qw( /lib /usr/lib /lib32 /usr/lib32 /lib64 /usr/lib64
 -                     /emul/ia32-linux/lib /emul/ia32-linux/usr/lib );
 -my %librarypaths = map { $_ => 'default' } @librarypaths;
 -
 -if ($ENV{LD_LIBRARY_PATH}) {
 -    foreach (reverse split( /:/, $ENV{LD_LIBRARY_PATH} )) {
 -      s,/+$,,;
 -      unless (exists $librarypaths{$_}) {
 -          $librarypaths{$_} = 'env';
 -          unshift @librarypaths, $_;
 +    # Open shlibs file
 +    $shlibfile = "./$shlibfile" if $shlibfile =~ m/^\s/;
 +    open(SHLIBS, "<", $shlibfile)
 +      || syserr(sprintf(_g("unable to open shared libs info file \`%s'"), 
$shlibfile));
 +    my $dep;
 +    while (<SHLIBS>) {
 +      s/\s*\n$//;
 +      next if m/^\#/;
 +      if (!m/^\s*(?:(\S+):\s+)?(\S+)\s+(\S+)\s+(\S.*\S)\s*$/) {
 +          warning(sprintf(_g("shared libs info file \`%s' line %d: bad line 
\`%s'"), $shlibfile, $., $_));
 +          next;
        }
 -    }
 -}
 -
 -# Support system library directories.
 -my $ldconfigdir = '/lib/ldconfig';
 -if (opendir(DIR, $ldconfigdir)) {
 -    my @dirents = readdir(DIR);
 -    closedir(DIR);
 -
 -    for (@dirents) {
 -      next if /^\./;
 -      my $d = `readlink -f $ldconfigdir/$_`;
 -      chomp $d;
 -      unless (exists $librarypaths{$d}) {
 -          $librarypaths{$d} = 'ldconfig';
 -          push @librarypaths, $d;
 +      my $type = defined($1) ? $1 : "deb";
 +      next if $type ne $packagetype;
 +      if (($libname eq $2) && ($libversion eq $3)) {
 +          $dep = $4;
 +          last;
        }
      }
 +    close(SHLIBS);
 +    return $dep;
  }
  
 -open CONF, '</etc/ld.so.conf' or
 -    warning(sprintf(_g("couldn't open /etc/ld.so.conf: %s"), $!));
 -while( <CONF> ) {
 -    next if /^\s*$/;
 -    chomp;
 -    s,/+$,,;
 -    unless (exists $librarypaths{$_}) {
 -      $librarypaths{$_} = 'conf';
 -      push @librarypaths, $_;
 -    }
 -}
 -close CONF;
 -
 -my (%rpaths, %format);
 -my (@libfiles, @libname, @libsoname, @libfield, @libexec);
 -for ($i=0;$i<=$#exec;$i++) {
 -    if (!isbin ($exec[$i])) { next; }
 -
 -    # Now we get the direct deps of the program
 -    defined(my $c= open(P,"-|")) || syserr(_g("cannot fork for objdump"));
 -    if (!$c) {
 -      exec("objdump", "-p", "--", $exec[$i]) or
 -          syserr(_g("cannot exec objdump"));
 -    }
 -    while (<P>) {
 -      chomp;
 -      if (/^\s*\S+:\s*file\s+format\s+(\S+)\s*$/) {
 -          $format{$exec[$i]} = $1;
 -      } elsif (m,^\s*NEEDED\s+,) {
 -          if (m,^\s*NEEDED\s+((\S+)\.so\.(\S+))$,) {
 -              push(@libname,$2); push(@libsoname,$3);
 -              push(@libfield,$execfield[$i]);
 -              push(@libfiles,$1);
 -              push(@libexec,$exec[$i]);
 -          } elsif (m,^\s*NEEDED\s+((\S+)-(\S+)\.so)$,) {
 -              push(@libname,$2); push(@libsoname,$3);
 -              push(@libfield,$execfield[$i]);
 -              push(@libfiles,$1);
 -              push(@libexec,$exec[$i]);
 -          } else {
 -              m,^\s*NEEDED\s+(\S+)$,;
 -              warning(sprintf(_g("format of 'NEEDED %s' not recognized"), 
$1));
 -          }
 -      } elsif (/^\s*RPATH\s+(\S+)\s*$/) {
 -          push @{$rpaths{$exec[$i]}}, split(/:/, $1);
 +sub find_symbols_file {
 +    my ($pkg, $soname) = @_;
 +    foreach my $file (@pkg_symbols,
 +      "/etc/dpkg/symbols/$pkg.symbols.$host_arch",
 +      "/etc/dpkg/symbols/$pkg.symbols",
 +      "$admindir/info/$pkg.symbols")
 +    {
 +      if (-e $file and symfile_has_soname($file, $soname)) {
 +          return $file;
        }
      }
 -    close(P) or subprocerr(sprintf(_g("objdump on \`%s'"), $exec[$i]));
 +    return undef;
  }
  
 -# Now: See if it is in this package.  See if it is in any other package.
 -my @curshlibs;
 -sub searchdir {
 -    my $dir = shift;
 -    if(opendir(DIR, $dir)) {
 -      my @dirents = readdir(DIR);
 -      closedir(DIR);
 -      for (@dirents) {
 -          if ( -f "$dir/$_/DEBIAN/shlibs" ) {
 -              push(@curshlibs, "$dir/$_/DEBIAN/shlibs");
 -              next;
 -          } elsif ( $_ !~ /^\./ && ! -e "$dir/$_/DEBIAN" &&
 -                    -d "$dir/$_" && ! -l "$dir/$_" ) {
 -              &searchdir("$dir/$_");
 -          }
 +sub symfile_has_soname {
 +    my ($file, $soname) = @_;
 +    open(SYM_FILE, "<", $file)
 +      || syserr(sprintf(_g("cannot open file %s"), $file));
 +    my $result = 0;
 +    while (<SYM_FILE>) {
 +      if (/^\Q$soname\E /) {
 +          $result = 1;
 +          last;
        }
      }
 +    close(SYM_FILE);
 +    return $result;
  }
  
 -my $searchdir = $exec[0];
 -my $curpackdir = "debian/tmp";
 -do { $searchdir =~ s,/[^/]*$,,; } while($searchdir =~ m,/,
 -                                      && ! -d "$searchdir/DEBIAN");
 -if ($searchdir =~ m,/,) {
 -    $curpackdir = $searchdir;
 -    $searchdir =~ s,/[^/]*,,;
 -    &searchdir($searchdir);
 -}
 -
 -if (1 || $#curshlibs >= 0) {
 -  PRELIB:
 -    for ($i=0;$i<=$#libname;$i++) {
 -      
if(scanshlibsfile($shlibslocal,$libname[$i],$libsoname[$i],$libfield[$i])
 -         || 
scanshlibsfile($shlibsoverride,$libname[$i],$libsoname[$i],$libfield[$i])) {
 -          splice(@libname, $i, 1);
 -          splice(@libsoname, $i, 1);
 -          splice(@libfield, $i, 1);
 -          splice(@libfiles, $i, 1);
 -          splice(@libexec, $i, 1);
 -          $i--;
 -          next PRELIB;
 -      }
 -      for my $shlibsfile (@curshlibs) {
 -          if(scanshlibsfile($shlibsfile, $libname[$i], $libsoname[$i], 
$libfield[$i])) {
 -              splice(@libname, $i, 1);
 -              splice(@libsoname, $i, 1);
 -              splice(@libfield, $i, 1);
 -              splice(@libfiles, $i, 1);
 -              splice(@libexec, $i, 1);
 -              $i--;
 -              next PRELIB;
 -          }
 -      }
 +# find_library ($soname, [EMAIL PROTECTED], $format)
 +sub my_find_library {
 +    my ($lib, $rpath, $format) = @_;
 +    my $file = find_library($lib, $rpath, $format, "");
 +    return $file if defined($file);
 +
 +    # Look into the packages we're currently building (but only those
 +    # that provides shlibs file...)
 +    # TODO: we should probably replace that by a cleaner way to look into
 +    # the various temporary build directories...
 +    foreach my $builddir (map { s{/DEBIAN/shlibs$}{}; $_ } @pkg_shlibs) {
 +      $file = find_library($lib, $rpath, $format, $builddir);
 +      return $file if defined($file);
      }
 +    return undef;
  }
  
 -my %pathpackages;
 -if ($#libfiles >= 0) {
 -    grep(s/\[\?\*/\\$&/g, @libname);
 -    defined(my $c= open(P,"-|")) || syserr(_g("cannot fork for dpkg 
--search"));
 -    if (!$c) {
 -      my %seen_libfiles;
 -      my @uniq_libfiles = grep !$seen_libfiles{$_}++, @libfiles;
 -
 -      close STDERR; # we don't need to see dpkg's errors
 -      open STDERR, "> /dev/null";
 +sub find_packages {
 +    my @files = (@_);
 +    my $pkgmatch = {};
 +    my $pid = open(DPKG, "-|");
 +    syserr(_g("cannot fork for dpkg --search")) unless defined($pid);
 +    if (!$pid) {
 +      # Child process running dpkg --search and discarding errors
 +      close STDERR;
 +      open STDERR, ">", "/dev/null";
        $ENV{LC_ALL} = "C";
 -      exec("dpkg", "--search", "--", @uniq_libfiles) or
 -          syserr(_g("cannot exec dpkg"));
 +      exec("dpkg", "--search", "--", @files)
 +          || syserr(_g("cannot exec dpkg"));
      }
 -    while (<P>) {
 -      chomp;
 +    while(defined($_ = <DPKG>)) {
 +      chomp($_);
        if (m/^local diversion |^diversion by/) {
            warning(_g("diversions involved - output may be incorrect"));
 -          print(STDERR " $_\n") || syserr(_g("write diversion info to 
stderr"));
 -      } elsif (m=^(\S+(, \S+)*): (\S+)$=) {
 -          push @{$pathpackages{$LAST_PAREN_MATCH}}, split(/, /, $1);
 +          print(STDERR " $_\n")
 +              || syserr(_g("write diversion info to stderr"));
 +      } elsif (m/^([^:]+): (\S+)$/) {
 +          $pkgmatch->{$2} = [ split(/, /, $1) ];
        } else {
            warning(sprintf(_g("unknown output from dpkg --search: '%s'"), $_));
        }
      }
 -    close(P);
 +    close(DPKG);
 +    return $pkgmatch;
  }
  
 - LIB:
 -    for ($i=0;$i<=$#libname;$i++) {
 -      my $file = $libfiles[$i];
 -      my @packages;
 -      foreach my $rpath (@{$rpaths{$libexec[$i]}}) {
 -          if (exists $pathpackages{"$rpath/$file"}
 -              && format_matches($libexec[$i],"$rpath/$file")) {
 -              push @packages, @{$pathpackages{"$rpath/$file"}};
 -          }
 -      }
 -      foreach my $path (@librarypaths) {
 -          if (exists $pathpackages{"$path/$file"}
 -              && format_matches($libexec[$i],"$path/$file")) {
 -              push @packages, @{$pathpackages{"$path/$file"}};
 -          }
 -      }
 -      if ([EMAIL PROTECTED]) {
 -          warning(sprintf(_g("could not find any packages for %s"), 
$libfiles[$i]));
 -      } else {
 -          for my $p (@packages) {
 -              scanshlibsfile("$shlibsppdir/$p$shlibsppext",
 -                             $libname[$i],$libsoname[$i],$libfield[$i])
 -                  && next LIB;
 -          }
 -      }
 -      scanshlibsfile($shlibsdefault,$libname[$i],$libsoname[$i],$libfield[$i])
 -          && next;
 -      warning(sprintf(_g("unable to find dependency information for ".
 -                         "shared library %s (soname %s, ".
 -                         "path %s, dependency field %s)"),
 -                      $libname[$i], $libsoname[$i],
 -                      $libfiles[$i], $libfield[$i]));
 -    }
 -
 -sub format_matches {
 -    my ($file1, $file2) = @_;
 -    my ($format1, $format2) = (get_format($file1),get_format($file2));
 -    return $format1 eq $format2;
 -}
 -
 -sub get_format {
 -    my ($file) = @_;
 -
 -    if ($format{$file}) {
 -      return $format{$file};
 -    } else {
 -      defined(my $c= open(P,"-|")) || syserr(_g("cannot fork for objdump"));
 -      if (!$c) {
 -          exec("objdump", "-a", "--", $file) or
 -              syserr(_g("cannot exec objdump"));
 -      }
 -      while (<P>) {
 -          chomp;
 -          if (/^\s*\S+:\s*file\s+format\s+(\S+)\s*$/) {
 -              $format{$file} = $1;
 -              return $format{$file};
 -          }
 -      }
 -      close(P) or subprocerr(sprintf(_g("objdump on \`%s'"), $file));
 -    }
 -}
 -
 -my (%predefdepfdep, %unkdepfdone, %unkdepf);
 -sub scanshlibsfile {
 -    my ($fn,$ln,$lsn,$lf) = @_;
 -    my ($da,$dk);
 -    $fn= "./$fn" if $fn =~ m/^\s/;
 -    if (!open(SLF,"< $fn")) {
 -        $! == ENOENT || syserr(sprintf(_g("unable to open shared libs info 
file \`%s'"), $fn));
 -        return 0;
 -    }
 -
 -    while (<SLF>) {
 -        s/\s*\n$//; next if m/^\#/;
 -        if (!m/^\s*(?:(\S+):\s+)?(\S+)\s+(\S+)/) {
 -          warning(sprintf(_g("shared libs info file '%s' line %d: bad line 
'%s'"), $fn, $., $_));
 -            next;
 -        }
 -        next if defined $1 && $1 ne $packagetype;
 -        next if $2 ne $ln || $3 ne $lsn;
 -        return 1 if $fn eq "$curpackdir/DEBIAN/shlibs";
 -        $da= $POSTMATCH;
 -        last if defined $1; # exact match, otherwise keep looking
 -    }
 -    close(SLF);
 -
 -    return 0 unless defined $da;
 -
 -    for my $dv (split(/,/,$da)) {
 -        $dv =~ s/^\s+//; $dv =~ s/\s+$//;
 -        if (defined($depstrength{$lf})) {
 -            if (!defined($predefdepfdep{$dv}) ||
 -                $depstrength{$predefdepfdep{$dv}} < $depstrength{$lf}) {
 -                $predefdepfdep{$dv}= $lf;
 -            }
 -        } else {
 -            $dk= "$lf: $dv";
 -            if (!defined($unkdepfdone{$dk})) {
 -                $unkdepfdone{$dk}= 1;
 -                $unkdepf{$lf} .= ', ' if defined($unkdepf{$lf});
 -                $unkdepf{$lf}.= $dv;
 -            }
 -        }
 -    }
 -    return 1;
 -}
 -
 -my $fh;
 -if (!$stdout) {
 -    open(Y,"> $varlistfile.new") ||
 -        syserr(sprintf(_g("open new substvars file \`%s'"), 
"$varlistfile.new"));
 -    unless ($REAL_USER_ID) {
 -      chown(getfowner(), "$varlistfile.new") ||
 -          syserr(sprintf(_g("chown of \`%s'"), "$varlistfile.new"));
 -    }
 -    if (open(X,"< $varlistfile")) {
 -        while (<X>) {
 -            s/\n$//;
 -            next if m/^(\w[-:0-9A-Za-z]*):/ && $1 eq $varnameprefix;
 -            print(Y "$_\n") ||
 -                syserr(sprintf(_g("copy old entry to new varlist file 
\`%s'"), "$varlistfile.new"));
 -        }
 -    } elsif ($! != ENOENT) {
 -        syserr(sprintf(_g("open old varlist file \`%s' for reading"), 
$varlistfile));
 -    }
 -    $fh = \*Y;
 -} else {
 -    $fh = \*STDOUT;
 -}
 -my %defdepf;
 -for my $dv (sort keys %predefdepfdep) {
 -    my $lf= $predefdepfdep{$dv};
 -    $defdepf{$lf} .= ', ' if defined($defdepf{$lf});
 -    $defdepf{$lf}.= $dv;
 -}
 -for my $lf (reverse @depfields) {
 -    next unless defined($defdepf{$lf});
 -    print($fh "$varnameprefix:$lf=$defdepf{$lf}\n")
 -        || syserr(_g("write output entry"));
 -}
 -for my $lf (sort keys %unkdepf) {
 -    print($fh "$varnameprefix:$lf=$unkdepf{$lf}\n")
 -        || syserr(_g("write userdef output entry"));
 -}
 -close($fh) || syserr(_g("close output"));
 -if (!$stdout) {
 -    rename("$varlistfile.new",$varlistfile) ||
 -        syserr(sprintf(_g("install new varlist file \`%s'"), $varlistfile));
 -}

-- 
dpkg's main repository


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

Reply via email to