2005-10-17 07:40:45

by Steven Rostedt

[permalink] [raw]
Subject: ketchup+rt with ktimers added.


Here's another update patch to ketchup based on Michal Schmidts patched
version of Matt Mackall's ketchup at
http://www.uamt.feec.vutbr.cz/rizeni/pom/ketchup-0.9+rt
This patch adds Thomas Gleixner's ktimers (both base kt and HRT versions).

Since the base version of Michal Schmidt's ketchup-0.9+rt didn't include
Esben Nielsen's addition of handling Ingo's older kernels, I again
included it with this patch.

-- Steve

--- ketchup-0.9+rt 2005-08-16 08:25:40.000000000 -0400
+++ ketchup 2005-10-17 03:09:53.000000000 -0400
@@ -311,7 +311,15 @@
'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"),
+ '2.6-kt': (latest_dir,
+ "http://www.tglx.de/projects/ktimers/patch-%(full)s.patch",
+ r'patch-(2.6.*?)',
+ 0, "Thomas Gleixner's ktimers."),
+ '2.6-kthrt': (latest_dir,
+ "http://www.tglx.de/projects/ktimers/patch-%(full)s.patch",
+ r'patch-(2.6.*?)',
+ 0, "Thomas Gleixner's ktimers and HRT patches.")
}

def version_url(ver, sign = 0):
@@ -363,6 +371,7 @@

# the jgarzik memorial hack
url2 = re.sub("/snapshots/", "/snapshots/old/", url)
+ url2 = re.sub("/realtime-preempt/", "/realtime-preempt/older/", url2)
if url2 != url:
if download(url2, file): return file
if url2[-4:] == ".bz2":


2005-10-17 21:40:51

by Matt Mackall

[permalink] [raw]
Subject: Re: ketchup+rt with ktimers added.

On Mon, Oct 17, 2005 at 03:38:49AM -0400, Steven Rostedt wrote:
>
> Here's another update patch to ketchup based on Michal Schmidts patched
> version of Matt Mackall's ketchup at
> http://www.uamt.feec.vutbr.cz/rizeni/pom/ketchup-0.9+rt
> This patch adds Thomas Gleixner's ktimers (both base kt and HRT versions).

Thomas has indicated that these trees might not be very long-lived. So
instead, I've added the ability to make local extensions:

.ketchuprc:

local_trees = {
'2.6-kt': (latest_dir,
"http://www.tglx.de/projects/ktimers/patch-%(full)s.patch",
r'patch-(2.6.*?)',
0, "Thomas Gleixner's ktimers."),
'2.6-kthrt': (latest_dir,
"http://www.tglx.de/projects/ktimers/patch-%(full)s.patch",
r'patch-(2.6.*?)',
0, "Thomas Gleixner's ktimers and HRT patches.")
}

$ ./ketchup -s 2.6-kt
2.6.14-rc4-kthrt3.patch

> Since the base version of Michal Schmidt's ketchup-0.9+rt didn't include
> Esben Nielsen's addition of handling Ingo's older kernels, I again
> included it with this patch.

That's been in tip for a while:

http://selenic.com/repo/ketchup/

--
Mathematics is the supreme nostalgia of our time.

2005-10-18 06:21:04

by Steven Rostedt

[permalink] [raw]
Subject: Re: ketchup+rt with ktimers added.


On Mon, 17 Oct 2005, Matt Mackall wrote:

> On Mon, Oct 17, 2005 at 03:38:49AM -0400, Steven Rostedt wrote:
> >

>
> Thomas has indicated that these trees might not be very long-lived. So
> instead, I've added the ability to make local extensions:
>
> .ketchuprc:
>
> local_trees = {
> '2.6-kt': (latest_dir,
> "http://www.tglx.de/projects/ktimers/patch-%(full)s.patch",
> r'patch-(2.6.*?)',
> 0, "Thomas Gleixner's ktimers."),
> '2.6-kthrt': (latest_dir,
> "http://www.tglx.de/projects/ktimers/patch-%(full)s.patch",
> r'patch-(2.6.*?)',
> 0, "Thomas Gleixner's ktimers and HRT patches.")
> }
>
> $ ./ketchup -s 2.6-kt
> 2.6.14-rc4-kthrt3.patch

I did not know about this extension. Good to know, thanks.

>
> > Since the base version of Michal Schmidt's ketchup-0.9+rt didn't include
> > Esben Nielsen's addition of handling Ingo's older kernels, I again
> > included it with this patch.
>
> That's been in tip for a while:
>
> http://selenic.com/repo/ketchup/
>

I didn't know about your repo directory. Sorry, didn't have time to look
too deep into this. I just did a few searches on the web and found
different links scattered around. I was just interested in the RT stuff,
so I didn't go to deep.

Actually, if you had a link to the repo from
http://www.selenic.com/ketchup/ I would have found it.

Thanks for the info, and hopefully this will now be public enough so other
thick headed people (like myself :-) knows about the local extensions.

Cheers,

-- Steve

2005-10-18 06:32:12

by Matt Mackall

[permalink] [raw]
Subject: Re: ketchup+rt with ktimers added.

On Tue, Oct 18, 2005 at 02:20:38AM -0400, Steven Rostedt wrote:
>
> On Mon, 17 Oct 2005, Matt Mackall wrote:
>
> > On Mon, Oct 17, 2005 at 03:38:49AM -0400, Steven Rostedt wrote:
> > >
>
> >
> > Thomas has indicated that these trees might not be very long-lived. So
> > instead, I've added the ability to make local extensions:
> >
> > .ketchuprc:
> >
> > local_trees = {
> > '2.6-kt': (latest_dir,
> > "http://www.tglx.de/projects/ktimers/patch-%(full)s.patch",
> > r'patch-(2.6.*?)',
> > 0, "Thomas Gleixner's ktimers."),
> > '2.6-kthrt': (latest_dir,
> > "http://www.tglx.de/projects/ktimers/patch-%(full)s.patch",
> > r'patch-(2.6.*?)',
> > 0, "Thomas Gleixner's ktimers and HRT patches.")
> > }
> >
> > $ ./ketchup -s 2.6-kt
> > 2.6.14-rc4-kthrt3.patch
>
> I did not know about this extension. Good to know, thanks.

Didn't exist until today, motivated entirely by your message.

> > > Since the base version of Michal Schmidt's ketchup-0.9+rt didn't include
> > > Esben Nielsen's addition of handling Ingo's older kernels, I again
> > > included it with this patch.
> >
> > That's been in tip for a while:
> >
> > http://selenic.com/repo/ketchup/
> >
>
> I didn't know about your repo directory. Sorry, didn't have time to look
> too deep into this. I just did a few searches on the web and found
> different links scattered around. I was just interested in the RT stuff,
> so I didn't go to deep.
>
> Actually, if you had a link to the repo from
> http://www.selenic.com/ketchup/ I would have found it.

It's here:

http://www.selenic.com/ketchup/wiki/

--
Mathematics is the supreme nostalgia of our time.

2005-10-18 06:45:58

by Steven Rostedt

[permalink] [raw]
Subject: Re: ketchup+rt with ktimers added.


On Mon, 17 Oct 2005, Matt Mackall wrote:

> On Tue, Oct 18, 2005 at 02:20:38AM -0400, Steven Rostedt wrote:

> > I did not know about this extension. Good to know, thanks.
>
> Didn't exist until today, motivated entirely by your message.

Good, so this is a good example of some one sending crap (me) inspiring
someone else into greatness (you). Sorry, this is an inside joke between
Ingo, Thomas, others and myself. :-) (it had nothing to do with you or
your code, it was all about RT)

>
> > > > Since the base version of Michal Schmidt's ketchup-0.9+rt didn't include
> > > > Esben Nielsen's addition of handling Ingo's older kernels, I again
> > > > included it with this patch.
> > >
> > > That's been in tip for a while:
> > >
> > > http://selenic.com/repo/ketchup/
> > >
> >
> > I didn't know about your repo directory. Sorry, didn't have time to look
> > too deep into this. I just did a few searches on the web and found
> > different links scattered around. I was just interested in the RT stuff,
> > so I didn't go to deep.
> >
> > Actually, if you had a link to the repo from
> > http://www.selenic.com/ketchup/ I would have found it.
>
> It's here:
>
> http://www.selenic.com/ketchup/wiki/

Ahh, I did see this. That word "Mercurial" scared me from looking further!

-- Steve

2005-10-18 07:31:06

by Matt Mackall

[permalink] [raw]
Subject: Re: ketchup+rt with ktimers added.

On Tue, Oct 18, 2005 at 02:45:27AM -0400, Steven Rostedt wrote:
> > > I didn't know about your repo directory. Sorry, didn't have time to look
> > > too deep into this. I just did a few searches on the web and found
> > > different links scattered around. I was just interested in the RT stuff,
> > > so I didn't go to deep.
> > >
> > > Actually, if you had a link to the repo from
> > > http://www.selenic.com/ketchup/ I would have found it.
> >
> > It's here:
> >
> > http://www.selenic.com/ketchup/wiki/
>
> Ahh, I did see this. That word "Mercurial" scared me from looking further!

Scared? One of the many nice features of Mercurial is you can easily
grab a tarball of a given revision by clicking on one of the archive
links.

http://selenic.com/repo/ketchup/?cmd=archive;node=tip;type=bz2

I've added this snapshot link to the wiki. An actual release should be
appearing shortly.

--
Mathematics is the supreme nostalgia of our time.

2005-10-28 12:54:19

by Steven Rostedt

[permalink] [raw]
Subject: [ketchup] patch to allow for moving of .gitignore in 2.6.14

Hi Matt,

Here's a small patch to ketchup to make it move the .gitignore that is
now included in 2.6.14.

-- Steve

Index: Ketchup-d9503020b3c1/ketchup
===================================================================
--- Ketchup-d9503020b3c1.orig/ketchup 2005-10-28 08:38:50.000000000 -0400
+++ Ketchup-d9503020b3c1/ketchup 2005-10-28 08:48:37.000000000 -0400
@@ -482,7 +482,7 @@
error("Unpacking failed: ", err)
sys.exit(-1)

- err = os.system("mv linux*/* . ; rmdir linux*")
+ err = os.system("mv linux*/* linux*/.git* . ; rmdir linux*")
if err:
error("Unpacking failed: ", err)
sys.exit(-1)


2005-10-28 13:36:01

by Steven Rostedt

[permalink] [raw]
Subject: [ketchup] patch to alt urls for local trees

Hi Matt,

Here's another patch. This one allows for local alternative url paths.
As you know, I use ketchup for Thomas Gleixner's ktimers. He also
stores his archives differently than everyone else. So I have as
my .ketchuprc the following.

local_trees = {
'2.6-kt': (latest_dir,
"http://www.tglx.de/projects/ktimers/patch-%(full)s.patch",
r'patch-(2.6.*?)',
0, "Thomas Gleixner's ktimers."),
'2.6-kthrt': (latest_dir,
"http://www.tglx.de/projects/ktimers/patch-%(full)s.patch",
r'patch-(2.6.*?)',
0, "Thomas Gleixner's ktimers and HRT patches.")
}

local_alturls = {
'/ktimers/' : "/ktimers/archive/"
}



With the below patch to grab the older ktimer patches.

Now, I would like to let you know that I've only written one program in
python for all my life. So I am not very comfortable writing code for
it. So if you can clean this up, I wouldn't mind. For now, this works
for me.

-- Steve

Index: Ketchup-d9503020b3c1/ketchup
===================================================================
--- Ketchup-d9503020b3c1.orig/ketchup 2005-10-28 08:48:37.000000000 -0400
+++ Ketchup-d9503020b3c1/ketchup 2005-10-28 09:27:31.000000000 -0400
@@ -89,6 +89,7 @@
precommand = postcommand = None
default_tree = None
local_trees = {}
+local_alturls = {}

def qprint(*args):
if not options["quiet"]:
@@ -355,6 +356,9 @@
# the jgarzik memorial hack
url2 = re.sub("/snapshots/", "/snapshots/old/", url)
url2 = re.sub("/realtime-preempt/", "/realtime-preempt/older/", url2)
+ for exp,rep in local_alturls.items():
+ if url2 != url: break
+ url2 = re.sub(exp, rep, url2)
if url2 != url:
if download(url2, file): return file
if url2[-4:] == ".bz2":


2005-10-28 14:49:54

by Steven Rostedt

[permalink] [raw]
Subject: Re: [ketchup] patch to allow for moving of .gitignore in 2.6.14

On Fri, 2005-10-28 at 08:54 -0400, Steven Rostedt wrote:
> Hi Matt,
>
> Here's a small patch to ketchup to make it move the .gitignore that is
> now included in 2.6.14.
>
> -- Steve
>
> Index: Ketchup-d9503020b3c1/ketchup
> ===================================================================
> --- Ketchup-d9503020b3c1.orig/ketchup 2005-10-28 08:38:50.000000000 -0400
> +++ Ketchup-d9503020b3c1/ketchup 2005-10-28 08:48:37.000000000 -0400
> @@ -482,7 +482,7 @@
> error("Unpacking failed: ", err)
> sys.exit(-1)
>
> - err = os.system("mv linux*/* . ; rmdir linux*")
> + err = os.system("mv linux*/* linux*/.git* . ; rmdir linux*")
> if err:
> error("Unpacking failed: ", err)
> sys.exit(-1)
>

Unfortunately, the above shows an error message (but does not fail) for
2.6.13. Here's a better updated fix/hack to allow for either
having .gitignore, or not.

-- Steve

Index: Ketchup-d9503020b3c1/ketchup
===================================================================
--- Ketchup-d9503020b3c1.orig/ketchup 2005-10-28 08:38:50.000000000 -0400
+++ Ketchup-d9503020b3c1/ketchup 2005-10-28 10:45:43.000000000 -0400
@@ -482,7 +482,7 @@
error("Unpacking failed: ", err)
sys.exit(-1)

- err = os.system("mv linux*/* . ; rmdir linux*")
+ err = os.system("shopt -s dotglob; mv linux*/* . ; rmdir linux*")
if err:
error("Unpacking failed: ", err)
sys.exit(-1)


2005-10-28 17:05:54

by Matt Mackall

[permalink] [raw]
Subject: Re: [ketchup] patch to alt urls for local trees

On Fri, Oct 28, 2005 at 09:35:46AM -0400, Steven Rostedt wrote:
> Hi Matt,
>
> Here's another patch. This one allows for local alternative url paths.
> As you know, I use ketchup for Thomas Gleixner's ktimers. He also
> stores his archives differently than everyone else. So I have as
> my .ketchuprc the following.
>
> local_trees = {
> '2.6-kt': (latest_dir,
> "http://www.tglx.de/projects/ktimers/patch-%(full)s.patch",
> r'patch-(2.6.*?)',
> 0, "Thomas Gleixner's ktimers."),
> '2.6-kthrt': (latest_dir,
> "http://www.tglx.de/projects/ktimers/patch-%(full)s.patch",
> r'patch-(2.6.*?)',
> 0, "Thomas Gleixner's ktimers and HRT patches.")
> }
>
> local_alturls = {
> '/ktimers/' : "/ktimers/archive/"
> }

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

--
Mathematics is the supreme nostalgia of our time.

2005-10-28 20:46:57

by Steven Rostedt

[permalink] [raw]
Subject: Re: [ketchup] patch to alt urls for local trees


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)

2005-10-29 21:06:38

by Steven Rostedt

[permalink] [raw]
Subject: Re: [ketchup] patch to allow for moving of .gitignore in 2.6.14


I already posted this patch to Matt and LKML, but I'm posting it again
incase anyone else has this problem using ketchup on 2.6.14 from nothing,
and does a google looking for a fix.

Here's the current output error:

$ ketchup 2.6.14
None -> 2.6.14
Unpacking linux-2.6.14.tar.bz2
rmdir: `linux-2.6.14': Directory not empty
ketchup: Unpacking failed:
256


Here's the patch:

-- Steve

Index: Ketchup-d9503020b3c1/ketchup
===================================================================
--- Ketchup-d9503020b3c1.orig/ketchup 2005-10-28 08:38:50.000000000 -0400
+++ Ketchup-d9503020b3c1/ketchup 2005-10-28 10:45:43.000000000 -0400
@@ -482,7 +482,7 @@
error("Unpacking failed: ", err)
sys.exit(-1)

- err = os.system("mv linux*/* . ; rmdir linux*")
+ err = os.system("shopt -s dotglob; mv linux*/* . ; rmdir linux*")
if err:
error("Unpacking failed: ", err)
sys.exit(-1)

2005-10-29 21:12:04

by Matt Mackall

[permalink] [raw]
Subject: Re: [ketchup] patch to allow for moving of .gitignore in 2.6.14

On Sat, Oct 29, 2005 at 05:06:21PM -0400, Steven Rostedt wrote:
>
> I already posted this patch to Matt and LKML, but I'm posting it again
> incase anyone else has this problem using ketchup on 2.6.14 from nothing,
> and does a google looking for a fix.

This needs a more robust fix. Like perhaps passing --strip-components
to tar.

--
Mathematics is the supreme nostalgia of our time.

2005-10-29 23:56:18

by Steven Rostedt

[permalink] [raw]
Subject: Re: [ketchup] patch to allow for moving of .gitignore in 2.6.14


On Sat, 29 Oct 2005, Matt Mackall wrote:

> On Sat, Oct 29, 2005 at 05:06:21PM -0400, Steven Rostedt wrote:
> >
> > I already posted this patch to Matt and LKML, but I'm posting it again
> > incase anyone else has this problem using ketchup on 2.6.14 from nothing,
> > and does a google looking for a fix.
>
> This needs a more robust fix. Like perhaps passing --strip-components
> to tar.
>

OK, but I was just adding a fix that was closest to what was already
there. I can play around with other fixes, and try that out too. The
change I made was just like the current method, but it allowed for all
files to be copied instead of just the non-dot ones.

Also, have you looked at the addition to the version_info for alternate
urls. I think that this can even be added to do multiple urls, as well
as testing for different filenames in all urls first. ie. .bz2 or .gz,
etc.

-- Steve

2005-10-30 01:20:03

by David Weinehall

[permalink] [raw]
Subject: Re: [ketchup] patch to allow for moving of .gitignore in 2.6.14

On Sat, Oct 29, 2005 at 05:06:21PM -0400, Steven Rostedt wrote:
[snip]

> Index: Ketchup-d9503020b3c1/ketchup
> ===================================================================
> --- Ketchup-d9503020b3c1.orig/ketchup 2005-10-28 08:38:50.000000000 -0400
> +++ Ketchup-d9503020b3c1/ketchup 2005-10-28 10:45:43.000000000 -0400
> @@ -482,7 +482,7 @@
> error("Unpacking failed: ", err)
> sys.exit(-1)
>
> - err = os.system("mv linux*/* . ; rmdir linux*")
> + err = os.system("shopt -s dotglob; mv linux*/* . ; rmdir linux*")
> if err:
> error("Unpacking failed: ", err)
> sys.exit(-1)


Uhm, this patch assumes that you're using bash as /bin/sh.
Not everyone does. (I haven't checked the rest of the system calls
in ketchup though, maybe this is a more generic problem?)


Regards: David Weinehall
--
/) David Weinehall <[email protected]> /) Northern lights wander (\
// Maintainer of the v2.0 kernel // Dance across the winter sky //
\) http://www.acc.umu.se/~tao/ (/ Full colour fire (/

2005-10-30 02:10:18

by Steven Rostedt

[permalink] [raw]
Subject: Re: [ketchup] patch to allow for moving of .gitignore in 2.6.14



On Sun, 30 Oct 2005, David Weinehall wrote:

> On Sat, Oct 29, 2005 at 05:06:21PM -0400, Steven Rostedt wrote:
> [snip]
>
> >
> > - err = os.system("mv linux*/* . ; rmdir linux*")
> > + err = os.system("shopt -s dotglob; mv linux*/* . ; rmdir linux*")
> > if err:
> > error("Unpacking failed: ", err)
> > sys.exit(-1)
>
>
> Uhm, this patch assumes that you're using bash as /bin/sh.

Well, aren't you? :-)

> Not everyone does. (I haven't checked the rest of the system calls
> in ketchup though, maybe this is a more generic problem?)

Yeah, the thought did occur to me that this is bash specific, and would
not be "portable". But I did think that this is very Linux specific, and
I'll go with the 99% of most Linux boxes use bash. But you are right to
complain because, like Linux, I like to be compatible with even the most
obscure setups.

When I get some more time, I'll play with some other methods, like what
Matt suggested. But this is the quick fix for those that do use bash as
the system shell, and want it to work for their system. Since currently,
it doesn't work for 2.6.14 from scratch.

-- Steve

2005-10-30 03:48:15

by Steven Rostedt

[permalink] [raw]
Subject: Re: [ketchup] patch to allow for moving of .gitignore in 2.6.14


On Sun, 30 Oct 2005, David Weinehall wrote:
>
> Uhm, this patch assumes that you're using bash as /bin/sh.
> Not everyone does. (I haven't checked the rest of the system calls
> in ketchup though, maybe this is a more generic problem?)

OK, if I work any more on ketchup, I'm going to convert the whole damn
thing into perl! ;-} (and call it "mustard").

Is this patch better? It even tests the version of tar and if it is less
than 1.15 it uses --strip-path (the old name) and if it is 1.15 or greater
it uses --strip-components (the new name). And if it fails the version
test all together, it goes back to the old (broken) method of just moving
the contents.

Is this robust enough for you?

-- Steve

Index: Ketchup-d9503020b3c1/ketchup
===================================================================
--- Ketchup-d9503020b3c1.orig/ketchup 2005-10-29 17:02:26.000000000 -0400
+++ Ketchup-d9503020b3c1/ketchup 2005-10-29 23:41:32.000000000 -0400
@@ -477,16 +477,37 @@
qprint("Unpacking %s" % os.path.basename(file))
if options["dry-run"]: return ver

- err = os.system("tar xjf %s" % file)
- if err:
+ f = os.popen('tar --version', 'r')
+ if not f:
error("Unpacking failed: ", err)
sys.exit(-1)

- err = os.system("mv linux*/* . ; rmdir linux*")
+ strip = ""
+ line = f.readline()
+ while line:
+ m = re.match(r'.*?(\d+)\.(\d+)', line)
+ if m:
+ v1 = int(m.group(1))
+ v2 = int(m.group(2))
+ if v1 > 1 or (v1 == 1 and v2 >= 15):
+ strip = "--strip-components 1 "
+ else:
+ strip = "--strip-path 1 "
+ break
+ line = f.readline()
+ f.close()
+
+ err = os.system("tar %s-xjf %s" % (strip, file))
if err:
error("Unpacking failed: ", err)
sys.exit(-1)

+ if not len(strip):
+ err = os.system("mv linux*/* . ; rmdir linux*")
+ if err:
+ error("Unpacking failed: ", err)
+ sys.exit(-1)
+
return ver

def find_ver(ver):

2005-10-30 06:56:29

by Patrick McFarland

[permalink] [raw]
Subject: Re: [ketchup] patch to allow for moving of .gitignore in 2.6.14

On Saturday 29 October 2005 11:48 pm, Steven Rostedt wrote:
> On Sun, 30 Oct 2005, David Weinehall wrote:
> > Uhm, this patch assumes that you're using bash as /bin/sh.
> > Not everyone does. (I haven't checked the rest of the system calls
> > in ketchup though, maybe this is a more generic problem?)
>
> OK, if I work any more on ketchup, I'm going to convert the whole damn
> thing into perl! ;-} (and call it "mustard").

I hope you relish this problem. ;)

--
Patrick "Diablo-D3" McFarland || [email protected]
"Computer games don't affect kids; I mean if Pac-Man affected us as kids,
we'd all be running around in darkened rooms, munching magic pills and
listening to repetitive electronic music." -- Kristian Wilson, Nintendo,
Inc, 1989


Attachments:
(No filename) (748.00 B)
(No filename) (189.00 B)
Download all attachments

2005-10-30 18:04:29

by Matt Mackall

[permalink] [raw]
Subject: Re: [ketchup] patch to allow for moving of .gitignore in 2.6.14

On Sat, Oct 29, 2005 at 11:48:07PM -0400, Steven Rostedt wrote:
>
> On Sun, 30 Oct 2005, David Weinehall wrote:
> >
> > Uhm, this patch assumes that you're using bash as /bin/sh.
> > Not everyone does. (I haven't checked the rest of the system calls
> > in ketchup though, maybe this is a more generic problem?)
>
> OK, if I work any more on ketchup, I'm going to convert the whole damn
> thing into perl! ;-} (and call it "mustard").
>
> Is this patch better? It even tests the version of tar and if it is less
> than 1.15 it uses --strip-path (the old name) and if it is 1.15 or greater
> it uses --strip-components (the new name). And if it fails the version
> test all together, it goes back to the old (broken) method of just moving
> the contents.
>
> Is this robust enough for you?

Yep, looks good. Applied and pushed.

--
Mathematics is the supreme nostalgia of our time.

2005-10-30 19:58:40

by Matt Mackall

[permalink] [raw]
Subject: Re: [ketchup] patch to alt urls for local trees

On Fri, Oct 28, 2005 at 04:46:30PM -0400, Steven Rostedt wrote:
>
> 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.

This was pretty good, but I decided to take it a step further. Now
each tree spec can contain a list of URLs rather than a single URL and
they'll be tried in order.

--
Mathematics is the supreme nostalgia of our time.