Merge lp://staging/keryx/unstable into lp://staging/~jacseen/keryx/unstable
- unstable
- Merge into unstable
Proposed by
mac9416
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp://staging/keryx/unstable |
Merge into: | lp://staging/~jacseen/keryx/unstable |
Diff against target: |
259 lines (+76/-30) 3 files modified
doc/keryx.conf (+1/-1) lib/wxkeryx/main.py (+61/-27) plugins/Debian.py (+14/-2) |
To merge this branch: | bzr merge lp://staging/keryx/unstable |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jack N | Approve | ||
mac9416 (community) | Needs Fixing | ||
Review via email: mp+15066@code.staging.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
mac9416 (mac9416) wrote : | # |
Revision history for this message
mac9416 (mac9416) wrote : | # |
It appears I broke one or two lines. I can fix them and resubmit if you want, or you can merge and fix them yourself. Your call. :)
review:
Needs Fixing
Revision history for this message
Jack N (jacseen) wrote : | # |
Not sure which lines you broke, but looks good and runs good. :D
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'doc/keryx.conf' | |||
2 | --- doc/keryx.conf 2009-10-31 01:55:19 +0000 | |||
3 | +++ doc/keryx.conf 2009-11-25 03:06:10 +0000 | |||
4 | @@ -10,7 +10,7 @@ | |||
5 | 10 | #### Examples #### | 10 | #### Examples #### |
6 | 11 | 11 | ||
7 | 12 | #LogDir=../logs | 12 | #LogDir=../logs |
9 | 13 | #LocaleDir=../locales | 13 | #LocaleDir=../locale |
10 | 14 | #PackagesDir=../packages | 14 | #PackagesDir=../packages |
11 | 15 | #PixmapsDir=../pixmaps | 15 | #PixmapsDir=../pixmaps |
12 | 16 | #PluginsDir=../plugins | 16 | #PluginsDir=../plugins |
13 | 17 | 17 | ||
14 | === modified file 'lib/wxkeryx/main.py' | |||
15 | --- lib/wxkeryx/main.py 2009-11-18 03:56:58 +0000 | |||
16 | +++ lib/wxkeryx/main.py 2009-11-25 03:06:10 +0000 | |||
17 | @@ -42,7 +42,7 @@ | |||
18 | 42 | self.downloadButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_download), _("Download"))#, size=(95, 25)) | 42 | self.downloadButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_download), _("Download"))#, size=(95, 25)) |
19 | 43 | self.updatesButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_updates), _("Get Updates"))#, size=(95, 25)) | 43 | self.updatesButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_updates), _("Get Updates"))#, size=(95, 25)) |
20 | 44 | self.refreshButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_refresh), _("Refresh"))#, size=(95, 25)) | 44 | self.refreshButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_refresh), _("Refresh"))#, size=(95, 25)) |
22 | 45 | self.updateStatusButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_refresh), _("Update Status"))#, size=(95, 25)) | 45 | #self.updateStatusButton = buttons.GenBitmapTextButton(self.buttonPanel, -1, wx.Bitmap(consts.icon_refresh), _("Update Status"))#, size=(95, 25)) |
23 | 46 | 46 | ||
24 | 47 | self.notebook_il = wx.ImageList(16, 16) | 47 | self.notebook_il = wx.ImageList(16, 16) |
25 | 48 | self.notebook_il.Add(wx.Bitmap(consts.icon_project_details)) | 48 | self.notebook_il.Add(wx.Bitmap(consts.icon_project_details)) |
26 | @@ -171,7 +171,7 @@ | |||
27 | 171 | 171 | ||
28 | 172 | self.Bind(wx.EVT_BUTTON, self.OnDownload, self.downloadButton) | 172 | self.Bind(wx.EVT_BUTTON, self.OnDownload, self.downloadButton) |
29 | 173 | self.Bind(wx.EVT_BUTTON, self.OnRefresh, self.refreshButton) | 173 | self.Bind(wx.EVT_BUTTON, self.OnRefresh, self.refreshButton) |
31 | 174 | self.Bind(wx.EVT_BUTTON, self.OnUpdateStatus, self.updateStatusButton) | 174 | #self.Bind(wx.EVT_BUTTON, self.OnUpdateStatus, self.updateStatusButton) |
32 | 175 | self.Bind(wx.EVT_BUTTON, self.OnUpdates, self.updatesButton) | 175 | self.Bind(wx.EVT_BUTTON, self.OnUpdates, self.updatesButton) |
33 | 176 | self.Bind(wx.EVT_CLOSE, self.Closing) | 176 | self.Bind(wx.EVT_CLOSE, self.Closing) |
34 | 177 | 177 | ||
35 | @@ -194,7 +194,7 @@ | |||
36 | 194 | sizer_buttons.Add(self.downloadButton, 0, wx.ALL, 3) | 194 | sizer_buttons.Add(self.downloadButton, 0, wx.ALL, 3) |
37 | 195 | sizer_buttons.Add(self.updatesButton, 0, wx.ALL, 3) | 195 | sizer_buttons.Add(self.updatesButton, 0, wx.ALL, 3) |
38 | 196 | sizer_buttons.Add(self.refreshButton, 0, wx.ALL, 3) | 196 | sizer_buttons.Add(self.refreshButton, 0, wx.ALL, 3) |
40 | 197 | sizer_buttons.Add(self.updateStatusButton, 0, wx.ALL, 3) | 197 | #sizer_buttons.Add(self.updateStatusButton, 0, wx.ALL, 3) |
41 | 198 | #sizer_bottom.Add(sizer_buttons, 0, wx.ALIGN_CENTER_VERTICAL, 0) | 198 | #sizer_bottom.Add(sizer_buttons, 0, wx.ALIGN_CENTER_VERTICAL, 0) |
42 | 199 | self.buttonPanel.SetSizer(sizer_buttons) | 199 | self.buttonPanel.SetSizer(sizer_buttons) |
43 | 200 | 200 | ||
44 | @@ -303,24 +303,22 @@ | |||
45 | 303 | try: | 303 | try: |
46 | 304 | selected = self.list.GetSelectedItem() | 304 | selected = self.list.GetSelectedItem() |
47 | 305 | if selected: files = project.projects[len(project.projects) - 1].getDependencies(selected[1]) | 305 | if selected: files = project.projects[len(project.projects) - 1].getDependencies(selected[1]) |
49 | 306 | except: return | 306 | except: |
50 | 307 | return | ||
51 | 307 | 308 | ||
59 | 308 | # Generate filename list, max 6 entries | 309 | # Generate filename list. |
60 | 309 | list = "\n\n" | 310 | list = "" |
61 | 310 | for i in range(len(files)): | 311 | for i in range(len(files)): |
62 | 311 | if i <= 5: list += files[i][0] + "\n" | 312 | list += files[i][0] + "\n" |
56 | 312 | else: | ||
57 | 313 | list += "..." | ||
58 | 314 | break | ||
63 | 315 | 313 | ||
64 | 316 | # Confirm downloads | 314 | # Confirm downloads |
68 | 317 | dlg = wx.MessageDialog(None, _("Do you wish to download the following") + " " + str(len(files)) + " " + _("files?") + list, | 315 | dlg = ScrolledMessageDialog(None, _("Confirm Download"), _("Do you wish to download the following") + " " + str(len(files)) + " " + _("files?"), list) |
69 | 318 | _("Confirm Downloads"), wx.YES_NO | wx.ICON_QUESTION) | 316 | #dlg = wx.MessageDialog(None, _("Do you wish to download the following") + " " + str(len(files)) + " " + _("files?") + list, _("Confirm Downloads"), wx.YES_NO | wx.ICON_QUESTION) |
70 | 319 | result = dlg.ShowModal() | 317 | result = dlg.ShowModal() == wx.ID_OK |
71 | 320 | dlg.Destroy() | 318 | dlg.Destroy() |
72 | 321 | 319 | ||
73 | 322 | # User doesn't want to download them | 320 | # User doesn't want to download them |
75 | 323 | if result == wx.ID_NO: | 321 | if not result: |
76 | 324 | self.Refresh(project.projects[len(project.projects) -1].GetData()) | 322 | self.Refresh(project.projects[len(project.projects) -1].GetData()) |
77 | 325 | #self.downloadedLists() | 323 | #self.downloadedLists() |
78 | 326 | return | 324 | return |
79 | @@ -371,7 +369,7 @@ | |||
80 | 371 | else: | 369 | else: |
81 | 372 | move = False | 370 | move = False |
82 | 373 | #wx.MessageBox(_("This feature is not implemented yet. Sorry."),_("Not Implemented")) | 371 | #wx.MessageBox(_("This feature is not implemented yet. Sorry."),_("Not Implemented")) |
84 | 374 | install = project.projects[len(project.projects) - 1].installCache(project.projects[len(project.projects) -1].dir, 'installcache', move=move) | 372 | install = project.projects[len(project.projects) - 1].plugin.installCache(project.projects[len(project.projects) -1].dir, 'installcache', move=move) |
85 | 375 | elif result == wx.ID_NO: | 373 | elif result == wx.ID_NO: |
86 | 376 | wx.MessageBox(_("This feature is not implemented yet. Sorry."),_("Not Implemented")) | 374 | wx.MessageBox(_("This feature is not implemented yet. Sorry."),_("Not Implemented")) |
87 | 377 | #install = project.projects[len(project.projects) - 1].installRepo() | 375 | #install = project.projects[len(project.projects) - 1].installRepo() |
88 | @@ -433,18 +431,22 @@ | |||
89 | 433 | # dlg.Destroy() | 431 | # dlg.Destroy() |
90 | 434 | 432 | ||
91 | 435 | def OnUpdateStatus(self, event): | 433 | def OnUpdateStatus(self, event): |
92 | 434 | dlg = wx.MessageDialog(None, _("This will update the list of packages installed on your computer. Only run this on the computer you created this project on.\n\n" + \ | ||
93 | 435 | "Would you like to continue?"), | ||
94 | 436 | _("Update Status"), wx.YES_NO | wx.ICON_QUESTION) | ||
95 | 437 | result = dlg.ShowModal() | ||
96 | 438 | dlg.Destroy() | ||
97 | 439 | if not result: | ||
98 | 440 | return | ||
99 | 436 | if not self.UpdateStatus(): | 441 | if not self.UpdateStatus(): |
101 | 437 | print 'Could not update status file. Not on a Debian machine?' | 442 | dlg = wx.MessageDialog(None, _("Status update failed. Try running Keryx as root (using 'sudo')."), |
102 | 443 | _("Status Update Failed"), wx.ICON_ERROR) | ||
103 | 444 | result = dlg.ShowModal() | ||
104 | 445 | dlg.Destroy() | ||
105 | 438 | def UpdateStatus(self): | 446 | def UpdateStatus(self): |
115 | 439 | import shutil | 447 | project_dir = project.projects[len(project.projects) -1].dir |
116 | 440 | project_dir = project.projects[len(project.projects) -1].GetData()[1] | 448 | return project.projects[len(project.projects) - 1].plugin.updateStatus(project_dir) |
117 | 441 | lists_dir = os.path.join(project_dir, 'lists') | 449 | |
109 | 442 | try: | ||
110 | 443 | shutil.copyfile('/var/lib/dpkg/status', os.path.join(lists_dir, 'status')) | ||
111 | 444 | shutil.copyfile('/var/lib/dpkg/status', os.path.join(lists_dir, 'status.bak')) | ||
112 | 445 | return True # Everything went well. | ||
113 | 446 | except IOError: | ||
114 | 447 | return False | ||
118 | 448 | 450 | ||
119 | 449 | def OnRefresh(self, event): | 451 | def OnRefresh(self, event): |
120 | 450 | self.Refresh(project.projects[len(project.projects) -1].GetData()) | 452 | self.Refresh(project.projects[len(project.projects) -1].GetData()) |
121 | @@ -489,4 +491,36 @@ | |||
122 | 489 | 491 | ||
123 | 490 | self.SetStatusText(str(len(proj.packages.keys())) + " " + _("Packages"),0) | 492 | self.SetStatusText(str(len(proj.packages.keys())) + " " + _("Packages"),0) |
124 | 491 | 493 | ||
126 | 492 | # end of class MainApp | 494 | # end of class MainApp |
127 | 495 | |||
128 | 496 | # Begin mac9416's wonderful custom dialog! | ||
129 | 497 | |||
130 | 498 | class ScrolledMessageDialog(wx.Dialog): | ||
131 | 499 | def __init__(self, parent, title, caption, msg, | ||
132 | 500 | pos=wx.DefaultPosition, size=(500,300), | ||
133 | 501 | style=wx.DEFAULT_DIALOG_STYLE): | ||
134 | 502 | wx.Dialog.__init__(self, parent, -1, title, pos, size, style) | ||
135 | 503 | x, y = pos | ||
136 | 504 | if x == -1 and y == -1: | ||
137 | 505 | self.CenterOnScreen(wx.BOTH) | ||
138 | 506 | |||
139 | 507 | text1 = wx.StaticText(self, -1, caption) | ||
140 | 508 | text2 = wx.TextCtrl(self, -1, msg, size=(500,300), | ||
141 | 509 | style=wx.TE_MULTILINE | wx.TE_READONLY) | ||
142 | 510 | |||
143 | 511 | sizer = wx.BoxSizer(wx.VERTICAL) | ||
144 | 512 | |||
145 | 513 | btnsizer = wx.BoxSizer() | ||
146 | 514 | |||
147 | 515 | btn = wx.Button(self, wx.ID_OK, "Yes") | ||
148 | 516 | btnsizer.Add(btn, 0, wx.ALL, 5) | ||
149 | 517 | btnsizer.Add((5,-1), 0, wx.ALL, 5) | ||
150 | 518 | |||
151 | 519 | btn = wx.Button(self, wx.ID_CANCEL, "No") | ||
152 | 520 | btn.SetDefault() | ||
153 | 521 | btnsizer.Add(btn, 0, wx.ALL, 5) | ||
154 | 522 | |||
155 | 523 | sizer.Add(text1, 0, wx.EXPAND|wx.ALL, 5) | ||
156 | 524 | sizer.Add(text2, 0, wx.EXPAND|wx.ALL, 5) | ||
157 | 525 | sizer.Add(btnsizer, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5) | ||
158 | 526 | self.SetSizerAndFit(sizer) | ||
159 | 493 | 527 | ||
160 | === added directory 'locale' | |||
161 | === added directory 'locale/ar' | |||
162 | === added directory 'locale/ar/LC_MESSAGES' | |||
163 | === added file 'locale/ar/LC_MESSAGES/keryx.mo' | |||
164 | 494 | Binary files locale/ar/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/ar/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 528 | Binary files locale/ar/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/ar/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
165 | === added directory 'locale/cs' | |||
166 | === added directory 'locale/cs/LC_MESSAGES' | |||
167 | === added file 'locale/cs/LC_MESSAGES/keryx.mo' | |||
168 | 495 | Binary files locale/cs/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/cs/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 529 | Binary files locale/cs/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/cs/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
169 | === added directory 'locale/en_CA' | |||
170 | === added directory 'locale/en_CA/LC_MESSAGES' | |||
171 | === added file 'locale/en_CA/LC_MESSAGES/keryx.mo' | |||
172 | 496 | Binary files locale/en_CA/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/en_CA/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 530 | Binary files locale/en_CA/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/en_CA/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
173 | === added directory 'locale/es' | |||
174 | === added directory 'locale/es/LC_MESSAGES' | |||
175 | === added file 'locale/es/LC_MESSAGES/keryx.mo' | |||
176 | 497 | Binary files locale/es/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/es/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 531 | Binary files locale/es/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/es/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
177 | === added directory 'locale/fr' | |||
178 | === added directory 'locale/fr/LC_MESSAGES' | |||
179 | === added file 'locale/fr/LC_MESSAGES/keryx.mo' | |||
180 | 498 | Binary files locale/fr/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/fr/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 532 | Binary files locale/fr/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/fr/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
181 | === added directory 'locale/id' | |||
182 | === added directory 'locale/id/LC_MESSAGES' | |||
183 | === added file 'locale/id/LC_MESSAGES/keryx.mo' | |||
184 | 499 | Binary files locale/id/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/id/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 533 | Binary files locale/id/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/id/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
185 | === added directory 'locale/ml' | |||
186 | === added directory 'locale/ml/LC_MESSAGES' | |||
187 | === added file 'locale/ml/LC_MESSAGES/keryx.mo' | |||
188 | 500 | Binary files locale/ml/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/ml/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 534 | Binary files locale/ml/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/ml/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
189 | === added directory 'locale/nb' | |||
190 | === added directory 'locale/nb/LC_MESSAGES' | |||
191 | === added file 'locale/nb/LC_MESSAGES/keryx.mo' | |||
192 | 501 | Binary files locale/nb/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/nb/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 535 | Binary files locale/nb/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/nb/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
193 | === added directory 'locale/pt' | |||
194 | === added directory 'locale/pt/LC_MESSAGES' | |||
195 | === added file 'locale/pt/LC_MESSAGES/keryx.mo' | |||
196 | 502 | Binary files locale/pt/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/pt/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 536 | Binary files locale/pt/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/pt/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
197 | === added directory 'locale/pt_BR' | |||
198 | === added directory 'locale/pt_BR/LC_MESSAGES' | |||
199 | === added file 'locale/pt_BR/LC_MESSAGES/keryx.mo' | |||
200 | 503 | Binary files locale/pt_BR/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/pt_BR/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 537 | Binary files locale/pt_BR/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/pt_BR/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
201 | === added directory 'locale/ru' | |||
202 | === added directory 'locale/ru/LC_MESSAGES' | |||
203 | === added file 'locale/ru/LC_MESSAGES/keryx.mo' | |||
204 | 504 | Binary files locale/ru/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/ru/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 538 | Binary files locale/ru/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/ru/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
205 | === added directory 'locale/si' | |||
206 | === added directory 'locale/si/LC_MESSAGES' | |||
207 | === added file 'locale/si/LC_MESSAGES/keryx.mo' | |||
208 | 505 | Binary files locale/si/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/si/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 539 | Binary files locale/si/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/si/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
209 | === added directory 'locale/sv' | |||
210 | === added directory 'locale/sv/LC_MESSAGES' | |||
211 | === added file 'locale/sv/LC_MESSAGES/keryx.mo' | |||
212 | 506 | Binary files locale/sv/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/sv/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 540 | Binary files locale/sv/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/sv/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
213 | === added directory 'locale/th' | |||
214 | === added directory 'locale/th/LC_MESSAGES' | |||
215 | === added file 'locale/th/LC_MESSAGES/keryx.mo' | |||
216 | 507 | Binary files locale/th/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/th/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ | 541 | Binary files locale/th/LC_MESSAGES/keryx.mo 1970-01-01 00:00:00 +0000 and locale/th/LC_MESSAGES/keryx.mo 2009-11-25 03:06:10 +0000 differ |
217 | === modified file 'plugins/Debian.py' | |||
218 | --- plugins/Debian.py 2009-11-18 03:56:58 +0000 | |||
219 | +++ plugins/Debian.py 2009-11-25 03:06:10 +0000 | |||
220 | @@ -258,7 +258,7 @@ | |||
221 | 258 | else: | 258 | else: |
222 | 259 | transfer='' | 259 | transfer='' |
223 | 260 | print 'Launching installCache script as root' | 260 | print 'Launching installCache script as root' |
225 | 261 | run = __runRoot('sh', scriptpath+' '+projdir+' '+transfer) | 261 | run = self.__runRoot('sh', scriptpath+' '+projdir+' '+transfer) |
226 | 262 | if run[0] != 0: | 262 | if run[0] != 0: |
227 | 263 | print run[1] | 263 | print run[1] |
228 | 264 | if run[0] == 64: | 264 | if run[0] == 64: |
229 | @@ -281,6 +281,18 @@ | |||
230 | 281 | """ Transfers all downloaded packages into a Repository and updates the OS about it, then tells it to install them. Uses script called as 'root'""" | 281 | """ Transfers all downloaded packages into a Repository and updates the OS about it, then tells it to install them. Uses script called as 'root'""" |
231 | 282 | return True | 282 | return True |
232 | 283 | 283 | ||
233 | 284 | def updateStatus(self, outdir, infile="/var/lib/dpkg/status"): | ||
234 | 285 | """Update the project's status file (list of installed packages)""" | ||
235 | 286 | import shutil | ||
236 | 287 | lists_dir = os.path.join(outdir, 'lists') | ||
237 | 288 | outfile = os.path.join(lists_dir, "status") | ||
238 | 289 | outfilebak = os.path.join(lists_dir, "status.bak") | ||
239 | 290 | # Back up the current status file. | ||
240 | 291 | run = self.__runRoot('cp', '%s %s' % (outfile, outfilebak)) | ||
241 | 292 | # Copy in the new status file. | ||
242 | 293 | run = self.__runRoot('cp', '%s %s' % (infile, outfile)) | ||
243 | 294 | return True # Everything went well. | ||
244 | 295 | |||
245 | 284 | def __readPackages(self, infile, installed, packages, mainUrl=''): | 296 | def __readPackages(self, infile, installed, packages, mainUrl=''): |
246 | 285 | # up-to-date, name, installed ver, latest ver, descrip, depends, filename, size(int) | 297 | # up-to-date, name, installed ver, latest ver, descrip, depends, filename, size(int) |
247 | 286 | current = ['','','','','','','','','',''] | 298 | current = ['','','','','','','','','',''] |
248 | @@ -450,7 +462,7 @@ | |||
249 | 450 | root = a | 462 | root = a |
250 | 451 | break | 463 | break |
251 | 452 | if root == '': return 64, '' | 464 | if root == '': return 64, '' |
253 | 453 | exit = commands.getstatusoutput(root+' '+program+' '+filename) | 465 | exit = commands.getstatusoutput('%s %s %s' % (root, program, filename)) |
254 | 454 | return exit | 466 | return exit |
255 | 455 | 467 | ||
256 | 456 | class version_compare: | 468 | class version_compare: |
257 | 457 | 469 | ||
258 | === modified file 'projects/jaunty-32-bit-default/lists/status' (properties changed: +x to -x) | |||
259 | === modified file 'projects/jaunty-32-bit-default/sources/sources.list' (properties changed: +x to -x) |
Hey, jacseen, I made a few improvements to the Update Status feature. It now uses your __runRoot function. Hopefully this doesn't conflict with any of your recent changes.