mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Matt Mackall <mpm@selenic.com>
Cc: Esben Nielsen <simlo@phys.au.dk>,
	Michal Schmidt <xschmi00@stud.feec.vutbr.cz>,
	linux-kernel@vger.kernel.org
Subject: Re: [ketchup] patch to alt urls for local trees
Date: Fri, 28 Oct 2005 16:46:30 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0510281639030.13877@localhost.localdomain> (raw)
In-Reply-To: <20051028170030.GA4367@waste.org>


On Fri, 28 Oct 2005, Matt Mackall wrote:

> Hmm. I think I'd prefer to generalize this by adding another field to
> the tree array. Care to take a stab at it?

Argh, you ask, I do!

Man, a day with python really makes you hate it! ;-)
OK, I'm a perl guy, and I'm much more comfortable with that. But I did
manage to get python to do what I wanted.

If you add a 6 element to the version_info tree, it will be used as an
alternate url.  I tested this a little, and it seems to work.  Might want
to review it though. I'm still not comfortable with python, and I only did
some small tests.  Basically I checked to see if it would work if it had
the 6th element, and if it didn't.  But not much else was done to test.

-- Steve

Index: Ketchup-d9503020b3c1/ketchup
===================================================================
--- Ketchup-d9503020b3c1.orig/ketchup	2005-10-28 14:46:04.000000000 -0400
+++ Ketchup-d9503020b3c1/ketchup	2005-10-28 16:34:16.000000000 -0400
@@ -280,11 +280,17 @@
     '2.6-git': (latest_dir,
                kernel_url + "/v2.6" +
                "/snapshots/patch-%(full)s.bz2", r'patch-(.*?).bz2',
-               1, "current stable kernel series snapshots"),
+               1, "current stable kernel series snapshots",
+               kernel_url + "/v2.6" +
+               "/snapshots/old/patch-%(full)s.bz2"
+	       ),
     '2.6-bk': (latest_dir,
                kernel_url + "/v2.6" +
                "/snapshots/patch-%(full)s.bz2", r'patch-(.*?).bz2',
-               1, "old stable kernel series snapshots"),
+               1, "old stable kernel series snapshots",
+               kernel_url + "/v2.6" +
+               "/snapshots/old/patch-%(full)s.bz2"
+	       ),
     '2.6-tip': (latest_26_tip, "", "", 1,
                 "current stable kernel series tip"),
     '2.6-mm': (latest_mm,
@@ -302,11 +308,11 @@
     '2.6-rt': (latest_dir,
                 "http://people.redhat.com/mingo/realtime-preempt/patch-%(full)s",
 		r'patch-(2.6.*?)',
-		0, "Ingo Molnar's realtime-preempt kernel")
+		0, "Ingo Molnar's realtime-preempt kernel",
+                "http://people.redhat.com/mingo/realtime-preempt/older/patch-%(full)s")
     }

-def version_url(ver, sign = 0):
-    """ Return the URL for the patch associated with the specified version """
+def find_info(ver):
     b = "%.1f" % tree(ver)
     f = forkname(ver)
     p = pre(ver)
@@ -314,10 +320,16 @@
     s = b
     if f: s = "%s-%s" % (b, f)
     elif p: s = "%s-pre" % b
+
+    return version_info[s]

+def version_url(ver, sign = 0):
+    """ Return the URL for the patch associated with the specified version """
     if sign and options["no-gpg"]: return None
     if sign and not version_info[s][3]: return None

+    i = find_info(ver)
+
     v = {
         'full': ver,
         'tree': tree(ver),
@@ -325,11 +337,29 @@
         'prebase': prebase(ver)
         }

-    u = version_info[s][1] % v
+    u = i[1] % v

     if sign: u += ".sign"
     return u

+def version_url2(ver):
+    i = find_info(ver)
+
+    if len(i) < 6:
+    	s = i[1]
+    else:
+        s = i[5]
+
+    v = {
+        'full': ver,
+        'tree': tree(ver),
+        'base': base(ver),
+        'prebase': prebase(ver)
+        }
+
+    return s % v
+
+
 def patch_path(ver):
     return os.path.join(archive, os.path.basename(version_url(ver)))

@@ -349,13 +379,10 @@

     return 1

-def trydownload(url, file):
+def trydownload(url, file, url2):
     if download(url, file): return file

-    # the jgarzik memorial hack
-    url2 = re.sub("/snapshots/", "/snapshots/old/", url)
-    url2 = re.sub("/realtime-preempt/", "/realtime-preempt/older/", url2)
-    if url2 != url:
+    if url2 != url :
         if download(url2, file): return file
         if url2[-4:] == ".bz2":
             f2 = file[:-4] + ".gz"
@@ -372,7 +399,7 @@
 def verify(signurl, file):
     if options["gpg-path"] and signurl and not options["dry-run"]:
         sf = file + ".sign"
-        sf = trydownload(signurl, sf)
+        sf = trydownload(signurl, sf, signurl)
         if not sf:
             error("signature download failed")
             error("removing files...")
@@ -398,7 +425,8 @@
         if os.path.exists(f2): return f2

     url = version_url(ver)
-    f = trydownload(url, f)
+    url2 = version_url2(ver)
+    f = trydownload(url, f, url2)
     if not f:
         error("patch download failed")
         sys.exit(-1)

  reply	other threads:[~2005-10-28 20:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-17  7:38 ketchup+rt with ktimers added Steven Rostedt
2005-10-17 21:39 ` Matt Mackall
2005-10-18  6:20   ` Steven Rostedt
2005-10-18  6:30     ` Matt Mackall
2005-10-18  6:45       ` Steven Rostedt
2005-10-18  7:29         ` Matt Mackall
2005-10-28 12:54           ` [ketchup] patch to allow for moving of .gitignore in 2.6.14 Steven Rostedt
2005-10-28 13:35             ` [ketchup] patch to alt urls for local trees Steven Rostedt
2005-10-28 17:00               ` Matt Mackall
2005-10-28 20:46                 ` Steven Rostedt [this message]
2005-10-30 19:53                   ` Matt Mackall
2005-10-28 14:49             ` [ketchup] patch to allow for moving of .gitignore in 2.6.14 Steven Rostedt
2005-10-29 21:06             ` Steven Rostedt
2005-10-29 21:06               ` Matt Mackall
2005-10-29 23:56                 ` Steven Rostedt
2005-10-30  1:19               ` David Weinehall
2005-10-30  2:10                 ` Steven Rostedt
2005-10-30  3:48                 ` Steven Rostedt
2005-10-30  6:56                   ` Patrick McFarland
2005-10-30 17:59                   ` Matt Mackall

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=Pine.LNX.4.58.0510281639030.13877@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=simlo@phys.au.dk \
    --cc=xschmi00@stud.feec.vutbr.cz \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®