apturl-0.5.2ubuntu4/0000775000000000000000000000000012252036013011236 5ustar apturl-0.5.2ubuntu4/data/0000775000000000000000000000000012252036013012147 5ustar apturl-0.5.2ubuntu4/data/apturl.js0000664000000000000000000000054312252035543014025 0ustar pref("network.protocol-handler.app.apt","/usr/bin/apturl"); pref("network.protocol-handler.warn-external.apt",false); pref("network.protocol-handler.app.apt+http","/usr/bin/apturl"); pref("network.protocol-handler.warn-external.apt+http",false); pref("network.protocol-handler.external.apt",true); pref("network.protocol-handler.external.apt+http",true); apturl-0.5.2ubuntu4/data/apturl.desktop0000664000000000000000000000017512252035543015063 0ustar [Desktop Entry] Name=AptURL Exec=apturl %u Type=Application NoDisplay=true Categories=System; MimeType=x-scheme-handler/apt; apturl-0.5.2ubuntu4/data/apturl.schemas.in0000664000000000000000000000257412252035543015447 0ustar /schemas/desktop/gnome/url-handlers/apt/enabled /desktop/gnome/url-handlers/apt/enabled apturl bool true Whether the specified command should handle "apt" URLs True if the command specified in the "command" key should handle "apt" URLs. /schemas/desktop/gnome/url-handlers/apt/command /desktop/gnome/url-handlers/apt/command apturl string apturl "%s" The handler for "apt" URLs The command used to handle "apt" URLs, if enabled. /schemas/desktop/gnome/url-handlers/apt/needs_terminal /desktop/gnome/url-handlers/apt/needs_terminal apturl bool false Run the command in a terminal True if the command used to handle this type of URL should be run in a terminal. apturl-0.5.2ubuntu4/data/apturl-gtk.ui0000664000000000000000000002103212252035543014605 0ustar GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 GTK_WIN_POS_CENTER_ON_PARENT GDK_WINDOW_TYPE_HINT_DIALOG True True 2 True 10 True 0 gtk-dialog-question 6 False True 12 True 0 True False True 0 False 1 True True True True GTK_POLICY_NEVER GTK_POLICY_AUTOMATIC GTK_SHADOW_OUT 400 200 True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False GTK_WRAP_WORD 5 5 True Description 2 1 5 1 True 1 True GTK_JUSTIFY_RIGHT False False 2 True GTK_BUTTONBOX_END True True True True True gtk-cancel True True True True 0 0 True 2 True gtk-save False False True _Install True False False 1 1 False GTK_PACK_END no_button yes_button apturl-0.5.2ubuntu4/data/apturl-qt.ui0000664000000000000000000000354012252035543014450 0ustar mainwidget 0 0 234 68 0 0 Form Qt::Vertical 20 20 Header Body Qt::Vertical 20 20 apturl-0.5.2ubuntu4/data/apt.protocol0000664000000000000000000000026512252035543014530 0ustar [Protocol] exec=apturl %u protocol=apt input=none output=none helper=true listing=false reading=false writing=false makedir=false deleting=false Icon=application-x-deb Class=:local apturl-0.5.2ubuntu4/data/apt+http.protocol0000664000000000000000000000027212252035543015501 0ustar [Protocol] exec=apturl %u protocol=apt+http input=none output=none helper=true listing=false reading=false writing=false makedir=false deleting=false Icon=application-x-deb Class=:local apturl-0.5.2ubuntu4/setup.py0000775000000000000000000000311712252035543012764 0ustar #!/usr/bin/env python3 from distutils.core import setup from DistUtilsExtra.command import * import glob import os import re # look/set what version we have changelog = "debian/changelog" if os.path.exists(changelog): with open(changelog, encoding='utf-8') as fp: head = fp.readline() match = re.compile(".*\((.*)\).*").match(head) if match: version = match.group(1) with open("AptUrl/Version.py", "w") as fp: print('VERSION="{}"'.format(version)) GETTEXT_NAME="apturl" I18NFILES = [] for filepath in glob.glob("po/mo/*/LC_MESSAGES/*.mo"): lang = filepath[len("po/mo/"):] targetpath = os.path.dirname(os.path.join("share/locale",lang)) I18NFILES.append((targetpath, [filepath])) setup(name='apturl', version=version, packages=['AptUrl', 'AptUrl.gtk', 'AptUrl.gtk.backend', 'AptUrl.kde'], scripts=['apturl','apturl-gtk','apturl-kde'], data_files=[('share/apturl/', ["data/apturl-gtk.ui","data/apturl-qt.ui"]), ('../etc/firefox/pref/', ["data/apturl.js"]), ('share/kde4/services/', ["data/apt.protocol","data/apt+http.protocol"]), ('share/applications/', ["data/apturl.desktop"]), ]+I18NFILES, cmdclass = { "build" : build_extra.build_extra, "build_i18n" : build_i18n.build_i18n, "build_help" : build_help.build_help, "build_icons" : build_icons.build_icons } ) apturl-0.5.2ubuntu4/KDE-TODO0000664000000000000000000000044312252035543012337 0ustar * either reimplement QLabel as QSummaryLabel to abstract setText for adding

tags + or replace the whole compound with ktitle widget, which completely implements what our ui does ... looks weird though + or pass strings for the header label through a function that attaches the tags apturl-0.5.2ubuntu4/debian/0000775000000000000000000000000012311211372012457 5ustar apturl-0.5.2ubuntu4/debian/apturl.links0000664000000000000000000000010212252035543015031 0ustar usr/share/man/man8/apturl.8.gz usr/share/man/man8/apturl-gtk.8.gz apturl-0.5.2ubuntu4/debian/apturl-common.preinst0000664000000000000000000000121612252035543016672 0ustar #!/bin/sh set -e # Prepare to move a conffile without triggering a dpkg question prep_mv_conffile() { local PKGNAME="$1" local CONFFILE="$2" [ -e "$CONFFILE" ] || return 0 local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')" local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \ sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")" if [ "$md5sum" = "$old_md5sum" ]; then rm -f "$CONFFILE" fi } case "$1" in install|upgrade) if dpkg --compare-versions "$2" le "0.4.1ubuntu4"; then prep_mv_conffile apturl-common "/etc/firefox-3.0/pref/apturl.js" fi esac #DEBHELPER# apturl-0.5.2ubuntu4/debian/compat0000664000000000000000000000000212252035543013665 0ustar 9 apturl-0.5.2ubuntu4/debian/apturl-kde.install0000664000000000000000000000012712252035543016127 0ustar usr/bin/apturl-kde usr/lib/python3/*-packages/AptUrl/kde/*py* usr/share/apturl/*-qt.ui apturl-0.5.2ubuntu4/debian/control0000664000000000000000000000465412311211342014070 0ustar Source: apturl Section: admin Priority: optional Maintainer: Michael Vogt Build-Depends: debhelper (>= 9), intltool, python3-dev, python3-distutils-extra, python3-update-manager, python3-aptdaemon X-Python3-Version: >= 3.2 Standards-Version: 3.9.3 Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/apturl/ubuntu/ Vcs-Browser: http://bazaar.launchpad.net/~ubuntu-core-dev/apturl/ubuntu/files Package: apturl-common Architecture: any Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends}, python3-apt, python3-update-manager Replaces: apturl (<< 0.3.6ubuntu2) Description: install packages using the apt protocol - common data AptUrl is a simple graphical application that takes an URL (which follows the apt-protocol) as a command line option, parses it and carries out the operations that the URL describes (that is, it asks the user if he wants the indicated packages to be installed and if the answer is positive does so for him). . This package contains the common data shared between the frontends. Package: apturl Architecture: any Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends}, apturl-common (= ${binary:Version}), gnome-icon-theme (>= 2.14.0-1), python3-gi, software-properties-gtk, python3-aptdaemon, python3-aptdaemon.gtk3widgets, gir1.2-gtk-3.0, gir1.2-webkit-3.0 Suggests: libgtk2-perl (>= 1:1.130) Description: install packages using the apt protocol - GTK+ frontend AptUrl is a simple graphical application that takes an URL (which follows the apt-protocol) as a command line option, parses it and carries out the operations that the URL describes (that is, it asks the user if he wants the indicated packages to be installed and if the answer is positive does so for him). . This package contains the GTK+ frontend. Package: apturl-kde Architecture: any Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends}, python3-pyqt4, python3-pykde4, apturl-common (= ${binary:Version}), kdesudo, qapt-batch, software-properties-kde (>= 0.75.2) Description: install packages using the apt protocol - KDE frontend AptUrl is a simple graphical application that takes an URL (which follows the apt-protocol) as a command line option, parses it and carries out the operations that the URL describes (that is, it asks the user if he wants the indicated packages to be installed and if the answer is positive does so for him). . This package contains the KDE frontend. apturl-0.5.2ubuntu4/debian/apturl-common.postinst0000664000000000000000000000101212252035543017063 0ustar #!/bin/sh set -e # Move a conffile without triggering a dpkg question mv_conffile() { local OLDCONFFILE="$1" local NEWCONFFILE="$2" [ -e "$OLDCONFFILE" ] || return 0 echo "Preserving user changes to $NEWCONFFILE ..." mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new mv -f "$OLDCONFFILE" "$NEWCONFFILE" } case "$1" in configure) if dpkg --compare-versions "$2" le "0.4.1ubuntu4"; then mv_conffile "/etc/firefox-3.0/pref/apturl.js" "/etc/firefox/pref/apturl.js" fi esac #DEBHELPER# apturl-0.5.2ubuntu4/debian/apturl.install0000664000000000000000000000022712252035543015367 0ustar usr/bin/apturl-gtk usr/lib/python3/*-packages/AptUrl/gtk/*py* usr/lib/python3/*-packages/AptUrl/gtk/backend/ usr/share/apturl/*-gtk.ui usr/share/gconf apturl-0.5.2ubuntu4/debian/apturl-common.manpages0000664000000000000000000000001112252035543016771 0ustar apturl.8 apturl-0.5.2ubuntu4/debian/apturl-common.install0000664000000000000000000000025012252035543016651 0ustar etc/ usr/bin/apturl usr/lib/python3/*-packages/AptUrl/*py* usr/lib/python3/*-packages/apturl-*.egg-info usr/share/kde4/services usr/share/locale usr/share/applications apturl-0.5.2ubuntu4/debian/source/0000775000000000000000000000000012252036013013760 5ustar apturl-0.5.2ubuntu4/debian/source/format0000664000000000000000000000001512252035543015176 0ustar 3.0 (native) apturl-0.5.2ubuntu4/debian/rules0000775000000000000000000000154012252035543013547 0ustar #!/usr/bin/make -f %: dh $@ --with python3 override_dh_auto_build: python3 setup.py build override_dh_auto_install: python3 ./setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb override_dh_auto_test: python3 -m unittest discover -vv override_dh_auto_clean: rm -f AptUrl/Version.py python3 setup.py clean -a rm -rf build rm -rf *.egg-info find . -name __pycache__ | xargs rm -rf PKG=apturl DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p') DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us -uc $(DEB_BUILD_PROG_OPTS) arch-build: rm -rf debian/arch-build mkdir -p debian/arch-build/$(PKG)-$(DEBVER) tar -c --exclude=arch-build --no-recursion -f - `bzr inventory` | (cd debian/arch-build/$(PKG)-$(DEBVER);tar xf -) (cd debian/arch-build/$(PKG)-$(DEBVER) && $(DEB_BUILD_PROG)) apturl-0.5.2ubuntu4/debian/changelog0000664000000000000000000004503712311211372014342 0ustar apturl (0.5.2ubuntu4) trusty; urgency=medium * Drop libgtk2-perl Recommends to Suggests. -- Dimitri John Ledkov Sun, 16 Mar 2014 02:56:58 +0000 apturl (0.5.2ubuntu3) trusty; urgency=low * AptUrl/AptUrl.py: don't use decode on a str (lp: #1050826) -- Sebastien Bacher Wed, 11 Dec 2013 11:18:25 +0100 apturl (0.5.2ubuntu2) saucy; urgency=low * adjust backend to reuse the bits from update-manager (LP: #1200775) -- Michael Vogt Tue, 08 Oct 2013 20:14:22 +0200 apturl (0.5.2ubuntu1) raring; urgency=low * AptUrl/gtk/backend/__init__.py: Drop "action-done" signal definition; update-manager's GTK backend already defines it with different arguments, so this is ineffective and confusing. * AptUrl/gtk/GtkUI.py, _on_backend_done(): Add additional error signal arguments, as defined by update-manager's backend. * AptUrl/gtk/backend/InstallBackend{Aptdaemon,Synaptic}.py: Call action-done signal with error arguments. (LP: #1103024) * data/apturl-gtk.ui: Drop obsolete "has_separator" property. Fixes a warning. -- Martin Pitt Tue, 09 Apr 2013 13:23:37 +0200 apturl (0.5.1ubuntu6) quantal; urgency=low * AptUrl/gtk/backend/InstallBackendAptdaemon.py: Work around incompatible Update Manager API change (as described in Launchpad bug #1026257). LP: #1020980 -- Barry Warsaw Wed, 18 Jul 2012 13:38:02 -0400 apturl (0.5.1ubuntu5) quantal; urgency=low * debian/control: Move python3-aptdaemon dependency to apturl binary package (from apturl-common) since only the gtk backend needs it. -- Barry Warsaw Fri, 15 Jun 2012 09:49:13 -0400 apturl (0.5.1ubuntu4) quantal; urgency=low [ Brian Murray ] * Port to Python 3: - Use Python 3 style print functions * AptUrl/Parser.py: - ensure MAX_URL_LEN/10 returns an int [ Colin Watson ] * AptUrl/gtk/backend/InstallBackendSynaptic.py: - Keep a reference to the data tuple passed to GObject.child_watch_add to avoid attempts to destroy it without a thread context. - Open temporary synaptic selections file in text mode. [ Barry Warsaw ] * Additional Python 3 fixes: + Port setup.py to Python 3. + Use the new python-apt API since the legacy API is not available in Python 3. + ki18n() takes bytes. + Fix relative imports so the code can be run from source. + Fixed some additional packaging paths. + Change #! lines to use python3. + Changed debian/control and debian/rules to use python3. + Change debian/compat == 9 + apturl now must require python3-aptdaemon.gtk3widgets (i.e. not | synaptic) due to the Python 3 port of update-manager. * Other changes: + Remove the need for threads in the KDE front-end. + Enable running the test suite via `python3 -m unittest discover` + i18n updates. + Various and sundry pyflakes, whitespace, style, line length, and spelling fixes. -- Brian Murray Mon, 11 Jun 2012 10:32:52 -0700 apturl (0.5.1ubuntu3) precise; urgency=low * Take the unicode representation of the parser error message instead of the string representation, so that we get clean i18n handling. LP: #911144. -- Steve Langasek Sat, 24 Mar 2012 02:36:28 -0700 apturl (0.5.1ubuntu2) precise; urgency=low * debian/control: Fix dependencies: python-gobject → python-gi. -- Martin Pitt Tue, 13 Mar 2012 19:45:46 +0100 apturl (0.5.1ubuntu1) oneiric-proposed; urgency=low * add support for multiarch package names (LP: #872146) -- Michael Vogt Thu, 13 Oct 2011 08:59:04 +0200 apturl (0.5ubuntu1) oneiric; urgency=low * port to gtk3, update dependencies -- Michael Vogt Mon, 25 Jul 2011 18:39:00 +0200 apturl (0.4.3ubuntu1) oneiric; urgency=low * improve exception handling and shorten overly long strings * add aptdaemon backend * add dependencies to python-aptdaemon-gtk -- Michael Vogt Fri, 22 Jul 2011 14:06:42 +0200 apturl (0.4.2ubuntu5) natty; urgency=low * debian/apturl-common.install: - fix install file by removing no longer relevant usr/share/omf (this fixes a FTBFS) -- Michael Vogt Wed, 30 Mar 2011 15:40:41 +0200 apturl (0.4.2ubuntu4) natty; urgency=low * data/apturl.desktop: - Add a desktop file to register mime type. LP: #698181 -- Michael Terry Thu, 06 Jan 2011 11:48:26 -0500 apturl (0.4.2ubuntu3) natty; urgency=low * Don't hardcode python2.6 in the packaging. * Build using dh_python2 instead of dh_pycentral. -- Matthias Klose Fri, 17 Dec 2010 15:35:28 +0100 apturl (0.4.2ubuntu2) natty; urgency=low [ Harald Sitter ] * Make apturl-kde explicity depend on python-qt4 and python-kde4 [ Colin Watson ] * Make apturl recommend libgtk2-perl (>= 1:1.130) rather than libgnome2-perl, matching debconf 1.5.36ubuntu3. -- Colin Watson Fri, 17 Dec 2010 13:54:53 +0000 apturl (0.4.2ubuntu1) natty; urgency=low * Switch from glade to GtkBuilder (LP: #403533) -- Michael Terry Tue, 05 Oct 2010 11:06:24 -0400 apturl (0.4.1ubuntu7) maverick; urgency=low * Fix KDE protocol files to enlist in the local protocol class + This makes KRunner in KDE SC 4.5 pick up apt:foo as call to apturl again * Bump standards version to 3.9.1 * Switch to dpkg-source 3 * Switch all packages to arch:any rather than all -- Harald Sitter Tue, 07 Sep 2010 17:04:52 +0200 apturl (0.4.1ubuntu6) maverick; urgency=low * Port apturl-kde to qapt-batch (LP: #497803) * Replace the dependency on install-package with one on qapt-batch -- Jonathan Thomas Fri, 06 Aug 2010 23:02:03 -0400 apturl (0.4.1ubuntu5) maverick; urgency=low * Fix LP: #576944 - Move the Firefox preferences to /etc/firefox - update setup.py - add debian/apturl-common.postinst - add debian/apturl-common.preinst * Don't install apturl.js in /usr/share/firerox - Firefox doesn't see this - update debian/apturl-common.install - update setup.py * Add a couple of extra preferences for Firefox - update data/apturl.js -- Chris Coulson Tue, 27 Jul 2010 13:46:22 +0100 apturl (0.4.1ubuntu4) lucid; urgency=low * Drop python-gtkhtml2 recommends (moved to webkit). -- Loïc Minier Mon, 15 Mar 2010 10:37:10 +0100 apturl (0.4.1ubuntu3) lucid; urgency=low * apturl.8: - add example for the "channel" parameter * AptUrl/gtk/GtkUI.py: - use webkit instead of gtkhtml (ucid-duplicated-packages spec) * debian/control: - add python-webkit depend on debian/control -- Michael Vogt Mon, 08 Mar 2010 17:12:10 +0100 apturl (0.4.1ubuntu2) karmic; urgency=low * Reupload merged 0.4.0ubuntu5 and 0.4.1ubuntu1, forgot to bzr push -.- -- Harald Sitter Fri, 18 Sep 2009 22:53:24 +0200 apturl (0.4.1ubuntu1) karmic; urgency=low [ Harald Sitter ] * Borrow encoding wrappers from GDebi to fix encodings in KDE UI [ Michael Vogt ] * AptUrl/gtk/GtkUI.py: - Use software-properites to enable componenents * debian/control: - Remove dependency on gnome-app-install - Add software-properties-gtk -- Michael Vogt Fri, 18 Sep 2009 09:46:29 +0200 apturl (0.4.0ubuntu5) karmic; urgency=low * Borrow encoding wrappers from GDebi to fix encodings in KDE UI (implemented via Helpers). These new wrappers utf8, _ and _n are used throughout the whole application. * Fix minor formatting error in KDE UI's _get_dialog * link apturl's manpage to the apturl-gtk and apturl-kde manpages since they share the same argument parser anyway * Bump standards version to 3.8.3 * Port package build system to dh 7 + Build-depend on debhelper 7 -- Harald Sitter Thu, 10 Sep 2009 13:09:27 +0200 apturl (0.4.0ubuntu4) karmic; urgency=low * build without "DH_PYCENTRAL=include-links" for now, to work around breakage when upgrading from the previous version that was build without the include-links option (LP: #422825) -- Michael Vogt Wed, 02 Sep 2009 17:44:54 +0200 apturl (0.4.0ubuntu3) karmic; urgency=low * Make KDE frontend use a Qt UI file (should make it easier to maintain) * Enable KDE frontend to few HTML when about to enable a software channel * Clean-up setup.py * Make apturl script fall back to KDE frontend when -gtk is not installed even if KDE_FULL_SESSION is not set * Resolve self-relations of apturl binary package * fix crash on ctrl-c (in KDE frontend) -- Harald Sitter Tue, 01 Sep 2009 21:02:20 +0200 apturl (0.4.0ubuntu2) karmic; urgency=low * fix FTBFS * fix crash on ctrl-c -- Michael Vogt Tue, 01 Sep 2009 19:34:09 +0200 apturl (0.4.0ubuntu1) karmic; urgency=low [ Harald Sitter ] * Add KDE frontend (LP: #293533) [ Michael Vogt ] * build with DH_PYCENTRAL=include-links -- Harald Sitter Sat, 22 Aug 2009 18:41:35 +0200 apturl (0.3.6ubuntu1) karmic; urgency=low * AptUrl/AptUrl.py, AptUrl/UI.py, AptUrl/gtk/GtkUI.py: - show channel info when enabling channels * debian/control: - recommend python-gthtml2 (for the channel info UI) -- Michael Vogt Mon, 18 May 2009 16:20:02 +0200 apturl (0.3.5ubuntu1) karmic; urgency=low * AptUrl/AptUrl.py: - when enabling sections, do not skip that if the requested package is already known to the package cache * AptUrl/Parser.py: - support proper url synatax with "&" (thanks to asac) * AptUrl/AptUrl.py: - reopen the cache properly after a refresh=yes -- Michael Vogt Thu, 23 Apr 2009 10:18:08 +0200 apturl (0.3.3ubuntu1) jaunty; urgency=low * AptUrl/AptUrl.py: - fix crash on "refresh=yes" (LP: #327075) -- Michael Vogt Tue, 07 Apr 2009 14:35:34 +0200 apturl (0.3.2ubuntu2) jaunty; urgency=low * AptUrl/gtk/GtkUI.py: - fix gettext domain (LP: #304950) * data/apturl.glade: - fix missing translatable property (LP: #304925) Thanks to Gabor Kelemen * AptUrl/Helpers.py: - fix crash for packages with no long description (LP: #288576) -- Michael Vogt Thu, 08 Jan 2009 20:17:36 +0100 apturl (0.3.1ubuntu1) jaunty; urgency=low * AptUrl/AptUrl.py: - add additional sanitizing into the channel code -- Michael Vogt Fri, 07 Nov 2008 10:21:59 +0100 apturl (0.3.0ubuntu1) jaunty; urgency=low * add README * add basic string substituion for the variables "$kernel" (uname -r) and "$distro" (lsb_release -s) this allows stuff like: "apt:linux-backports-module-$kernel" * add new field "channel" that looks into /usr/share/app-install/channels for known repositories that the user might want to add * refactored the UI code so that its easy to add a Qt frontend, see AptUrl/UI.py and AptUrl/gtk/GtkUI.py (volunteers welcome :) * improved whitelist checking -- Michael Vogt Thu, 06 Nov 2008 16:04:46 +0100 apturl (0.2.7ubuntu1) intrepid; urgency=low [ Siegfried-Angel Gevatter Pujals ] * apturl: - Show a different error message if the requested package is virtual; this is the first step to fix Launchpad bug #230760. - Show an error dialog if the /etc/apt/sources.list is invalid instead of just crashing (LP: #206640). - Catch KeyboardInterrupt's so that they don't show a traceback. - Add a new exit code (RESULT_BADARGS, 4) for when the problem is with the arguments with which apturl was called. - Only ask once when enabling new components, and only list those which aren't already enabled. - Fix a crash which happened after enabling the requested component(s). - Don't show an error message if the user didn't want to enable a component; just silently skip the package. - Improve the description: + Don't show the summary twice. + Remove single line breaks, like packages.ubuntu.com does. + Parse the Homepage field out of the description. - Do not ask if you want to keep a software channel if it wasn't added. - Use a constant to determine wheter new software channels can be added or not (disabled by default, but that's better than having the code commented out). * AptUrl/Helpers.py: - Add it. * data/apturl.glade: - Add a missing "can_default" property to fix an assertion error. - Change the labels of the buttons on the installation confirmation dialog so that they conform to the HIG. Thanks to Bruce Cowan (LP: #140472). - Make the description field bigger and more visually appealing. * AptUrl/Parser.py: - Raise an Exception if one of the given package names contains characters which are not allowed by the Debian Policy. - Raise an Exception if one of the ?... values contains a space. * apturl.8: - Document all possible exit codes. - Add a new example, and improve the comment of an existing one. - Change the URL in "Bugs" from /apturl to /ubuntu/+source/apturl, as that's where most bugs are. * debian/control: - Add Vcs-Browser field. - Write all dependendency and build dependencies each on a line. - Add python-gobject to the build dependencies (needed for the timer). * debian/rules: - Fix the clean rule so that it removes build/ and AptUrl/Version.py. - Move the stuff from binary-arch to binary-indep, and remove the binary-indep target to please lintian. * debian/copyright: - Update copyright years and author names. [ Артём Попов ] * data/apturl.protocol, setup.py: - Register apturl in KDE as a protocol (LP: #227622). -- Siegfried-Angel Gevatter Pujals Mon, 01 Sep 2008 16:44:35 +0200 apturl (0.2.6ubuntu1) intrepid; urgency=low * apturl: - add new ?refresh=1 option that allows forcing a apt-get update before the package gets installed (thanks to Vadim Peretokin, LP: #258173) -- Michael Vogt Fri, 15 Aug 2008 17:13:14 +0200 apturl (0.2.5ubuntu1) intrepid; urgency=low * apturl: - Hide python-apt's "API not stable yet" warning. - If a package is already installed, show an informational box, not an error message (LP: #237012). - Give error dialogs the same icon as question dialogs have. * apturl.8, debian/rules: - Add a manpage (LP: #159422). * debian/control: - Bump the minimum debhelper version to 5.0.51~, as required for dh_icons. - Improve the description. * debian/copyright: - Include the full GPL header. -- Siegfried-Angel Gevatter Pujals (RainCT) Sat, 14 Jun 2008 15:37:27 +0200 apturl (0.2.4ubuntu1) intrepid; urgency=low * make dialog less greedy to not cover up Synaptic (LP: #252028) -- Jacob Peddicord Fri, 25 Jul 2008 22:23:25 -0400 apturl (0.2.3ubuntu1) intrepid; urgency=low * set always on top to prevent window from being hidden (LP: #234992) -- Jacob Peddicord Mon, 26 May 2008 10:45:16 -0400 apturl (0.2.2ubuntu1) hardy; urgency=low * apturl: - only add/ask about component enabling if the component is actually not yet available (#163049) - return correct error code when enabling a component failed/got cancelt - fix missing destroy in question() helper - ensure that component is fully availabe (LP: #208722) -- Michael Vogt Tue, 15 Apr 2008 15:45:00 +0200 apturl (0.2.1ubuntu1) hardy; urgency=low [ Michael Vogt ] * apturl: - fix broken enable of components * debian/control: - add missing python-apt dependency [ Fabien Tassin ] * setup.py: - add support for firefox-3.0 (LP: #207281) -- Michael Vogt Thu, 10 Apr 2008 16:36:48 +0200 apturl (0.2.0ubuntu1) hardy; urgency=low * apturl: - run gtk.init_check() (LP: #197062) - make the description better (split into summary/long descr) - fix filename creation (LP: #138315) - typo (LP: #200504) - return proper exit codes on success/cancel/failure (LP: #132276) - only run if the apt cache is not broken * data/apturl.glade: - default button is 'no' - make it resizable * po/POTFILES.in: - add missing files (LP: #173846) * date/apturl.schemas.in, setup.py: - register apturl in gnome as a protocol -- Michael Vogt Tue, 11 Mar 2008 10:15:57 +0100 apturl (0.1.2ubuntu1) hardy; urgency=low * support --http-proxy for better integration with the proxy settings of firefox (LP: #162609) * merged patch from Andy Owen to display a description -- Michael Vogt Wed, 16 Jan 2008 14:51:24 +0100 apturl (0.1.1ubuntu1) hardy; urgency=low * AptUrl/Parser.py: - Implemented multipackage installation (LP: #154593) * tests/apturlparse.py: - add test for the new multipackage feature -- Sasa Bodiroza Sat, 27 Oct 2007 13:42:45 +0200 apturl (0.1ubuntu2) gutsy-proposed; urgency=low * support --http-proxy for better integration with the proxy settings of firefox (LP: #162609) -- Michael Vogt Wed, 14 Nov 2007 16:44:14 +0100 apturl (0.1ubuntu1) gutsy; urgency=low * debian/control: - fix typo in description (LP: #131828) - add missing synaptic dependency (LP: #132067) * apturl: - check for already installed or unavailable packages earlier (LP: #137053, LP: #137055) - fix incorrect reference to GDebi (LP: #137065) - disable adding repositories for now (LP: #139227) -- Michael Vogt Fri, 05 Oct 2007 16:28:24 +0200 apturl (0.0+bzr20070816) gutsy; urgency=low * added i18n support * added support for "minver" * added support to add repositories and sections * added suppor for removing sources again -- Michael Vogt Thu, 16 Aug 2007 18:03:48 +0200 apturl (0.0+bzr20070709) gutsy; urgency=low * properly integrate with firefox -- Michael Vogt Mon, 9 Jul 2007 11:53:32 +0200 apturl (0.0+bzr20070702) gutsy; urgency=low * Initial Release. * Implements subset of https://wiki.ubuntu.com/AptFirefoxFileHandler (to unblock firefox-distro-addon-support spec) -- Michael Vogt Mon, 02 Jul 2007 12:49:37 +0200 apturl-0.5.2ubuntu4/debian/apturl-kde.links0000664000000000000000000000010212252035543015572 0ustar usr/share/man/man8/apturl.8.gz usr/share/man/man8/apturl-kde.8.gz apturl-0.5.2ubuntu4/debian/copyright0000664000000000000000000000177612252035543014435 0ustar This package was debianized by Michael Vogt on Fri, 02 Jul 2007 16:10:41 +0100. It was downloaded via bzr from http://bazaar.launchpad.net/~ubuntu-core-dev/apturl/ubuntu Upstream Author: Michael Vogt Siegfried-A. Gevatter Copyright: Copyright (c) 2007-2008 Canonical, Ltd. License: AptUrl is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. AptUrl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. On Debian GNU/Linux based systems, the complete text of the GNU General Public License can be found in the /usr/share/common-licenses/GPL file. apturl-0.5.2ubuntu4/apturl.80000664000000000000000000000436112252035543012651 0ustar .TH APTURL 8 "September 01, 2008" .SH NAME apturl \- graphical apt\-protocol interpreting package installer .SH SYNOPSIS \fBapturl\fP [\fBoptions...\fP] <\fBURL\fP> .SH DESCRIPTION \fBapturl\fP is a simple graphical application that takes an URL (following the apt\-protocol) as a command line option, parses it and carries out the operations that the URL describes (that is, it asks the user if he wants the indicated packages to be installed and if the answer is positive does so). .SH USAGE \fBapturl\fP just needs an URL conforming with the apt-protocol in order to work. Additionally, it recognizes the following options: .TP \fB\-p, \-\-http\-proxy\fP Use the given HTTP proxy in order to download the packages. .SH EXAMPLES .TP apturl apt:pidgin,pidgin-plugin-pack Installs Pidgin and Pidgin Plugin Pack (if the user confirms). .TP apturl apt:freevial?section=universe Enables the "universe" component and installs package Freevial. .TP apturl apt:adobe-flashplugin?channel=lucid-partner Enables the "partner" repository and installs package adobe-flashplugin. Available repositories are listed in /usr/share/app-install/channels/. .TP apturl apt+http://launchpad.net/~mvo/ppa?package=2vcard Installs 2vcard from the indicated PPA (if the user confirms), and afterward asks if the PPA should be removed again or it should remain enabled. .br Warning: This is currently disabled because of security concerns. .SH EXIT CODES .TP 0 All requested packages have been successfully installed or were already installed. .TP 1 The user aborted the installation of one or more packages. .TP 2 There was an error doing the requested operations, or the user aborted the installation while Synaptic (and not apturl itself) was working. .TP 3 The arguments with which \fBapturl\fP was called were incorrect (e.g., it was called without any argument or the given URL was wrong). .SH BUGS Please report any bug on https://bugs.launchpad.net/ubuntu/+source/apturl. .SH SEE ALSO \fBsynaptic\fR .SH AUTHORS \fBapturl\fP was written by Michael Vogt for Canonical, Ltd. and this manual page by Siegfried-A. Gevatter . .PP It is released under the GNU General Public License, version 2 or any later version published by the Free Software Foundation. apturl-0.5.2ubuntu4/po/0000775000000000000000000000000012252036013011654 5ustar apturl-0.5.2ubuntu4/po/apturl.pot0000664000000000000000000001001012252035543013706 0ustar # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-06-12 17:39-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: ../apturl-gtk:51 ../apturl-kde:54 msgid "User requested interrupt." msgstr "" #: ../AptUrl/Parser.py:85 msgid "Non whitelist char in the uri" msgstr "" #: ../AptUrl/Parser.py:93 msgid "Whitespace in key=value" msgstr "" #: ../AptUrl/Parser.py:99 #, python-format msgid "Exception '%s'" msgstr "" #: ../AptUrl/Parser.py:109 #, python-format msgid "Url string '%s' too long" msgstr "" #: ../AptUrl/Parser.py:115 msgid "No ':' in the uri" msgstr "" #: ../AptUrl/AptUrl.py:73 #, python-format msgid "Enabling '%s' failed" msgstr "" #: ../AptUrl/AptUrl.py:91 #, python-format msgid "Unknown channel '%s'" msgstr "" #: ../AptUrl/AptUrl.py:92 #, python-format msgid "The channel '%s' is not known" msgstr "" #: ../AptUrl/AptUrl.py:100 #, python-format msgid "Enabling channel '%s' failed" msgstr "" #: ../AptUrl/AptUrl.py:112 msgid "Invalid /etc/apt/sources.list file" msgstr "" #: ../AptUrl/AptUrl.py:115 msgid "Software index is broken" msgstr "" #: ../AptUrl/AptUrl.py:116 msgid "" "This is a major failure of your software management system. Please check for " "broken packages with synaptic, check the file permissions and correctness of " "the file '/etc/apt/sources.list' and reload the software information with: " "'sudo apt-get update' and 'sudo apt-get install -f'." msgstr "" #: ../AptUrl/AptUrl.py:144 msgid "Need a url to continue, exiting" msgstr "" #: ../AptUrl/AptUrl.py:147 #, python-format msgid "Invalid url: '%s' given, exiting" msgstr "" #: ../AptUrl/AptUrl.py:183 #, python-format msgid "Can not deal with protocol '%s' " msgstr "" #: ../AptUrl/AptUrl.py:205 #, python-format msgid "Package '%s' is virtual." msgstr "" #: ../AptUrl/AptUrl.py:208 #, python-format msgid "Could not find package '%s'." msgstr "" #: ../AptUrl/AptUrl.py:214 #, python-format msgid "Package '%s' is already installed" msgstr "" #: ../AptUrl/AptUrl.py:229 #, python-format msgid "Can not install '%s' (%s) " msgstr "" #: ../AptUrl/AptUrl.py:235 #, python-format msgid "Package '%s' requests minimal version '%s', but only '%s' is available" msgstr "" #: ../AptUrl/UI.py:16 msgid "Enable additional components" msgstr "" #: ../AptUrl/UI.py:24 ../AptUrl/gtk/GtkUI.py:86 ../AptUrl/kde/KdeUI.py:82 msgid "Enable additional software channel" msgstr "" #: ../AptUrl/UI.py:25 ../AptUrl/gtk/GtkUI.py:87 ../AptUrl/kde/KdeUI.py:83 #, python-format msgid "Do you want to enable the following software channel: '%s'?" msgstr "" #: ../AptUrl/gtk/GtkUI.py:151 ../AptUrl/kde/KdeUI.py:133 msgid "Install additional software?" msgstr "" #: ../AptUrl/gtk/GtkUI.py:152 ../AptUrl/kde/KdeUI.py:134 #, python-format msgid "Do you want to install package '%s'?" msgstr "" #. kate: space-indent on; indent-width 4; mixedindent off; indent-mode python; #: ../data/apturl-gtk.ui.h:1 msgid "Description" msgstr "" #: ../data/apturl-gtk.ui.h:2 msgid "_Install" msgstr "" #: ../data/apturl.schemas.in.h:1 msgid "Whether the specified command should handle \"apt\" URLs" msgstr "" #: ../data/apturl.schemas.in.h:2 msgid "" "True if the command specified in the \"command\" key should handle \"apt\" " "URLs." msgstr "" #: ../data/apturl.schemas.in.h:3 msgid "The handler for \"apt\" URLs" msgstr "" #: ../data/apturl.schemas.in.h:4 msgid "The command used to handle \"apt\" URLs, if enabled." msgstr "" #: ../data/apturl.schemas.in.h:5 msgid "Run the command in a terminal" msgstr "" #: ../data/apturl.schemas.in.h:6 msgid "" "True if the command used to handle this type of URL should be run in a " "terminal." msgstr "" apturl-0.5.2ubuntu4/po/fr.po0000664000000000000000000000426612252035543012642 0ustar msgid "" msgstr "" "Project-Id-Version: apt-url\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-03-11 11:41+0100\n" "PO-Revision-Date: 2007-12-04 09:46+0100\n" "Last-Translator: Bruno Bord \n" "Language-Team: Bruno Bord \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: French\n" "X-Poedit-Country: FRANCE\n" "X-Poedit-SourceCharset: utf-8\n" #: ../apturl:199 msgid "Need a url to continue, exiting" msgstr "" #: ../apturl:202 #, c-format msgid "Invalid url: '%s' given, exiting" msgstr "" #: ../apturl:208 #, c-format msgid "Can not deal with protocol '%s' " msgstr "" #: ../apturl:212 #, c-format msgid "Can not find '%s' " msgstr "" #: ../apturl:215 #, c-format msgid "Package '%s' is already installed" msgstr "" #: ../apturl:219 msgid "Install additional software?" msgstr "Installer ce(s) programme(s) supplémentaire(s) ?" #: ../apturl:220 #, fuzzy, c-format msgid "Do you want to install the package '%s' ?" msgstr "Voulez-vous installer le paquetage '%s' ?" #: ../apturl:245 #, c-format msgid "Enabling '%s' failed" msgstr "" #: ../apturl:258 #, c-format msgid "Can not install '%s' (%s) " msgstr "" #: ../apturl:263 #, c-format msgid "Package '%s' requests minimal version '%s', but only '%s' is available" msgstr "" #: ../apturl:273 msgid "Remove software channel?" msgstr "" #: ../apturl:274 #, c-format msgid "" "For installing '%s' the software channel '%s' was added, do you want to " "remove it again?" msgstr "" #: ../data/apturl.schemas.in.h:1 msgid "Run the command in a terminal" msgstr "" #: ../data/apturl.schemas.in.h:2 msgid "The command used to handle \"apt\" URLs, if enabled." msgstr "" #: ../data/apturl.schemas.in.h:3 msgid "The handler for \"apt\" URLs" msgstr "" #: ../data/apturl.schemas.in.h:4 msgid "" "True if the command specified in the \"command\" key should handle \"apt\" " "URLs." msgstr "" #: ../data/apturl.schemas.in.h:5 msgid "" "True if the command used to handle this type of URL should be run in a " "terminal." msgstr "" #: ../data/apturl.schemas.in.h:6 msgid "Whether the specified command should handle \"apt\" URLs" msgstr "" apturl-0.5.2ubuntu4/po/POTFILES.in0000664000000000000000000000030012252035543013431 0ustar [encoding: UTF-8] apturl-gtk apturl-kde AptUrl/Parser.py AptUrl/AptUrl.py AptUrl/UI.py AptUrl/gtk/GtkUI.py AptUrl/kde/KdeUI.py [type: gettext/glade] data/apturl-gtk.ui data/apturl.schemas.in apturl-0.5.2ubuntu4/apturl-kde0000775000000000000000000000451612252035543013251 0ustar #!/usr/bin/python3 # -*- coding: utf-8 -*- # # Copyright © 2009 Harald Sitter # # AUTHOR: # Harald Sitter # # This file is part of AptUrl # # AptUrl is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as published # by the Free Software Foundation; either version 2 of the License, or (at # your option) any later version. # # AptUrl is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with AptUrl; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ignore apt's "API not stable yet" warning import warnings warnings.filterwarnings("ignore", category=FutureWarning, append=1) import sys import gettext from gettext import gettext as _ from AptUrl.AptUrl import AptUrlController, RESULT_CANCELT from AptUrl.kde.KdeUI import KdeUI from PyKDE4.kdeui import KApplication from PyKDE4.kdecore import * class AptUrlApplication(KApplication): def exec_(self): localesApp="apturl" localesDir="/usr/share/locale" gettext.bindtextdomain(localesApp, localesDir) gettext.textdomain(localesApp) ui = KdeUI() apturl = AptUrlController(ui) try: apturl.main() except KeyboardInterrupt: print(_("User requested interrupt.")) return RESULT_CANCELT if __name__ == "__main__": appName = "apturl" catalog = "" programName = ki18n (b"AptUrl") version = "1.0" description = ki18n (b"AptUrl for Kubuntu") license = KAboutData.License_GPL copyright = ki18n ("© Harald Sitter".encode('utf-8')) text = ki18n (b"none") homePage = "http://www.kubuntu.org/" bugEmail = "" about = KAboutData (appName, catalog, programName, version, description, license, copyright, text, homePage, bugEmail) about.addAuthor(ki18n(b"Harald Sitter"), KLocalizedString(), "apachelogger@ubuntu.com") KCmdLineArgs.init([""],about) app = AptUrlApplication() app.exec_() apturl-0.5.2ubuntu4/COPYING0000664000000000000000000004310312252035543012301 0ustar GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. apturl-0.5.2ubuntu4/tests/0000775000000000000000000000000012252036013012400 5ustar apturl-0.5.2ubuntu4/tests/__init__.py0000664000000000000000000000000012252035543014506 0ustar apturl-0.5.2ubuntu4/tests/test_helpers.py0000775000000000000000000000105212252035543015463 0ustar import unittest from AptUrl.Helpers import parse_pkg class Candidate: def __init__(self, descr): self.description = descr self.homepage = None class MockPkg: def __init__(self, descr): self.candidate = Candidate(descr) class HelpersTest(unittest.TestCase): def test_parse_pkg(self): pkgobj = MockPkg("summary\ndescr\n") self.assertEqual(parse_pkg(pkgobj), ('summary','descr\n',None)) pkgobj = MockPkg("summary only") self.assertEqual(parse_pkg(pkgobj), ('summary only','',None)) apturl-0.5.2ubuntu4/tests/test_apturl_parse.py0000664000000000000000000000711112252035543016521 0ustar import unittest from AptUrl import Parser class UrlTests(unittest.TestCase): mapping = { 'kernel':"2.6.23-17-generic", 'distro':"hardy" } testValues = ( ('apt:3ddesktop', [{'package':'3ddesktop', 'schema': 'apt'}] ), ('apt://3dchess', [{'package':'3dchess', 'schema': 'apt'}] ), ('apt+http://launchpad.net/~mvo/ppa?package=2vcard', [{'package':'2vcard', 'schema': 'apt+http', 'repo_url': 'http://launchpad.net/~mvo/ppa', 'dist': '/' }] ), ('apt+http://archive.canonical.com?package=acroread?dist=feisty?section=commercial', [{'package':'acroread', 'schema': 'apt+http', 'repo_url': 'http://archive.canonical.com', 'dist': 'feisty', 'section': ['commercial']}] ), ('apt+http://archive.canonical.com?package=acroread?keyfile=ppa-key', [{'package':'acroread', 'schema': 'apt+http', 'repo_url': 'http://archive.canonical.com', 'keyfile': 'ppa-key' }]), ('apt:2vcard?minver=1.0', [{'package':'2vcard', 'schema': 'apt', 'minver': '1.0' }]), ('apt:owl,newbiedoc,python-pykaraoke?dist=gutsy', [{'package':'owl', 'schema':'apt'}, {'package':'newbiedoc', 'schema':'apt'}, {'package':'python-pykaraoke', 'schema':'apt', 'dist':'gutsy'}]), ('apt:python-pykaraoke?dist=gutsy,owl,newbiedoc', [{'package':'python-pykaraoke', 'schema':'apt', 'dist':'gutsy'}, {'package':'owl', 'schema':'apt'}, {'package':'newbiedoc', 'schema':'apt'}]), ('apt:cdda2wav?section=multiverse', [{'package':'cdda2wav', 'section':['multiverse']}]), ('apt:java?section=multiverse?section=universe', [{'package':'java', 'section':['multiverse','universe']}]), ('apt:adobe-flashplugin?channel=partner', [{'package':'adobe-flashplugin', 'channel': 'partner'}]), ('apt:adobe-flashplugin?channel=$distro-partner', [{'package':'adobe-flashplugin', 'channel': 'hardy-partner'}]), ('apt:linux-restricted-modules-$kernel', [{'package':'linux-restricted-modules-2.6.23-17-generic'}]), ('apt:java?section=multiverse§ion=universe', [{'package':'java', 'section':['multiverse','universe']}]), ('apt:java?section=multiverse§ion=universe&minver=1.0', [{'package':'java', 'section':['multiverse','universe'], 'minver': "1.0" }]), ('apt:dpkg:i386', [{ 'package' : 'dpkg:i386', }]), ) def test_valid_parse(self): for v, e in self.testValues: #print("Testing: '%s'" % v) result_list = Parser.parse(v, self.mapping) for dictionary in e: for key in dictionary: self.assertEqual(getattr(result_list[e.index(dictionary)], key), dictionary[key]) def test_pkgname_too_long(self): self.assertRaises( Parser.InvalidUrlException, Parser.parse, "apt:" + 100 * "veryverylong") apturl-0.5.2ubuntu4/README0000664000000000000000000000071312252035543012126 0ustar Some examples of valid urls: Simple install instructions: apt:3ddesktop Some additonal constrains: apt:2vcard?minver=1.0 apt:owl,newbiedoc,python-pykaraoke?dist=gutsy apt:python-pykaraoke?dist=gutsy,owl,newbiedoc apt:cdda2wav?section=multiverse apt:java?section=multiverse?section=universe apt:adobe-flashplugin?channel=partner Some basic substutions are also supported: apt:adobe-flashplugin?channel=$distro-partner apt:linux-restricted-modules-$kernel' apturl-0.5.2ubuntu4/AUTHORS0000664000000000000000000000015212252035543012313 0ustar Michael Vogt Contributors: Siegfried-Angel Gevatter Pujals apturl-0.5.2ubuntu4/setup.cfg0000664000000000000000000000014012252035543013061 0ustar [build_i18n] domain=apturl schemas_files=[("share/gconf/schemas", ("data/apturl.schemas.in",))] apturl-0.5.2ubuntu4/apturl0000775000000000000000000000042112252035543012477 0ustar #!/bin/sh if [ "$KDE_FULL_SESSION" = "true" ] && [ -x /usr/bin/apturl-kde ]; then apturl-kde $@ elif [ -x /usr/bin/apturl-gtk ]; then apturl-gtk $@ elif [ -x /usr/bin/apturl-kde ]; then apturl-kde $@ else echo "Please install apturl-gtk or apturl-kde." fi apturl-0.5.2ubuntu4/AptUrl/0000775000000000000000000000000012311211374012446 5ustar apturl-0.5.2ubuntu4/AptUrl/kde/0000775000000000000000000000000012252036013013210 5ustar apturl-0.5.2ubuntu4/AptUrl/kde/KdeUI.py0000664000000000000000000001243512252035543014537 0ustar # -*- coding: utf-8 -*- from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import QWebView from PyQt4 import uic from PyKDE4.kdeui import * from PyKDE4.kdecore import * import os import apt_pkg import subprocess from AptUrl.UI import AbstractUI from AptUrl.Helpers import _ APTURL_UI_FILE = os.environ.get( # Set this envar to use a test .ui file. 'APTURL_UI_FILE', # System file to use if the envar is not set. '/usr/share/apturl/apturl-qt.ui' ) class AptUrlDialog(KDialog): def __init__(self,parent=None): KDialog.__init__(self,parent) self.setWindowIcon(KIcon("application-x-deb")) def slotButtonClicked(self,button): if button in (KDialog.Apply, KDialog.Ok, KDialog.Yes): KDialog.accept(self) else: KDialog.reject(self) class KdeUI(AbstractUI): def __init__(self): self.dialog = AptUrlDialog() self.d = QWidget(self.dialog) self.dialog.setMainWidget(self.d) uic.loadUi(APTURL_UI_FILE, self.d) self.d.image_label.setPixmap(KIcon("application-x-deb").pixmap(64,64)) # generic dialogs def _get_dialog(self, dialog_type, summary, msg="", buttons=KDialog.Close): self.dialog.setButtons(KDialog.ButtonCode(buttons)) self.d.header_label.setText("

" + summary + "

") self.d.body_label.setText(msg) # TODO: title = empty # TODO: keep above maintain across events # TODO: d.set_markup("%s\n\n%s" % (summary, msg)) def error(self, summary, msg=""): if msg != "": KMessageBox.detailedError(AptUrlDialog(), summary, msg) else: KMessageBox.error(AptUrlDialog(), summary) return False def message(self, summary, msg="", title=""): if msg != "": summary += "\n\n" + msg KMessageBox.information(AptUrlDialog(), summary, title) return True def yesNoQuestion(self, summary, msg, title="", default='no'): self._get_dialog('', summary, msg, buttons=KDialog.Yes | KDialog.No) self.d.setWindowTitle(title) res = self.dialog.exec_() if res != KDialog.Accepted: return False return True # specific dialogs def askEnableChannel(self, channel, channel_info_html): summary = "

" + _("Enable additional software channel") + "

" msg = _("Do you want to enable the following " "software channel: '%s'?") % channel self._get_dialog('', summary, msg, buttons=KDialog.Yes | KDialog.No) webview = QWebView() webview.setHtml(channel_info_html) webview.setFixedSize(400,200) self.d.vlayout_right.addWidget(webview) res = self.dialog.exec_() if res != KDialog.Accepted: return False return True def doEnableSection(self, sections): cmd = ["kdesudo", "--", "software-properties-kde", "--enable-component", "%s" % ' '.join(sections)] try: output = subprocess.check_output( cmd, stdout=subprocess.PIPE, universal_newlines=True) except (OSError, subprocess.CalledProcessError) as e: print("Execution failed: %s" % e, file=sys.stderr) return True # FIXME: Very ugly, but kdesudo doesn't return the correct exit states print(output) if not output.startswith("Enabled the "): return False return True def doEnableChannel(self, channelpath, channelkey): cmd = ["kdesudo", "--", "install", "--mode=644","--owner=0",channelpath, apt_pkg.Config.FindDir("Dir::Etc::sourceparts")] res = subprocess.call(cmd, universal_newlines=True) if res != 0: return False # install the key as well if os.path.exists(channelkey): cmd = ["kdesudo", "--", "apt-key", "add",channelkey] res = subprocess.call(cmd, universal_newlines=True) if res != 0: return False return True def askInstallPackage(self, package, summary, description, homepage): header = "

" + _("Install additional software?") + "

" body = _("Do you want to install package '%s'?") % package self.d.header_label.setText(header) self.d.body_label.setText(body) self.dialog.setButtons(KDialog.ButtonCode(KDialog.Yes | KDialog.No)) res = self.dialog.exec_() if res != KDialog.Accepted: return False return True # progress etc def doUpdate(self): subprocess.check_call([ 'qapt-batch', '--attach', str(self.dialog.winId()), '--update' ], universal_newlines=True) def doInstall(self, apturl): subprocess.check_call([ 'qapt-batch', '--attach', str(self.dialog.winId()), '--install', apturl.package ], universal_newlines=True) if __name__ == "__main__": ui = KdeUI() ui.error("foo","bar") # kate: space-indent on; indent-width 4; mixedindent off; indent-mode python; apturl-0.5.2ubuntu4/AptUrl/kde/__init__.py0000664000000000000000000000000012252035543015316 0ustar apturl-0.5.2ubuntu4/AptUrl/AptUrl.py0000664000000000000000000002131312252035561014235 0ustar # Copyright (c) 2007-2008 Canonical # # AUTHOR: # Michael Vogt # With contributions by Siegfried-A. Gevatter # # This file is part of AptUrl # # AptUrl is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as published # by the Free Software Foundation; either version 2 of the License, or (at # your option) any later version. # # AptUrl is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with AptUrl; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import apt import apt_pkg import aptsources.distro from . import Parser from . import Helpers from .Helpers import _ from aptsources.sourceslist import SourcesList from optparse import OptionParser import os import os.path # adding new repositories is currently disabled because some people have # security concerns about this feature allow_new_repositories = False # channels that we know about channelsdir = "/usr/share/app-install/channels" # return codes (RESULT_OK, RESULT_CANCELT, RESULT_ERROR, RESULT_BADARGS) = list(range(4)) class AptUrlController(object): def __init__(self, ui): self.ui = ui def enableSection(self, apturl): # parse sources.list sourceslist = SourcesList() distro = aptsources.distro.get_distro() distro.get_sources(sourceslist) # check if we actually need to enable anything requested_components = [] for component in apturl.section: if not component in distro.enabled_comps: requested_components.append(component) # if not, we are fine if not requested_components: return RESULT_OK # otherwise ask the user if the really wants to anble them if not self.ui.askEnableSections(apturl.section): return RESULT_CANCELT if not self.ui.doEnableSection(apturl.section): self.ui.error(_("Enabling '%s' failed") % ", ".join(apturl.section)) return RESULT_ERROR self.ui.doUpdate() self.openCache() return RESULT_OK def enableChannel(self, apturl): # ensure that no funny path tricks can be played # by e.g. passing "apt:foo?channel=../../" channel = os.path.basename(apturl.channel) channelpath = "%s/%s.list" % (channelsdir,channel) channelkey = "%s/%s.key" % (channelsdir,channel) channelhtml = "%s/%s.eula" % (channelsdir,channel) # check if not os.path.exists(channelpath): self.ui.error(_("Unknown channel '%s'") % channel, _("The channel '%s' is not known") % channel) return RESULT_ERROR channel_info_html = "" if os.path.exists(channelhtml): channel_info_html = open(channelhtml).read() if not self.ui.askEnableChannel(apturl.channel, channel_info_html): return RESULT_CANCELT if not self.ui.doEnableChannel(channelpath, channelkey): self.ui.error(_("Enabling channel '%s' failed") % apturl.channel) return RESULT_ERROR self.ui.doUpdate() self.openCache() return RESULT_OK def openCache(self): try: self.cache = apt.Cache() except SystemError as strerr: if not '/etc/apt/sources.list' in str(strerr): raise self.ui.error(_("Invalid /etc/apt/sources.list file"), strerr) return False if self.cache._depcache.broken_count > 0: err_header = _("Software index is broken") err_body = _("This is a major failure of your software " "management system. Please check for broken packages " "with synaptic, check the file permissions and " "correctness of the file '/etc/apt/sources.list' and " "reload the software information with: " "'sudo apt-get update' and 'sudo apt-get install -f'." ) self.ui.error(err_header, err_body) return False return True def parseArgs(self): parser = OptionParser() parser.add_option("-p", "--http-proxy", dest="http_proxy", default=None, help="use http proxy") (options, args) = parser.parse_args() # eval and add proxy if options.http_proxy is not None: proxy = options.http_proxy if not ":" in proxy: proxy += ":3128" os.environ["http_proxy"] = "http://%s" % proxy # parse try: apturl_list = Parser.parse(args[0]) except IndexError as e: self.ui.error(_("Need a url to continue, exiting")) return [] except Parser.InvalidUrlException as e: self.ui.error(_("Invalid url: '%s' given, exiting") % e.url, str(e)) return [] return (apturl_list) def verifyInstall(self, apturl): " verify that the install package actually is installed " # check if the package got actually installed self.openCache() pkg = self.cache[apturl.package] if (not pkg.is_installed or pkg._pkg.current_state != apt_pkg.CURSTATE_INSTALLED or self.cache._depcache.broken_count > 0): return False return True def main(self): # global return code ret = RESULT_OK ui = self.ui # parse arguments apturl_list = self.parseArgs() if not apturl_list: return RESULT_BADARGS # open cache if not self.openCache(): return RESULT_ERROR # now go over the url list for apturl in apturl_list: # FIXME: move this code block into a func like # evalAptUrl() if not apturl.schema in ("apt", "apt+http"): self.ui.error(_("Can not deal with protocol '%s' ") % apturl.schema) continue if apturl.section: if self.enableSection(apturl) != RESULT_OK: continue elif apturl.channel: if self.enableChannel(apturl) != RESULT_OK: continue elif apturl.refresh is not None: ui.doUpdate() if not self.openCache(): return RESULT_ERROR # now check the package if apturl.package not in self.cache: try: package_in_cache = bool(self.cache._cache[apturl.package]) except KeyError: package_in_cache = False if package_in_cache: ui.error(_("Package '%s' is virtual.") % apturl.package) continue else: ui.error(_("Could not find package '%s'.") % apturl.package) continue if (self.cache[apturl.package].is_installed and apturl.minver is None): ui.message(_("Package '%s' is already installed") % apturl.package) continue # ask the user pkg = self.cache[apturl.package] (sum, desc, homepage) = Helpers.parse_pkg(pkg) if not ui.askInstallPackage(apturl.package, sum, desc, homepage): ret = RESULT_CANCELT continue # try to install it try: self.cache[apturl.package].mark_install() except SystemError as e: ui.error(_("Can not install '%s' (%s) ") % (apturl.package, e)) continue if apturl.minver is not None: verStr = self.cache[apturl.package].candidate.version if apt_pkg.version_compare(verStr, apturl.minver) < 1: ui.error(_( "Package '%s' requests minimal version '%s', but " "only '%s' is available") % (apturl.package, apturl.minver, verStr)) continue # install it ui.doInstall(apturl) if not self.verifyInstall(apturl): ret = RESULT_ERROR # return values return ret apturl-0.5.2ubuntu4/AptUrl/Helpers.py0000664000000000000000000000404312252035543014431 0ustar # Copyright (c) 2008 Canonical # # AUTHOR: # Siegfried-A. Gevatter # # This file is part of AptUrl # # AptUrl is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as published # by the Free Software Foundation; either version 2 of the License, or (at # your option) any later version. # # AptUrl is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with AptUrl; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import gettext import subprocess def _(str): return utf8(gettext.gettext(str)) def _n(singular, plural, n): return utf8(gettext.ngettext(singular, plural, n)) def utf8(str): if str is bytes: try: return str.decode('UTF-8') except UnicodeDecodeError: # assume latin1 as fallback return str.decode('latin1') else: return str def get_dist(): return subprocess.check_output( 'lsb_release -c -s'.split(), universal_newlines=True).strip() def parse_pkg(pkgobj): summary = "" description = "" pkg_description = pkgobj.candidate.description if pkg_description.count("\n") > 0: summary, description = pkg_description.split('\n', 1) else: summary = pkg_description lines = description.rstrip('\n').split('\n') if len(lines) > 1 and lines[-1].startswith('Homepage: '): homepage = lines[-1].split(' ', 1)[1] description = '\n'.join(lines[:-1]) else: homepage = pkgobj.candidate.homepage return (summary, description, homepage) def format_description(description): const = 'APTURL_DOUBLE_EMPTY_LINE_PLACEHOLDER' return description.replace('\n\n', const).replace('\n', ' ').replace( const, '\n\n') apturl-0.5.2ubuntu4/AptUrl/gtk/0000775000000000000000000000000012252036013013232 5ustar apturl-0.5.2ubuntu4/AptUrl/gtk/GtkUI.py0000664000000000000000000001607012252035543014602 0ustar from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GObject GObject.threads_init() import os import sys import apt_pkg import subprocess from AptUrl.UI import AbstractUI from AptUrl import Helpers from AptUrl.Helpers import _ from .backend import get_backend APTURL_UI_FILE = os.environ.get( # Set this envar to use a test .ui file. 'APTURL_UI_FILE', # System file to use if the envar is not set. '/usr/share/apturl/apturl-gtk.ui' ) class GtkUI(AbstractUI): def __init__(self): Gtk.init_check(sys.argv) # create empty dialog self.dia_xml = Gtk.Builder() self.dia_xml.set_translation_domain("apturl") self.dia_xml.add_from_file(APTURL_UI_FILE) self.dia = self.dia_xml.get_object('confirmation_dialog') self.dia.start_available = lambda: Gtk.main_quit() self.dia.start_error = lambda: Gtk.main_quit() self.dia.exit = lambda: Gtk.main_quit() self.dia.realize() self.backend = get_backend(self.dia) def _action_done(self, backend, action, authorized, success, err_str, err_desc): self.dia.set_sensitive(True) Gtk.main_quit() # generic dialogs def _get_dialog(self, dialog_type, summary, msg="", buttons=Gtk.ButtonsType.CLOSE): " internal helper for dialog construction " d = Gtk.MessageDialog(parent=self.dia, flags=Gtk.DialogFlags.MODAL, type=dialog_type, buttons=buttons) d.set_title("") d.set_markup("%s\n\n%s" % (summary, msg)) d.set_icon(Gtk.IconTheme.get_default().load_icon('deb', 16, False)) d.set_keep_above(True) d.realize() d.get_window().set_functions(Gdk.WMFunction.MOVE) return d def error(self, summary, msg=""): d = self._get_dialog(Gtk.MessageType.ERROR, summary, msg) d.run() d.destroy() return False def message(self, summary, msg="", title=""): d = self._get_dialog(Gtk.MessageType.INFO, summary, msg) d.set_title(title) d.run() d.destroy() return True def yesNoQuestion(self, summary, msg, title="", default='no'): d = self._get_dialog(Gtk.MessageType.QUESTION, summary, msg, buttons=Gtk.ButtonsType.YES_NO) d.set_title(title) res = d.run() d.destroy() if res != Gtk.ResponseType.YES: return False return True # specific dialogs def askEnableChannel(self, channel, channel_info_html): summary = _("Enable additional software channel") msg = _("Do you want to enable the following " "software channel: '%s'?") % channel d = self._get_dialog(Gtk.MessageType.QUESTION, summary, msg, buttons=Gtk.ButtonsType.YES_NO) if channel_info_html: try: from gi.repository import WebKit v=WebKit.WebView() v.load_string(channel_info_html, "text/html", "utf-8", "file:/") sw = Gtk.ScrolledWindow() sw.add(v) d.get_content_area().pack_start(sw, True, True, 0) sw.set_size_request(400, 200) sw.show_all() except ImportError: pass res = d.run() d.destroy() if res != Gtk.ResponseType.YES: return False return True def doEnableSection(self, sections): cmd = ["gksu", "--desktop", "/usr/share/applications/software-properties.desktop", "--", "software-properties-gtk", "-e", "%s" % ' '.join(sections)] try: output = subprocess.communicate( cmd, stdout=subprocess.PIPE, universal_newlines=True) except (OSError, subprocess.CalledProcessError) as e: print("Execution failed: %s" % e, file=sys.stderr) return True #FIXME: Very ugly, but gksu doesn't return the correct exit states if not output.startswith("Enabled the "): return False return True def doEnableChannel(self, channelpath, channelkey): cmd = ["gksu", "--desktop", "/usr/share/applications/gnome-app-install.desktop", "--", "install", "--mode=644","--owner=0",channelpath, apt_pkg.Config.FindDir("Dir::Etc::sourceparts")] res = subprocess.call(cmd, universal_newlines=True) if res != 0: return False # install the key as well if os.path.exists(channelkey): cmd = ["gksu", "--desktop", "/usr/share/applications/gnome-app-install.desktop", "--", "apt-key", "add",channelkey] res = subprocess.call(cmd, universal_newlines=True) if res != 0: return False return True def askInstallPackage(self, package, summary, description, homepage): # populate the dialog dia = self.dia dia_xml = self.dia_xml header = _("Install additional software?") body = _("Do you want to install package '%s'?") % package dia.set_keep_above(True) dia.set_title('') header_label = dia_xml.get_object('header_label') header_label.set_markup("%s" % header) body_label = dia_xml.get_object('body_label') body_label.set_label(body) description_text_view = dia_xml.get_object('description_text_view') tbuf = Gtk.TextBuffer() desc = "%s\n\n%s" % (summary, Helpers.format_description(description)) tbuf.set_text(desc) description_text_view.set_buffer(tbuf) dia.set_icon(Gtk.IconTheme.get_default().load_icon('deb', 16, False)) # check if another package manager is already running # FIXME: just checking for the existance of the file is # not sufficient, it need to be tested if it can # be locked via apt_pkg.get_lock() # - but that needs to run as root # - a dbus helper might be the best answer here #args = (update_button_status, dia_xml.get_object("yes_button"), # dia_xml.get_object("infolabel")) #args[0](*args[1:]) #timer_id = GObject.timeout_add(750, *args ) # show the dialog res = dia.run() #GObject.source_remove(timer_id) if res != Gtk.ResponseType.YES: dia.hide() return False # don't set on-top while installing dia.set_keep_above(False) return True # progress etc def doUpdate(self): self.backend.update() self.dia.set_sensitive(False) Gtk.main() def doInstall(self, apturl): self.backend.commit([apturl.package], [], False) self.dia.set_sensitive(False) Gtk.main() if __name__ == "__main__": ui = GtkUI() ui.error("foo","bar") apturl-0.5.2ubuntu4/AptUrl/gtk/__init__.py0000664000000000000000000000000012252035543015340 0ustar apturl-0.5.2ubuntu4/AptUrl/gtk/backend/0000775000000000000000000000000012252036013014621 5ustar apturl-0.5.2ubuntu4/AptUrl/gtk/backend/InstallBackendAptdaemon.py0000664000000000000000000000614712252035543021721 0ustar #!/usr/bin/env python # -*- coding: utf-8 -*- # (c) 2005-2009 Canonical, GPL from aptdaemon import client, errors from defer import inline_callbacks from aptdaemon.gtk3widgets import AptProgressDialog from aptdaemon.enums import EXIT_SUCCESS from UpdateManager.backend import InstallBackend from UpdateManager.UnitySupport import UnitySupport import apt_pkg import dbus class InstallBackendAptdaemon(InstallBackend): """Makes use of aptdaemon to refresh the cache and to install updates.""" def __init__(self, window_main): # Pass None for datadir because of LP: #1026257 InstallBackend.__init__(self, window_main, self.ACTION_INSTALL) self.client = client.AptClient() self.unity = UnitySupport() @inline_callbacks def update(self): """Refresh the package list""" try: apt_pkg.pkgsystem_unlock() except SystemError: pass try: trans = yield self.client.update_cache(defer=True) yield self._run_in_dialog(trans, self.UPDATE) except errors.NotAuthorizedError as e: self._action_done(self.UPDATE, False, False, str(e), None) except: self.action_done(self.UPDATE, True, False, None, None) raise @inline_callbacks def commit(self, pkgs_install, pkgs_upgrade, close_on_done): """Commit a list of package adds and removes""" try: apt_pkg.pkgsystem_unlock() except SystemError: pass try: reinstall = remove = purge = downgrade = [] trans = yield self.client.commit_packages( pkgs_install, reinstall, remove, purge, pkgs_upgrade, downgrade, defer=True) trans.connect("progress-changed", self._on_progress_changed) yield self._run_in_dialog(trans, self.ACTION_INSTALL) except errors.NotAuthorizedError as e: self._action_done(self.ACTION_INSTALL, False, False, str(e), None) except dbus.DBusException as e: if e.get_dbus_name() != "org.freedesktop.DBus.Error.NoReply": raise self._action_done(self.ACTION_INSTALL, False, False, None, None) except Exception as e: self._action_done(self.ACTION_INSTALL, True, False, None, None) raise def _on_progress_changed(self, trans, progress): #print("_on_progress_changed", progress) self.unity.set_progress(progress) @inline_callbacks def _run_in_dialog(self, trans, action): dia = AptProgressDialog(trans, parent=self.window_main) dia.set_icon_name("update-manager") dia.connect("finished", self._on_finished, action) yield dia.run() def _on_finished(self, dialog, action): dialog.hide() # tell unity to hide the progress again self.unity.set_progress(-1) self._action_done(action, True, dialog._transaction.exit == EXIT_SUCCESS, None, None) if __name__ == "__main__": b = InstallBackendAptdaemon(None) b.commit(["2vcard"], [], False) from gi.repository import Gtk Gtk.main() apturl-0.5.2ubuntu4/AptUrl/gtk/backend/InstallBackendSynaptic.py0000664000000000000000000000476312252035543021605 0ustar #!/usr/bin/env python # -*- coding: utf-8 -*- # (c) 2005-2007 Canonical, GPL import apt_pkg import os import tempfile from gettext import gettext as _ from gi.repository import GObject from UpdateManager.backend import InstallBackend class InstallBackendSynaptic(InstallBackend): """ Install backend based on synaptic """ def _run_synaptic(self, action, opt, tempf): """Execute synaptic.""" try: apt_pkg.pkgsystem_unlock() except SystemError: pass cmd = ["/usr/bin/gksu", "--desktop", "/usr/share/applications/update-manager.desktop", "--", "/usr/sbin/synaptic", "--hide-main-window", "--non-interactive", "--parent-window-id", "%s" % self.window_main.window.xid ] cmd.extend(opt) flags = GObject.SPAWN_DO_NOT_REAP_CHILD (pid, stdin, stdout, stderr) = GObject.spawn_async(cmd, flags=flags) # Keep a reference to the data tuple passed to # GObject.child_watch_add to avoid attempts to destroy it without a # thread context: https://bugs.launchpad.net/bugs/724687 self.child_data = (action, tempf) GObject.child_watch_add(pid, self._on_synaptic_exit, self.child_data) def _on_synaptic_exit(self, pid, condition, data): action, tempf = data if tempf: tempf.close() self.emit("action-done", action, True, os.WEXITSTATUS(condition) == 0, None, None) def update(self): opt = ["--update-at-startup"] tempf = None self._run_synaptic(self.UPDATE, opt, tempf) def commit(self, pkgs_install, pkgs_upgrade, close_on_done): # close when update was successful (its ok to use a Synaptic:: # option here, it will not get auto-saved, because synaptic does # not save options in non-interactive mode) opt = [] if close_on_done: opt.append("-o") opt.append("Synaptic::closeZvt=true") # custom progress strings opt.append("--progress-str") opt.append("%s" % _("Please wait, this can take some time.")) opt.append("--finish-str") opt.append("%s" % _("Update is complete")) tempf = tempfile.NamedTemporaryFile(mode="w+") for pkg_name in pkgs_install + pkgs_upgrade: tempf.write("%s\tinstall\n" % pkg_name) opt.append("--set-selections-file") opt.append("%s" % tempf.name) tempf.flush() self._run_synaptic(self.INSTALL, opt, tempf) apturl-0.5.2ubuntu4/AptUrl/gtk/backend/__init__.py0000664000000000000000000000325612252035543016747 0ustar #!/usr/bin/env python # -*- coding: utf-8 -*- """Integration of package managers into UpdateManager""" # (c) 2005-2009 Canonical, GPL import os import os.path from gi.repository import GObject class InstallBackend(GObject.GObject): """The abstract backend that can install/remove packages""" (INSTALL, UPDATE) = range(2) def __init__(self, window_main): """init backend takes a gtk main window as parameter """ GObject.GObject.__init__(self) self.window_main = window_main def commit(self, pkgs_install, pkgs_upgrade, close_on_done): """Commit the cache changes """ raise NotImplemented def update(self): """Run a update to refresh the package list""" raise NotImplemented def get_backend(*args, **kwargs): """Select and return a package manager backend.""" # try aptdaemon if (os.path.exists("/usr/sbin/aptd") and not "UPDATE_MANAGER_FORCE_BACKEND_SYNAPTIC" in os.environ): # check if the gtkwidgets are installed as well try: from .InstallBackendAptdaemon import InstallBackendAptdaemon return InstallBackendAptdaemon(*args, **kwargs) except ImportError: import logging logging.exception("importing aptdaemon") # try synaptic if (os.path.exists("/usr/sbin/synaptic") and not "UPDATE_MANAGER_FORCE_BACKEND_APTDAEMON" in os.environ): from .InstallBackendSynaptic import InstallBackendSynaptic return InstallBackendSynaptic(*args, **kwargs) # nothing found, raise raise Exception("No working backend found, please try installing " "synaptic or aptdaemon") apturl-0.5.2ubuntu4/AptUrl/__init__.py0000664000000000000000000000000012252035543014553 0ustar apturl-0.5.2ubuntu4/AptUrl/Parser.py0000664000000000000000000001216512252035543014267 0ustar # Copyright (c) 2007-2008 Canonical # # AUTHOR: # Michael Vogt # With contributions by Siegfried-A. Gevatter # # This file is part of AptUrl # # AptUrl is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as published # by the Free Software Foundation; either version 2 of the License, or (at # your option) any later version. # # AptUrl is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with AptUrl; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os import string from string import Template from .Helpers import get_dist from .Helpers import _ class InvalidUrlException(Exception): def __init__(self, url, msg=""): self.url = url self.message = msg def __str__(self): return self.message MAX_URL_LEN=255 # substituion mapping apturl_substitution_mapping = { "distro" : get_dist(), "kernel" : os.uname()[2] } # whitelist for the uri whitelist = [] whitelist.extend(string.ascii_letters) whitelist.extend(string.digits) whitelist.extend(['_',':','?','/','+','.','~','=','<','>','-',',','$','&']) class AptUrl(object): " a class that contains the parsed data from an apt url " def __init__(self): self.package = None self.schema = None self.minver = None self.refresh = None # for added repos self.keyfile = None self.repo_url = None self.dist = '/' # for known sections self.section = [] # for known channels self.channel = None def is_format_package_name(string): " return True if string would be an acceptable name for a Debian package " return (string.replace("+", "").replace("-", "").replace(".", "").replace(":", "").isalnum() and string.islower() and string[0].isalnum() and len(string) > 1) def do_apt_url_substitution(apt_url, mapping): " substitute known templates against the field package and channel " for field in ["package","channel"]: if getattr(apt_url, field): s=Template(getattr(apt_url, field)) setattr(apt_url, field, s.substitute(mapping)) def match_against_whitelist(raw_url): " test if the url matches the internal whitelist " for char in raw_url: if not char in whitelist: raise InvalidUrlException( raw_url, _("Non whitelist char in the uri")) return True def set_value(apt_url, s): " set a key,value pair from string s to AptUrl object " (key, value) = s.split("=") try: if ' ' in value: raise InvalidUrlException(apt_url, _("Whitespace in key=value")) if type(getattr(apt_url, key)) == type([]): getattr(apt_url, key).append(value) else: setattr(apt_url, key, value) except Exception as e: raise InvalidUrlException(apt_url, _("Exception '%s'") % e) def parse(full_url, mapping=apturl_substitution_mapping): " parse an apt url and return a list of AptUrl objects " # apt:pkg1?k11=v11?k12=v12,pkg2?k21=v21?k22=v22,... res = [] if len(full_url) > MAX_URL_LEN: url = "%s ..." % full_url[0:(MAX_URL_LEN // 10)] raise InvalidUrlException(url, _("Url string '%s' too long") % url) # check against whitelist match_against_whitelist(full_url) for url in full_url.split(";"): if not ":" in url: raise InvalidUrlException(url, _("No ':' in the uri")) # now parse it (schema, packages) = url.split(":", 1) packages = packages.split(",") for package in packages: apt_url = AptUrl() apt_url.schema = schema # check for schemas of the form: apt+http:// if schema.startswith("apt+"): apt_url.repo_url = schema[len("apt+"):] + ":" + package.split("?",1)[0] else: if "?" in package: apt_url.package = package.split("?")[0].lstrip("/") else: apt_url.package = package.lstrip("/") # now parse the ?... bits if "?" in package: key_value_pairs = package.split("?")[1:] for s in key_value_pairs: if "&" in s: and_key_value_pairs = s.split("&") for s in and_key_value_pairs: set_value(apt_url, s) else: set_value(apt_url, s) # do substitution (if needed) do_apt_url_substitution(apt_url, mapping) # check if the package name is valid if not is_format_package_name(apt_url.package): raise InvalidUrlException(url, "Invalid package name '%s'" % apt_url.package) res.append(apt_url) return res apturl-0.5.2ubuntu4/AptUrl/UI.py0000664000000000000000000000322412252035543013344 0ustar from .Helpers import _, _n class AbstractUI(object): # generic dialogs def error(self, summary, msg): return False def yesNoQuestion(self, summary, msg, title, default='no'): pass def message(self, summary, msg): return True # specific dialogs def askEnableSections(self, sections): " generic implementation, can be overridden " return self.yesNoQuestion(_("Enable additional components"), _n("Do you want to enable the following " "component: '%s'?", "Do you want to enable the following " "components: '%s'?", len(sections)) % ", ".join(sections)) def askEnableChannel(self, channel, channel_info_html): " generic implementation, can be overridden " return self.yesNoQuestion(_("Enable additional software channel"), _("Do you want to enable the following " "software channel: '%s'?") % channel) def askInstallPackage(self): pass # install/update progress def doUpdate(self): pass def doInstall(self, pkglist): pass # UI specific actions for enabling stuff # FIXME: the next two functions shoud go into generic code # that checks for the availablility of tools # like gksu or kdesudo and uses them # appropriately def doEnableSection(self, sections): pass def doEnableChannel(self, channelpath, channelkey): pass apturl-0.5.2ubuntu4/apturl-gtk0000775000000000000000000000301012252035543013257 0ustar #!/usr/bin/python3 # # Copyright (c) 2007-2008 Canonical # # AUTHOR: # Michael Vogt # With contributions by Siegfried-A. Gevatter # # This file is part of AptUrl # # AptUrl is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as published # by the Free Software Foundation; either version 2 of the License, or (at # your option) any later version. # # AptUrl is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with AptUrl; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ignore apt's "API not stable yet" warning import warnings warnings.filterwarnings("ignore", category=FutureWarning, append=1) import sys import gettext from gettext import gettext as _ from AptUrl.AptUrl import AptUrlController, RESULT_CANCELT from AptUrl.gtk.GtkUI import GtkUI if __name__ == "__main__": localesApp="apturl" localesDir="/usr/share/locale" gettext.bindtextdomain(localesApp, localesDir) gettext.textdomain(localesApp) ui = GtkUI() apturl = AptUrlController(ui) try: sys.exit(apturl.main()) except KeyboardInterrupt: print(_("User requested interrupt.")) sys.exit(RESULT_CANCELT)