summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRaphael Geissert <geissert@debian.org>2009-12-15 02:12:01 +0000
committerRaphael Geissert <geissert@debian.org>2009-12-15 02:12:01 +0000
commitfdd1c228f4e93478331b57b355e518bd56d66e34 (patch)
treed782695f194ed7b675ec49b458dfd251c8f1f7a9 /scripts
parentd9da4eec744e1283664cebc4088cc51d8956d29d (diff)
find-commit:
- refactor git pull code so that it actually works - preselect only interesting log files with grep before full search (searches are now about 100x faster) git-svn-id: svn+ssh://svn.debian.org/svn/kernel-sec@1646 e094ebfe-e918-0410-adfb-c712417f3574
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/find-commit17
1 files changed, 13 insertions, 4 deletions
diff --git a/scripts/find-commit b/scripts/find-commit
index 551fd993..698e58a1 100755
--- a/scripts/find-commit
+++ b/scripts/find-commit
@@ -19,6 +19,7 @@
import os
import sys
+import urllib
import tempfile
if ( len( sys.argv ) < 2 ):
@@ -56,9 +57,12 @@ os.chdir( gitdir )
fread = open( './.git/refs/heads/master' , 'r' )
local_hash = fread.readline().strip( '\n' )
fread.close()
-pipe = os.popen( 'git ls-remote .' )
-remote_hash = pipe.readline().split()[0]
-pipe.close()
+fread = urllib.urlopen( 'http%s/packed-refs' % giturl[3::] , 'r' )
+split = [ '' , '' ]
+while ( split[1] != 'refs/heads/master' ):
+ split = fread.readline().strip( ' \n' ).split()
+remote_hash = split[0]
+fread.close()
if ( local_hash != remote_hash ):
if ( os.system( 'git pull' ) != 0 ):
sys.exit( 1 )
@@ -100,7 +104,10 @@ for tag in tags:
# search thru the generated files for text of interest
foundtext = False
-for fname in fnames:
+pipe = os.popen( 'grep %s %s*' % ( sys.argv[1] , rootname ) )
+pline = pipe.readline()
+while pline:
+ fname = pline.split()[0].rstrip( ':' )
fread = open( fname , 'r' )
line = fread.readline()
while line:
@@ -116,3 +123,5 @@ for fname in fnames:
foundtext = True
line = fread.readline()
fread.close()
+ pline = pipe.readline()
+pipe.close()

© 2014-2024 Faster IT GmbH | imprint | privacy policy