parent
6c475afb98
commit
7db38c24fd
4 changed files with 25 additions and 11 deletions
|
|
@ -18,7 +18,7 @@
|
|||
<div id="logo">
|
||||
<h1>Linux Cross Reference</h1>
|
||||
<h2><a href="http://free-electrons.com">Free Electrons: Embedded Linux Experts</a></h2>
|
||||
<p> • <a href="/linux/v4.9/source">Linux</a> • <a href="/u-boot/v2016.11/source">U-Boot</a> • <a href="/busybox/1.26.1/source">Busybox</a> • </p>
|
||||
<p> • <a href="/linux/latest/source">Linux</a> • <a href="/u-boot/latest/source">U-Boot</a> • <a href="/busybox/latest/source">Busybox</a> • </p>
|
||||
<p>
|
||||
• <a href="$vvar/source">source navigation</a> • <a href="$vvar/ident">identifier search</a> • <a href="$vvar/search">freetext search</a> • <a href="http://lxr.free-electrons.com" style="color:#00FF00">Back to LXR</a> •
|
||||
</p>
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
</div>
|
||||
|
||||
<div id="topbar">
|
||||
<p>Version: $vvar $versions
|
||||
<p>Version: $vvar2 $versions
|
||||
</div>
|
||||
|
||||
<h1>$banner</h1>
|
||||
|
|
|
|||
24
http/web.py
24
http/web.py
|
|
@ -64,7 +64,7 @@ if m:
|
|||
if not (project and search ('^[A-Za-z0-9-]+$', project)) \
|
||||
or not (version and search ('^[A-Za-z0-9._-]+$', version)):
|
||||
status = 302
|
||||
location = '/linux/v4.10/'+cmd+arg
|
||||
location = '/linux/latest/'+cmd+arg
|
||||
cmd = ''
|
||||
if cmd == 'source':
|
||||
path = arg
|
||||
|
|
@ -107,14 +107,20 @@ elif status == 404:
|
|||
realprint ('Status: 404 Not Found\n')
|
||||
exit()
|
||||
|
||||
head = open ('template-head').read()
|
||||
head = sub ('\$baseurl', 'http://' + os.environ['HTTP_HOST'] + '/' + project + '/', head)
|
||||
head = sub ('\$vvar', version, head)
|
||||
|
||||
basedir = os.environ['LXR_PROJ_DIR']
|
||||
os.environ['LXR_DATA_DIR'] = basedir + '/' + project + '/data';
|
||||
os.environ['LXR_REPO_DIR'] = basedir + '/' + project + '/repo';
|
||||
|
||||
if version == 'latest':
|
||||
version2 = shell_exec ('cd ..; ./query.py latest')[0]
|
||||
else:
|
||||
version2 = version
|
||||
|
||||
head = open ('template-head').read()
|
||||
head = sub ('\$baseurl', 'http://' + os.environ['HTTP_HOST'] + '/' + project + '/', head)
|
||||
head = sub ('\$vvar2', version2, head)
|
||||
head = sub ('\$vvar', version, head)
|
||||
|
||||
lines = shell_exec ('cd ..; ./query.py versions')
|
||||
va = OrderedDict()
|
||||
for l in lines:
|
||||
|
|
@ -164,13 +170,13 @@ if mode == 'source':
|
|||
|
||||
lines = ['null - -']
|
||||
|
||||
type = shell_exec ('cd ..; ./query.py type '+version+' \''+path+'\'')
|
||||
type = shell_exec ('cd ..; ./query.py type '+version2+' \''+path+'\'')
|
||||
if len (type) == 1:
|
||||
type = type[0]
|
||||
if type == 'tree':
|
||||
lines += shell_exec ('cd ..; ./query.py dir '+version+' \''+path+'\'')
|
||||
lines += shell_exec ('cd ..; ./query.py dir '+version2+' \''+path+'\'')
|
||||
elif type == 'blob':
|
||||
lines += shell_exec ('cd ..; ./query.py file '+version+' \''+path+'\'')
|
||||
lines += shell_exec ('cd ..; ./query.py file '+version2+' \''+path+'\'')
|
||||
else:
|
||||
print ('<br><b>This file does not exist.</b>')
|
||||
status = 404
|
||||
|
|
@ -247,7 +253,7 @@ elif mode == 'ident':
|
|||
head = sub ('\$title', project+' identifier search "'+ident+'" - Elixir Cross Referencer - Free Electrons', head)
|
||||
print (head, end='')
|
||||
|
||||
lines = shell_exec ('cd .. ; ./query.py ident '+version+" '"+ident+"'")
|
||||
lines = shell_exec ('cd .. ; ./query.py ident '+version2+" '"+ident+"'")
|
||||
lines = iter (lines)
|
||||
|
||||
m = search ('Defined in (\d*) file', next (lines))
|
||||
|
|
|
|||
4
query.py
4
query.py
|
|
@ -39,6 +39,10 @@ if cmd == 'versions':
|
|||
if db.vers.exists (p.split(b' ')[2]):
|
||||
echo (p + b'\n')
|
||||
|
||||
elif cmd == 'latest':
|
||||
p = script ('get-latest')
|
||||
echo (p)
|
||||
|
||||
elif cmd == 'type':
|
||||
version = argv[2]
|
||||
path = argv[3]
|
||||
|
|
|
|||
|
|
@ -97,6 +97,10 @@ case $cmd in
|
|||
fi
|
||||
;;
|
||||
|
||||
get-latest)
|
||||
git tag | version_dir | grep -v '\-rc' | sort -V | tail -n 1
|
||||
;;
|
||||
|
||||
get-type)
|
||||
v=`echo $1 | version_rev`
|
||||
git cat-file -t "$v:`denormalize $2`" 2>/dev/null
|
||||
|
|
|
|||
Loading…
Reference in a new issue