Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bootlin/elixir
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: sshedi/elixir
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 3 commits
  • 8 files changed
  • 1 contributor

Commits on Jul 10, 2018

  1. Customized version of elixir for my use

    Signed-off-by: Shreenidhi Shedi <[email protected]>
    sshedi committed Jul 10, 2018
    Copy the full SHA
    590dca1 View commit details
  2. Customized version of elixir for my use

    Signed-off-by: Shreenidhi Shedi <[email protected]>
    sshedi committed Jul 10, 2018
    Copy the full SHA
    6753b89 View commit details
  3. Customized version of elixir for my use

    Signed-off-by: Shreenidhi Shedi <[email protected]>
    sshedi committed Jul 10, 2018
    Copy the full SHA
    c058a48 View commit details
Showing with 78 additions and 62 deletions.
  1. +9 −22 http/web.py
  2. +17 −0 misc/001-elixir.conf
  3. +15 −0 misc/create_elixir_data.sh
  4. +5 −0 misc/dependencies.sh
  5. +15 −0 misc/test_webpy.sh
  6. +5 −19 query.py
  7. +12 −5 script.sh
  8. +0 −16 templates/header.html
31 changes: 9 additions & 22 deletions http/web.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
#!/usr/bin/python3

# This file is part of Elixir, a source code cross-referencer.
#
# Copyright (C) 2017 Mikaël Bouillot
# <mikael.bouillot@bootlin.com>
#
# Elixir is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Elixir is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Elixir. If not, see <http://www.gnu.org/licenses/>.

from io import StringIO

realprint = print
@@ -159,18 +141,23 @@ def do_query (*args):
v += '\t<span>'+v1k+'</span>\n'
v += '\t<ul>\n'
b += 1

for v2k in v1v:
v2v = v1v[v2k]
if v2k == v2v[0] and len(v2v) == 1:
if v2k == tag: v += '\t\t<li class="li-link active"><a href="'+v2k+'/'+url+'">'+v2k+'</a></li>\n'
else: v += '\t\t<li class="li-link"><a href="'+v2k+'/'+url+'">'+v2k+'</a></li>\n'
if v2k == tag:
v += '\t\t<li class="li-link active"><a href="'+v2k+'/'+url+'">'+v2k+'</a></li>\n'
else:
v += '\t\t<li class="li-link"><a href="'+v2k+'/'+url+'">'+v2k+'</a></li>\n'
else:
v += '\t\t<li>\n'
v += '\t\t\t<span>'+v2k+'</span>\n'
v += '\t\t\t<ul>\n'
for v3 in v2v:
if v3 == tag: v += '\t\t\t\t<li class="li-link active"><a href="'+v3+'/'+url+'">'+v3+'</a></li>\n'
else: v += '\t\t\t\t<li class="li-link"><a href="'+v3+'/'+url+'">'+v3+'</a></li>\n'
if v3 == tag:
v += '\t\t\t\t<li class="li-link active"><a href="'+v3+'/'+url+'">'+v3+'</a></li>\n'
else:
v += '\t\t\t\t<li class="li-link"><a href="'+v3+'/'+url+'">'+v3+'</a></li>\n'
v += '\t\t\t</ul></li>\n'
v += '\t</ul></li>\n'

17 changes: 17 additions & 0 deletions misc/001-elixir.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Directory /usr/local/elixir/http/>
Options +ExecCGI
AllowOverride None
Require all granted
SetEnv PYTHONIOENCODING utf-8
SetEnv LXR_PROJ_DIR /srv/elixir-data/
</Directory>

AddHandler cgi-script .py

<VirtualHost *:80>
ServerName 127.0.0.1
DocumentRoot /usr/local/elixir/http
RewriteEngine on
RewriteRule "^/$" "/agent/latest/source" [R]
RewriteRule "^/.*/(source|ident|search)" "/web.py" [PT]
</VirtualHost>
15 changes: 15 additions & 0 deletions misc/create_elixir_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

if [ -z "$1" ]; then
printf "\nPlease specify project name\n"
echo "\nUsage: $0 u-boot\n\n"
exit 1
fi

PROJ="$1"

export LXR_REPO_DIR=/srv/elixir-data/"$PROJ"/repo
export LXR_DATA_DIR=/srv/elixir-data/"$PROJ"/data

cd ..
./script.sh list-tags && ./update.py
5 changes: 5 additions & 0 deletions misc/dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

apt update && \
apt -y install python3 python3-jinja2 python3-pygments python3-bsddb3 \
exuberant-ctags perl git apache2
15 changes: 15 additions & 0 deletions misc/test_webpy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

if [ -z "$1" ]; then
printf "\nPlease specify project name\n"
echo "\nUsage: $0 u-boot\n\n"
exit 1
fi

PROJ="$1"

export PYTHONIOENCODING=utf-8
export LXR_PROJ_DIR=/srv/elixir-data
export SCRIPT_URL=/"$PROJ"/latest/source

../http/web.py
24 changes: 5 additions & 19 deletions query.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
#!/usr/bin/env python3

# This file is part of Elixir, a source code cross-referencer.
#
# Copyright (C) 2017 Mikaël Bouillot
# <mikael.bouillot@bootlin.com>
#
# Elixir is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Elixir is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Elixir. If not, see <http://www.gnu.org/licenses/>.

from lib import script, scriptLines
import lib
import data
@@ -41,7 +23,11 @@ def echo (arg):

if cmd == 'versions':
for p in scriptLines ('list-tags', '-h'):
if db.vers.exists (p.split(b' ')[2]):
res = p.split(b' ')
idx = len(res)
if len(res) <= 0:
idx = 1
if db.vers.exists (res[idx - 1]):
echo (p + b'\n')

elif cmd == 'latest':
17 changes: 12 additions & 5 deletions script.sh
Original file line number Diff line number Diff line change
@@ -49,14 +49,21 @@ list_tags()

list_tags_h()
{
echo "$tags" |
tac |
sed -r 's/^(v[0-9])\.([0-9]*)(.*)$/\1 \1.\2 \1.\2\3/'
if echo "$SCRIPT_URL" | grep -q "agent"; then
echo "$tags" | tac | sed -r 's/^([0-9])\.([0-9]*)(.*)$/\1 \1.\2 \1.\2\3/'
else
echo "$tags" | tac | sed -r 's/^(v[0-9])\.([0-9]*)(.*)$/\1 \1.\2 \1.\2\3/'
fi
}

get_latest()
{
git tag | version_dir | grep -v '\-rc' | sort -V | tail -n 1
if echo "$SCRIPT_URL" | grep -q "agent"; then
#git tag | version_dir | grep -v '[A-Za-z]' | sort -V | tail -n 1
git tag | version_dir | grep -Eiv 'raptor|vos|vrx|agent|sdk|adk' | sort -V | tail -n 1
else
git tag | version_dir | grep -v '\-rc' | sort -V | tail -n 1
fi
}

get_type()
@@ -93,7 +100,7 @@ tokenize_file()
v=`echo $opt1 | version_rev`
ref="$v:`denormalize $opt2`"
fi

git cat-file blob $ref 2>/dev/null |
tr '\n' '\1' |
perl -pe 's%((/\*.*?\*/|//.*?\001|"(\\.|.)*?"|# *include *<.*?>|\W)+)(\w+)?%\1\n\4\n%g' |
16 changes: 0 additions & 16 deletions templates/header.html
Original file line number Diff line number Diff line change
@@ -6,20 +6,4 @@ <h1>
</object>
</h1>
<h2>Elixir Cross Referencer</h2>
<nav>
<ul class="nav-links">
<li><a href="https://bootlin.com/">Home</a></li>
<li><a href="https://bootlin.com/engineering/">Engineering</a></li>
<li><a href="https://bootlin.com/training/">Training</a></li>
<li><a href="https://bootlin.com/docs/">Docs</a></li>
<li><a href="https://bootlin.com/community/">Community</a></li>
<li><a href="https://bootlin.com/company/">Company</a></li>
</ul>
<ul class="social-icons">
<li><a target="_blank" class="icon-twitter" href="http://twitter.com/bootlincom">twitter</a></li>
<li><a target="_blank" class="icon-googleplus" href="https://plus.google.com/+FreeElectronsDevelopers">google+</a></li>
<li><a target="_blank" class="icon-linkedin" href="https://www.linkedin.com/groups/4501089">linkedin</a></li>
<li><a target="_blank" class="icon-github" href="https://github.com/free-electrons">github</a></li>
</ul>
</nav>
</header>