ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] apt-python
Date: Fri, 23 May 2008 17:05:21 +0400
Message-ID: <20080523130521.GG7750@solemn.turbinal> (raw)
In-Reply-To: <b966c1e40805230447i2dee896ak19cd6cb5d089ceb0@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2212 bytes --]

On Fri, May 23, 2008 at 03:47:35PM +0400, Alexey Shabalin wrote:
> 23 мая 2008 г. 15:23 пользователь Alexey Tourbin написал:
> > Я также посмотрел код PackageKit, и у меня сложилось предварительное
> > мнение, что даже если эти байндинги в текущем их виде починить, то
> > PackageKit всё равно не заработает.
> 
> Жаль. Хотелось бы его видеть в сизифе работающим.

backends/apt/helpers/aptBackend.py:
   449      def install_files (self, inst_files):
   450          '''
   451          Implement the {backend}-install_files functionality
   452          Install the package containing the inst_file file
   453          '''
   454          if not exists(inst_file):
   455              self.error(ERROR_PACKAGE_NOT_FOUND,"Can't find %s"%inst_file)
   456              return
   457          deb = DebPackage(inst_file)
   458          deps = {}
   459          for k in ["Depends","Recommends"]:
   460              if not deb._sections.has_key(k):
   461                  continue
   462              for items in apt_pkg.ParseDepends(deb[k]):
   463                  assert len(items) == 1,"Can't handle or deps properly yet"
   464                  (pkg,ver,comp) = items[0]
   465                  if not deps.has_key(pkg):
   466                      deps[pkg] = []
   467                  deps[pkg].append((ver,comp))
   468          for n in deps.keys():
   469             p = Package(self,self._apt_cache[n],version=deps[n])
   470             if not p.isInstalled:
   471                 p.markInstall()
   472          assert self._apt_cache.getChanges()==[],"Don't handle install changes yet"
   473          # FIXME: nasty hack. Need a better way in
   474          ret = system("dpkg -i %s"%inst_file)
   475          if ret!=0:
   476              self.error(ERROR_UNKNOWN,"Can't install package")

В каждом шкафу есть свой скелет.

Есть вообще сомнения, что этот код работает (даже с дебиановским аптом).
Обратите внимание на разницу между inst_files в аргументе и inst_file
в теле функции.  Просто питон отвалит в момент вызова этого кода и всё.

Впрочем, можно надеяться, что этот код будет вызываться не всякий раз.
Чего, так сказать, Вам желаю.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  parent reply	other threads:[~2008-05-23 13:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-22 14:37 Boris Savelev
2008-05-22 17:59 ` Boris Savelev
2008-05-23  6:52   ` Alexey Tourbin
2008-05-23  8:49     ` Boris Savelev
2008-05-23 10:39       ` Alexey Tourbin
2008-05-23 11:07         ` Led
2008-05-23 11:23           ` Alexey Tourbin
2008-05-23 11:47             ` Alexey Shabalin
2008-05-23 12:01               ` Alexey Tourbin
2008-05-23 13:05               ` Alexey Tourbin [this message]
2008-05-23 11:12 ` Dmitry V. Levin
2008-05-23 11:55   ` Boris Savelev
2008-05-23 12:13     ` Dmitry V. Levin
2008-05-23 13:02       ` Boris Savelev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080523130521.GG7750@solemn.turbinal \
    --to=at@altlinux.ru \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git