Editing Device management using Bcfg2

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 369: Line 369:
We need to write a "APTlite" client driver. Probably modifying an simple existing driver like <code>FreeBSDPackage.py</code> would do. Some notes about the task:
We need to write a "APTlite" client driver. Probably modifying an simple existing driver like <code>FreeBSDPackage.py</code> would do. Some notes about the task:
-
* <code>RefreshPackages</code> method needs to be modified to include only packages received from server and ignore the rest. Looks like following piece of code generates the list we need
+
* RefreshPackages needs to be modified to include only packages received from server and ignore the rest. Looks like following piece of code generates the list we need
  desired = [entry.get('name') for struct in self.config for entry in struct if entry.tag == 'Package']
  desired = [entry.get('name') for struct in self.config for entry in struct if entry.tag == 'Package']
-
* Then, we could run something like this for each pkg in desired list to fill up the <code>self.installed</code> dictionary:
+
* Then, we could run something like this for each pkg in desired list:
  /usr/bin/dpkg-query -W --showformat='${Version}\t${Status}\n' <pkg>
  /usr/bin/dpkg-query -W --showformat='${Version}\t${Status}\n' <pkg>
-
* <code>VerifyPackage</code> method needs probably to be made a bit more liberal, like returning true if <code>entry.attrib['version']</code> equals <code>'auto'</code>  or <code>'any'</code>
+
* Package verification (VerifyPackage) needs probably to be made even more liberal, like returning true if entry.attrib['version'] is 'auto' or 'any'
* <code>pkgtool</code> could probably be copied from <code>APT.py</code>
* <code>pkgtool</code> could probably be copied from <code>APT.py</code>

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)