Univention Bugzilla – Attachment 7552 Details for
Bug 40932
dists/ucs$REL/main/[debian-installer/]binary-$ARCH/Packages* contain duplicate packages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch 4.0-4 and 4.1-1
mirror.diff (text/plain), 3.18 KB, created by
Philipp Hahn
on 2016-03-23 00:58:09 CET
(
hide
)
Description:
Patch 4.0-4 and 4.1-1
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2016-03-23 00:58:09 CET
Size:
3.18 KB
patch
obsolete
>diff --git a/branches/ucs-4.0/ucs-4.0-4/base/univention-updater/modules/univention/updater/mirror.py b/branches/ucs-4.0/ucs-4.0-4/base/univention-updater/modules/univention/updater/mirror.py >index 2d0da13..2c6c2a2 100644 >--- a/branches/ucs-4.0/ucs-4.0-4/base/univention-updater/modules/univention/updater/mirror.py >+++ b/branches/ucs-4.0/ucs-4.0-4/base/univention-updater/modules/univention/updater/mirror.py >@@ -39,6 +39,7 @@ import itertools > import logging > from operator import itemgetter > from debian.deb822 import Packages >+from apt import apt_pkg > > from tools import UniventionUpdater, UCS_Version, NullHandler > try: >@@ -274,11 +275,26 @@ class UniventionMirror( UniventionUpdater ): > > def _compress(self, filename): > self.log.debug('Compressing %s ...', filename) >- subprocess.call( >+ sorter = subprocess.Popen( >+ ('apt-sortpkgs', filename), >+ stdout=subprocess.PIPE, >+ ) >+ compressor = subprocess.Popen( > ('gzip',), >- stdin=open(filename, 'rb'), >+ stdin=subprocess.PIPE, > stdout=open(filename + '.gz', 'wb'), > ) >+ prev = None >+ for pkg in Packages.iter_paragraphs(sorter.stdout): >+ if prev: >+ if prev["Package"] != pkg["Package"]: >+ compressor.stdin.write("%s\n" % prev) >+ elif apt_pkg.version_compare(prev["Version"], pkg["Version"]) >= 0: >+ continue >+ prev = pkg >+ if prev: >+ compressor.stdin.write("%s\n" % prev) >+ compressor.stdin.close() > > def _release(self, outdir, dist, archs, version): > rel_name = os.path.join(outdir, 'dists', dist, 'Release') >diff --git a/branches/ucs-4.1/ucs-4.1-1/base/univention-updater/modules/univention/updater/mirror.py b/branches/ucs-4.1/ucs-4.1-1/base/univention-updater/modules/univention/updater/mirror.py >index 9abf547..bdf5988 100644 >--- a/branches/ucs-4.1/ucs-4.1-1/base/univention-updater/modules/univention/updater/mirror.py >+++ b/branches/ucs-4.1/ucs-4.1-1/base/univention-updater/modules/univention/updater/mirror.py >@@ -39,6 +39,7 @@ import itertools > import logging > from operator import itemgetter > from debian.deb822 import Packages >+from apt import apt_pkg > > from tools import UniventionUpdater, NullHandler > from ucs_version import UCS_Version >@@ -275,11 +276,26 @@ class UniventionMirror(UniventionUpdater): > > def _compress(self, filename): > self.log.debug('Compressing %s ...', filename) >- subprocess.call( >+ sorter = subprocess.Popen( >+ ('apt-sortpkgs', filename), >+ stdout=subprocess.PIPE, >+ ) >+ compressor = subprocess.Popen( > ('gzip',), >- stdin=open(filename, 'rb'), >+ stdin=subprocess.PIPE, > stdout=open(filename + '.gz', 'wb'), > ) >+ prev = None >+ for pkg in Packages.iter_paragraphs(sorter.stdout): >+ if prev: >+ if prev["Package"] != pkg["Package"]: >+ compressor.stdin.write("%s\n" % prev) >+ elif apt_pkg.version_compare(prev["Version"], pkg["Version"]) >= 0: >+ continue >+ prev = pkg >+ if prev: >+ compressor.stdin.write("%s\n" % prev) >+ compressor.stdin.close() > > def _release(self, outdir, dist, archs, version): > rel_name = os.path.join(outdir, 'dists', dist, 'Release')
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 40932
:
7552
|
7553