Merge lp:~salgado/linaro-image-tools/remove-unneeded-code into lp:linaro-image-tools/11.11

Proposed by Guilherme Salgado
Status: Merged
Merged at revision: 240
Proposed branch: lp:~salgado/linaro-image-tools/remove-unneeded-code
Merge into: lp:linaro-image-tools/11.11
Diff against target: 70 lines (+0/-30)
3 files modified
linaro-media-create (+0/-3)
linaro_media_create/remove_binary_dir.py (+0/-11)
linaro_media_create/tests/test_media_create.py (+0/-16)
To merge this branch: bzr merge lp:~salgado/linaro-image-tools/remove-unneeded-code
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+46329@code.launchpad.net

Description of the change

We used to unpack the binary tarball on the current working dir so we had some
code to remove any directory named 'binary' under the current working
directory before unpacking. As we now unpack it on a temp dir which is removed
when the script exits, we no longer need that code.

To post a comment you must log in.
Revision history for this message
James Westby (james-w) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'linaro-media-create'
2--- linaro-media-create 2011-01-13 00:00:49 +0000
3+++ linaro-media-create 2011-01-14 20:39:08 +0000
4@@ -19,7 +19,6 @@
5 setup_partitions,
6 )
7 from linaro_media_create.populate_boot import populate_boot
8-from linaro_media_create.remove_binary_dir import remove_dir
9 from linaro_media_create.rootfs import populate_rootfs
10 from linaro_media_create.unpack_binary_tarball import unpack_binary_tarball
11 from linaro_media_create import get_args_parser
12@@ -85,8 +84,6 @@
13 # All good, move on.
14 pass
15
16- # TODO: Combine these two into a single function.
17- remove_dir(ROOTFS_DIR)
18 unpack_binary_tarball(args.binary, TMP_DIR)
19
20 hwpacks = args.hwpacks
21
22=== removed file 'linaro_media_create/remove_binary_dir.py'
23--- linaro_media_create/remove_binary_dir.py 2011-01-11 21:26:54 +0000
24+++ linaro_media_create/remove_binary_dir.py 1970-01-01 00:00:00 +0000
25@@ -1,11 +0,0 @@
26-import os.path
27-
28-from linaro_media_create import cmd_runner
29-
30-
31-def remove_dir(directory, as_root=True):
32- if os.path.exists(directory):
33- proc = cmd_runner.run(['rm', '-rf', directory], as_root=as_root)
34- proc.wait()
35- return proc.returncode
36- return 0
37
38=== modified file 'linaro_media_create/tests/test_media_create.py'
39--- linaro_media_create/tests/test_media_create.py 2011-01-13 00:00:49 +0000
40+++ linaro_media_create/tests/test_media_create.py 2011-01-14 20:39:08 +0000
41@@ -49,7 +49,6 @@
42 run_sfdisk_commands,
43 setup_partitions,
44 )
45-from linaro_media_create.remove_binary_dir import remove_dir
46 from linaro_media_create.rootfs import (
47 create_flash_kernel_config,
48 has_space_left_for_swap,
49@@ -153,21 +152,6 @@
50 self.assertEqual(expected, boot_cmd)
51
52
53-class TestRemoveBinaryDir(TestCaseWithFixtures):
54-
55- def setUp(self):
56- super(TestRemoveBinaryDir, self).setUp()
57- self.temp_dir_fixture = CreateTempDirFixture()
58- self.useFixture(self.temp_dir_fixture)
59-
60- def test_remove_dir(self):
61- rc = remove_dir(
62- self.temp_dir_fixture.get_temp_dir(), as_root=False)
63- self.assertEqual(rc, 0)
64- self.assertFalse(
65- os.path.exists(self.temp_dir_fixture.get_temp_dir()))
66-
67-
68 class TestUnpackBinaryTarball(TestCaseWithFixtures):
69
70 def setUp(self):

Subscribers

People subscribed via source and target branches