Merge lp:~ubuntu-branches/ubuntu/utopic/apt-clone/utopic-201408202222 into lp:ubuntu/utopic/apt-clone

Proposed by Ubuntu Package Importer
Status: Needs review
Proposed branch: lp:~ubuntu-branches/ubuntu/utopic/apt-clone/utopic-201408202222
Merge into: lp:ubuntu/utopic/apt-clone
Diff against target: 55 lines (+51/-0)
1 file modified
tests/test_lp1309447.py (+51/-0)
To merge this branch: bzr merge lp:~ubuntu-branches/ubuntu/utopic/apt-clone/utopic-201408202222
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+231641@code.launchpad.net

Description of the change

The package importer has detected a possible inconsistency between the package history in the archive and the history in bzr. As the archive is authoritative the importer has made lp:ubuntu/utopic/apt-clone reflect what is in the archive and the old bzr branch has been pushed to lp:~ubuntu-branches/ubuntu/utopic/apt-clone/utopic-201408202222. This merge proposal was created so that an Ubuntu developer can review the situations and perform a merge/upload if necessary. There are three typical cases where this can happen.
  1. Where someone pushes a change to bzr and someone else uploads the package without that change. This is the reason that this check is done by the importer. If this appears to be the case then a merge/upload should be done if the changes that were in bzr are still desirable.
  2. The importer incorrectly detected the above situation when someone made a change in bzr and then uploaded it.
  3. The importer incorrectly detected the above situation when someone just uploaded a package and didn't touch bzr.

If this case doesn't appear to be the first situation then set the status of the merge proposal to "Rejected" and help avoid the problem in future by filing a bug at https://bugs.launchpad.net/udd linking to this merge proposal.

(this is an automatically generated message)

To post a comment you must log in.

Unmerged revisions

30. By Brian Murray

add in missing test for bug 1309447

29. By Brian Murray

incorporate upstream changes from r146 to r148

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'tests/test_lp1309447.py'
2--- tests/test_lp1309447.py 1970-01-01 00:00:00 +0000
3+++ tests/test_lp1309447.py 2014-08-20 22:30:36 +0000
4@@ -0,0 +1,51 @@
5+#!/usr/bin/python3
6+# -*- coding: utf-8 -*-
7+
8+from __future__ import print_function
9+
10+import os
11+import sys
12+import unittest
13+
14+# this is important
15+os.environ["LANG"] = "C"
16+
17+
18+sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
19+from apt_clone import AptClone
20+
21+
22+class MockTar(object):
23+ def add(self, source, arcname):
24+ with open(source, "rb") as f:
25+ self.data = f.read().decode("utf-8")
26+
27+
28+class TestClone(unittest.TestCase):
29+
30+ def setUp(self):
31+ self.apt_clone = AptClone()
32+ self.test_sources_fname = "test-sources.list"
33+ with open(self.test_sources_fname, "wb") as f:
34+ f.write(u"""# äüö
35+deb http://mvo:secret@archive.u.c/ ubuntu main
36+""".encode("utf-8"))
37+
38+ def tearDown(self):
39+ os.unlink(self.test_sources_fname)
40+
41+ def test_scrub_file_from_passwords(self):
42+ """Regression test for utf8 crash LP: #1309447"""
43+ mock_tar = MockTar()
44+ self.apt_clone._add_file_to_tar_with_password_check(
45+ mock_tar, self.test_sources_fname, scrub=True,
46+ arcname="some-archname")
47+ # see if we got the expected data
48+ self.assertNotIn("mvo:secret", mock_tar.data)
49+ self.assertEqual(mock_tar.data, u"""# äüö
50+deb http://USERNAME:PASSWORD@archive.u.c/ ubuntu main
51+""")
52+
53+
54+if __name__ == "__main__":
55+ unittest.main()

Subscribers

People subscribed via source and target branches

to all changes: