|
Page 1 of 2 |
|
1
2
|
Next
aptly - an apt-get/apt-cache/dpkg wrapper
update 6
-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: Code:
aptly -i pkg1,pkg2,pkg3Code:
aptly -i pkg1 pkg2 pkg3- help command is a bit more detailed: http://img695.imageshack.us/img695/1...2x542sc.th.png 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 http://img259.imageshack.us/img259/8...2x568sc.th.png Here is a comparison of doing things with aptly versus pure apt tools: Update & Upgrade Code:
# old wayCode:
# old wayCode:
# old wayCode:
python ./aptly -i some_appupdate 1 You can now string commands together. A common use-case is that something like: Code:
apt-get update && apt-get install appCode:
aptly --upgrade --install vimCode:
aptly -ui vimAs 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:
|
Re: aptly - an apt-get/apt-cache/dpkg wrapper
For the first point it will only work if the application is in your $PATH.. /usr/bin, /bin, /opt/bin/, etc..
You should be able to run the command like "./aptly" if its in the same directory you're in. I know theres a way to get a the repo info.. still looking. Things like "apt-cache show package_name" give a ton of information including version, and section (the control file), but doesn't list repo. Interesting. |
Re: aptly - an apt-get/apt-cache/dpkg wrapper
Quote:
This works fine for me as the first line in a python executable which runs without prefixing "python" on the command line: Code:
#!/usr/bin/python----------------------------------- Edit: ...and what fatalsaint said. |
Re: aptly - an apt-get/apt-cache/dpkg wrapper
Quote:
I already had the "#!/usr/bin/env python" at the top of my script. |
Re: aptly - an apt-get/apt-cache/dpkg wrapper
apt-cache showpkg package_name
Gives information such as: Quote:
|
Re: aptly - an apt-get/apt-cache/dpkg wrapper
Quote:
|
Re: aptly - an apt-get/apt-cache/dpkg wrapper
I was trying to sanitize output, however it seems as though apt-get, etc automatically buffer output when it detects it is being run through a pipe, which means that I have to wait until the app is done executing before I can capture output (as opposed to doing it real time). The result is that trying to do so makes aplty feel sluggish. As such, I've decided to just keep each respective program's output untouched.
Anyways, it's working now, and I'll update the first post with the code, screenshots, and a screencast showing its flexibility (or at least my laziness) |
Re: aptly - an apt-get/apt-cache/dpkg wrapper
Well, I cant seem to get the --cache command to work.
How it is supposed to work is that you evoke it like such: Code:
aptly --cache --install some_packageThe equivalent in plain old apt-get is this: Code:
apt-get -o dir::cache::archives="/home/user/.config/aptly/cache" install some_packageI am trying to evoke it using python's subprocess: Code:
command = ["apt-get", "-o", "dir::cache::archives="/home/user/.config/aptly/cache"", "install", "some_package"]Code:
E: could not open lock file /var/cache/apt/" /home/user/.config/aptly/cache/" /lock - open (2 no such file or directory |
Re: aptly - an apt-get/apt-cache/dpkg wrapper
I'm assuming its your quotes. You have quotes within quotes in your app. I suggest one of the following:
Code:
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"] |
Re: aptly - an apt-get/apt-cache/dpkg wrapper
Quote:
Turns out that the -o produced some kind of anomaly. I finally got it to work ,but I had to use an alternate syntax for call: Code:
# instead of thisAnyways, it is now possible to install to a different cache directory (defaulting to home if not is specified with the -C/--cache option or the system default if the option is omitted) :-) I also added options to (auto)clean. I still need to test for regressions before I release this, but it's starting to shape up pretty nicely I think. |
| All times are GMT. The time now is 12:28. |
Page 1 of 2 |
|
1
2
|
Next
vBulletin® Version 3.8.8