The Following 2 Users Say Thank You to aspidites For This Useful Post: | ||
|
2009-12-24
, 05:21
|
Posts: 3,428 |
Thanked: 2,856 times |
Joined on Jul 2008
|
#2
|
The Following User Says Thank You to fatalsaint For This Useful Post: | ||
|
2009-12-24
, 05:22
|
Posts: 65 |
Thanked: 21 times |
Joined on Feb 2008
|
#3
|
...you can run it without actually prefixing it with the interpreter (ie "aptly" instead of "python aptly". I can't seem to do this on my N900.
#!/usr/bin/python
|
2009-12-24
, 05:24
|
Posts: 402 |
Thanked: 229 times |
Joined on Nov 2009
@ Missouri, USA
|
#4
|
For the first point it will only work if the application is in your $PATH.. /usr/bin, /bin, /opt/bin/, etc..
|
2009-12-24
, 05:25
|
Posts: 3,428 |
Thanked: 2,856 times |
Joined on Jul 2008
|
#5
|
2:1.0~rc3+svn20090426-1ubuntu10.1 (/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_karmic-updates_multiverse_binary-amd64_Packages) (/var/lib/dpkg/status)
Description Language:
File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_karmic-updates_multiverse_binary-amd64_Packages
MD5: c765aa48044329115354123039018b09
2:1.0~rc3+svn20090426-1ubuntu10 (/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_karmic_multiver se_binary-amd64_Packages)
Description Language:
File: /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_karmic_multiver se_binary-amd64_Packages
MD5: c765aa48044329115354123039018b09
The Following User Says Thank You to fatalsaint For This Useful Post: | ||
|
2009-12-24
, 05:33
|
Posts: 402 |
Thanked: 229 times |
Joined on Nov 2009
@ Missouri, USA
|
#6
|
|
2009-12-25
, 02:17
|
Posts: 402 |
Thanked: 229 times |
Joined on Nov 2009
@ Missouri, USA
|
#7
|
|
2009-12-27
, 04:08
|
Posts: 402 |
Thanked: 229 times |
Joined on Nov 2009
@ Missouri, USA
|
#8
|
aptly --cache --install some_package # or aplty --cache some_directory --install some_package
apt-get -o dir::cache::archives="/home/user/.config/aptly/cache" install some_package
command = ["apt-get", "-o", "dir::cache::archives="/home/user/.config/aptly/cache"", "install", "some_package"] subprocess.call(command)
E: could not open lock file /var/cache/apt/" /home/user/.config/aptly/cache/" /lock - open (2 no such file or directory
|
2009-12-27
, 04:11
|
Posts: 3,428 |
Thanked: 2,856 times |
Joined on Jul 2008
|
#9
|
command = ["apt-get", "-o", "dir::cache::archives=\"/home/user/.config/aptly/cache\"", "install", "some_package"]
command = ["apt-get", "-o", 'dir::cache::archives="/home/user/.config/aptly/cache"', "install", "some_package"]
|
2009-12-27
, 04:46
|
Posts: 402 |
Thanked: 229 times |
Joined on Nov 2009
@ Missouri, USA
|
#10
|
I'm assuming its your quotes. You have quotes within quotes in your app. I suggest one of the following:
orCode:command = ["apt-get", "-o", "dir::cache::archives=\"/home/user/.config/aptly/cache\"", "install", "some_package"]
Code:command = ["apt-get", "-o", 'dir::cache::archives="/home/user/.config/aptly/cache"', "install", "some_package"]
# instead of this call([command, arg1, arg2]) # I had to use this: call("command arg1 arg2", shell=True")
-fixed bug mentioned before about option order.
-created topic in Applications to see if this is worth distributing
-all changes from now on will be in aptly/CHANGES from now on
update 5
- regression. re-factoring the code as I have caused some options to be evaluated in th e wrong order. This will be fixed in the next version (in particular --install and --update
- packaging seems to be a lot of work. I will announce this in Applications and if there is enough generated interest I'll officially package it.
update 4
- re-factored/cleaned code
- syntax is more apt-get like in that instead of having to type:
- help command is a bit more detailed:
I'm thinking about packaging this shortly and maybe even pushinging to maemo-devel.
update 3
- experimental support for dependency handling for local *.deb files added.
- added todo list and licensing.
update 2
I finally got the basics down (after sacrificing some initial features), and I rather like it. It's a command line app, so there isn't much to screenshot, but here it is anyways
Here is a comparison of doing things with aptly versus pure apt tools:
Update & Upgrade
update 1
You can now string commands together. A common use-case is that something like:
As the title suggests, I'm writing an apt-get, apt-cache, and dpkg wrapper in python called aptly. In addition to being a learning exercise, I wanted a way to consolidate the functions of all of these programs into one tool.
Here is a screencast of it in it's primitive state.
I am however running into the following problems:
On most systems, as long as you set the executable flag on a file and have the appropriate header, you can run it without actually prefixing it with the interpreter (ie "aptly" instead of "python aptly". I can't seem to do this on my N900.(thanks fatalsaint)I can't seem to find a command that will allow me to distinguish from which repo/catalog an app came from. I would use this information to allow a user to specify from which rep/catalog a piece of software comes from.short of disabling and reenabling repos manually, this doesn't seem to be something that apt does nativelyI have noticed that modifications to /etc/apt/sources.list.d/hildon-application-manager.list by hand don't seem to appear in App.manager.filed a bug report, but doubt it'll get looked into any time soonaspidites | blog | aspidites@inbox.com
Last edited by aspidites; 2009-12-26 at 04:15.