public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] stabilitylevels and such issues.
@ 2002-04-20  0:56 Terje Kvernes
  2002-04-20  4:37 ` Mike Payson
  0 siblings, 1 reply; 8+ messages in thread
From: Terje Kvernes @ 2002-04-20  0:56 UTC (permalink / raw
  To: gentoo-dev

  I've done some hacking (okay, ugly hacking) with portage lately.
  reading some source and trying to get a grasp at the code.  so far
  I've only patched 'dep_bestmatch' to deal with stability-symlinks in
  the portage tree.

  this is what the patch actually does:

almach freeciv # PORTAGE_LEVEL="STABLE" emerge --pretend freeciv
These are the packages that I would merge, in order.
Calculating dependencies ...done!
[ebuild  N   ] app-games/freeciv-1.12.0-r1 to /

almach freeciv # emerge --pretend freeciv
These are the packages that I would merge, in order.
Calculating dependencies ...done!
[ebuild  N   ] app-games/freeciv-1.12.0-r2 to /

almach / # ls -la /usr/portage/app-games/freeciv/
total 15
drwxr-xr-x    3 root  root   216 Apr 20 01:47 .
drwxr-xr-x   60 root  root  1608 Apr 19 12:20 ..
-rw-r--r--    1 root  root   987 Mar 29 15:52 ChangeLog
drwxr-xr-x    2 root  root   128 Apr 19 12:20 files
-rw-r--r--    1 root  root  1288 Feb  6 23:58 freeciv-1.12.0-r1.ebuild
-rw-r--r--    1 root  root  1321 Mar 29 15:52 freeciv-1.12.0-r2.ebuild
lrwxrwxrwx    1 root  root    24 Apr 20 01:47 freeciv-stable -> freeciv-1.12.0-r1.ebuild

  notice that last symlink.  :)

  this is against 1.9.1, I haven't even looked at any other version of
  portage. 

  now, I don't expect this to get anywhere near the main tree.  don't
  worry about that.  :) 

  I am however curious to how what people think of the idea, and the
  implementation.  it probably shows that I haven't coded python in a
  year or so.  and no, this hasn't been tested overly much, just
  enough for me to feel that it apparently "works for me".  please,
  thump me over the head if there is a reason to do so.

  I know some people want a package.mask to do separate stable
  releases, and they probably know I don't like that one bit.
  personally, I'm going to take a snapshot of my now stable system
  using this scheme.  all I need to do is to make a
  "<package>-sysok"-symlink for each installed package.  this should
  also hopefully allow me to do rollbacks if I need to do so.

  if anyone is wondering on the status of the update-flags I also
  want, well, that'll need quite a bit more work.  it will need to be
  integrated into the datastructure that portage uses to keep track of
  packages internally -- which will take time.

  anyhow, the patch.  I know, I should patch against the portage
  sourcecode directly.  but still.  :)

--- /usr/lib/python2.2/site-packages/portage-clean.py   Sat Apr 20 01:19:57 2002
+++ /usr/lib/python2.2/site-packages/portage.py Sat Apr 20 02:29:04 2002
@@ -2081,6 +2081,21 @@
                        else:
                                return mymatch
                elif not isspecific(mypkgdep):
+                       keys = os.environ.keys()
+                       
+                       if 'PORTAGE_LEVEL' in keys:
+                               if mypkgdep.find("/") > -1:
+                                       level = os.environ['PORTAGE_LEVEL']
+                                       [ dir, name ] = mypkgdep.split("/")
+                                       try:
+                                               ebuild = os.readlink("/usr/portage/" + mypkgdep + "/" + name + "-" + level.lower())
+                                               ebuild = ebuild.replace(".ebuild", "")
+                                               return self.dep_bestmatch("=" + ebuild)
+                                       except OSError:
+                                               print "\n>>> " + mypkgdep + " has no ebuild with label '" + level + "'."
+                                               sys.exit(1)
+
+
                        if not self.hasnode(mypkgdep):
                                return ""
                        mynodes=self.getnode(mypkgdep)[:]


-- 
Terje


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-04-21 23:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-20  0:56 [gentoo-dev] stabilitylevels and such issues Terje Kvernes
2002-04-20  4:37 ` Mike Payson
2002-04-20 10:56   ` Terje Kvernes
2002-04-20 18:31     ` Mike Payson
2002-04-21  2:12       ` Terje Kvernes
2002-04-21  5:26         ` Mike Payson
2002-04-21  5:29         ` Mike Payson
2002-04-21 23:47     ` Terje Kvernes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox