Commit graph

313 commits

Author SHA1 Message Date
Chris White
f112ab0826 Regularize whitespace; add editorconfig
- Change the few files that use leading tabs into leading spaces.
  This way they match the other files in the repo.
- Add an EditorConfig file so that supported editors will automatically
  use spaces instead of tabs.
- (Extra) Add some common editor backup-file extensions to .gitignore.
2020-03-21 08:58:43 -04:00
Michael Opdenacker
1b6f7d1717
Merge pull request #94 from carmeli-tamir/add_travis_ci
Add travis ci
2020-03-12 10:20:00 +01:00
Michael Opdenacker
f464bbfd65
Merge pull request #93 from cxw42/doc-comments
Refactor common test code into class
2020-03-11 19:55:19 +01:00
Carmeli Tamir
116bae3148 Check test success 2020-03-10 14:58:51 -04:00
Christopher White
1db4fb8199 Refactor common test code into class
- Create new class t/TestEnvironment.pm.  A TestEnvironment instance
  owns a temporary Git repo and a temporary Elixir database directory.
- Update t/100-basic.t to use TestEnvironment.
- Add constant MUST_SUCCEED so `run_produces_ok()` calls are more
  self-documenting
2020-03-09 16:29:57 -04:00
Michael Opdenacker
5f063ebdf9
Merge pull request #92 from carmeli-tamir/master
Return empty lists when no identifier found
2020-03-09 10:37:38 +01:00
Carmeli Tamir
a1e8117afd Check test failure 2020-03-07 13:24:16 -05:00
Carmeli Tamir
0a96ceef9d Return empty lists when no identifier found 2020-03-07 03:38:19 -05:00
Michael Opdenacker
e9d970ced1 Fix handling of malformed URLs
- Otherwise, we end up with a wrong path variable
  that causes an internal server error

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-03-06 12:04:39 +01:00
Michael Opdenacker
c4f3a1de5b
Merge pull request #88 from cxw42/basic-test
Add basic automated-test suite
2020-03-02 15:38:45 +01:00
Michael Opdenacker
bada530879
Merge pull request #89 from pcworld/title
Prepend filename or identifier in HTML <title>
2020-03-02 15:31:34 +01:00
pcworld
97ef91036a Prepend filename or identifier in HTML <title>
Display filenames and identifiers at the *beginning* of the <title>.
This way, they are better visible in modern browsers' tabs as they
usually cut off the title for space reasons.

This also fixes handling of the root path.
Examples of changed titles:
"Linux source code: (v5.5.6) - Bootlin" becomes "Linux source code (v5.5.6) - Bootlin"
"Linux source code: arch (v5.5.6) - Bootlin" becomes "arch - Linux source code (v5.5.6) - Bootlin"
"Linux source code: arch/um/Makefile (v5.5.6) - Bootlin" becomes "Makefile - arch/um/Makefile - Linux source code (v5.5.6) - Bootlin"
2020-03-01 03:58:55 +01:00
Christopher White
fa7243638d Add automated test of basic functions
- Added test helpers in t/TestHelpers.pm
- Added basic test of update.py and query.py in t/100-basic.t
- Updated README:
    - Added automated-testing section
    - Formatted identifiers (i.e., added backticks)
2020-02-21 15:36:51 -05:00
Christopher White
b22a562b5b Added files copied from Linux v5.4
These files all carry SPDX GPL2+ indicators.  Based on the information
available to me, I have a good-faith belief that they can be combined
into this AGPLv3 project and licensed AGPLv3.

This commit only touches t/tree.  Therefore, if the test suite later
needs to be changed, it will be sufficient to revert this commit.

The files used are those involved in the x64 compilation of
drivers/i2c/i2c-core-base.c, filtered to remove any that aren't
tagged GPL2+.

Note that t/tree itself is not a Git repo or submodule.  It is a
collection of files that test scripts can use to populate a Git repo.
2020-02-21 15:31:57 -05:00
Michael Opdenacker
3de325ca86 Improve and update website banner
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-02-04 10:51:24 +01:00
Michael Opdenacker
7eae101760 README.md: add sample configuration for lighthttpd
- Thanks to 'jmaselbas'
  See bbd8cc3bf2

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-01-30 14:22:32 +01:00
Michael Opdenacker
bbd8cc3bf2
Merge pull request #86 from jmaselbas/lighthttpd
Support for lighthttpd CGI
2020-01-29 14:34:23 +01:00
Michael Opdenacker
3037fc624e Improve details about fetching the Linux "stable" tree
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-01-29 11:18:07 +01:00
Michael Opdenacker
09806627eb
Merge pull request #85 from cxw42/readme-update
README: include URL for Linux sublevel tags
2020-01-29 10:49:42 +01:00
Michael Opdenacker
cb495269eb Remove blacklisted structure names
- Those were important structures in Linux
  They deserve to be indexed.

- This will require re-indexing, so this will take a bit
  of time to be fixed in the database

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2020-01-29 08:11:27 +01:00
Jules Maselbas
4b9e9e9e27 Support for lighthttpd CGI
Sample config for lighthttpd rules:

server.document-root = server_root + "/elixir/http"
url.redirect = ( "^/$" => "/linux/latest/source" )
url.rewrite  = ( "^/.*/(source|ident|search)" =>  "/web.py/$1")
setenv.add-environment = ( "PYTHONIOENCODING" => "utf-8",
	"LXR_PROJ_DIR" => "/path/to/elixir-data" )
2020-01-17 15:35:44 +01:00
Christopher White
777362c787 README: include URL for Linux sublevel tags
The GitHub repo doesn't have tags for sublevel (X.Y.Z) releases,
unlike the master Bootlin Elixir site.  Add the master repo that does
have the sublevel tags to the README.
2020-01-03 12:51:27 -05:00
Michael Opdenacker
626ac46dc8
Merge pull request #84 from carmeli-tamir/fix_query_cmd
Implemented query cmd commands for ident and file
2020-01-03 11:04:03 +01:00
Carmeli Tamir
e969b88e8b Implemented query cmd commands for ident and file 2019-12-30 15:00:44 -05:00
Michael Opdenacker
de38f2625b Document that the command line interface is currently broken
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-20 10:07:08 +01:00
Michael Opdenacker
a66996d398 http/web.py: improve code readability and fix issue
- Fix issue introduced by the previous commit
  The 'project' variable could be tested even in the case
  it wasn't defined (case of an invalid URL)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-18 16:11:53 +01:00
Michael Opdenacker
952329f32b Fix http error handling
- Return "400" status when the project doesn't have a database or repo
- In case the DB is not found, properly print the corresponding
  file name in the logs

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-18 10:13:15 +01:00
Michael Opdenacker
f4129147ad Blacklist "else" and "endif"
- This fixes https://github.com/bootlin/elixir/issues/76

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-17 15:45:42 +01:00
Michael Opdenacker
c1af301390 Fix variable name in previous commit
- Most probably a typo

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-17 10:39:39 +01:00
Michael Opdenacker
fbc7c34e01
Merge pull request #81 from carmeli-tamir/stop_chdir_when_calling_query
Fixed path dependency in lib.py
2019-12-17 10:34:31 +01:00
Carmeli Tamir
6fcfc0ca79 Fixed path dependency in lib.py 2019-12-15 15:15:09 -05:00
Michael Opdenacker
80c0b4ab6d Ubuntu font: move to a separate directory
- To include the font's copyright and license files
  as required by the license

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-10 06:26:55 +01:00
Michael Opdenacker
17d1fb106d
Merge pull request #80 from bootlin/local-fonts
use local ubuntu fonts instead of google include
2019-12-10 06:17:09 +01:00
Vince Hillier
b51148465c use local ubuntu fonts instead of google include 2019-12-09 10:05:11 -05:00
Michael Opdenacker
9a01c2c97a Filters: rename variable for compactness
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-07 07:06:09 +01:00
Michael Opdenacker
707d9c34eb Fixes for Makefile directory includes
- Support "subdir-y" statements too
- Fix names in orginal directory includes
  (can have '-' in directory names)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-06 20:11:39 +01:00
Michael Opdenacker
cb1db794d8 Add hyperlinks to DT Makefiles
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-06 19:34:00 +01:00
Michael Opdenacker
2afa777b10 Fix issue with Makefile .o filter
- Didn't properly support files with "-"
  in the filename

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-06 13:55:58 +01:00
Michael Opdenacker
abe5fa7e25 Add support for Makefile file and directory links
- Supporting hyperlinks for things like:
  obj-$(VALUE) += file.o
  obj-$(VALUE) += dir/

- For use in the Makefiles of Linux, Barebox and U-Boot

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-06 08:58:39 +01:00
Michael Opdenacker
db3b2c33c3 cpp path includes: exclude paths with asm/
- Because there are usually multiple possibilities
- Linux kernel example, the kernel makefile seems to include (-I):
  arch/<arch>/include/
  in addition to
  include/

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-05 15:48:38 +01:00
Michael Opdenacker
981555f746 Add more filters
- In particular to support 'include <path>' statements
- Add some exceptions to the above filters, to exclude
  includes that could go outside of the project

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-04 08:56:30 +01:00
Michael Opdenacker
6ffa8d5131 Add Config.in include filter
- Used by the uclibc-ng project

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-03 21:41:01 +01:00
Michael Opdenacker
8f758e84a5 filters for coreboot and qemu
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-02 20:22:48 +01:00
Michael Opdenacker
b0f3131bf0 web.py: add back missing first line
- There was a +1 offset in shown file contents
- This was caused by a bad interpretation of the
  code that was replaced by a previous commit

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-02 15:07:54 +01:00
Michael Opdenacker
8d7b8cb9da web.py: implement per-project filters
- In an efficient way: each project defines the filters
  it uses, instead of selecting filters from a long list
  of filters that takes time to load.

- See filters/linux.py for example

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-02 14:57:28 +01:00
Michael Opdenacker
db8a4d81f3 http/web.py: move filters in a separate file
- For cleaner separation of code

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-01 09:56:33 +01:00
Michael Opdenacker
0a23eecf0a http/web.py: fix handling of invalid requests
- Manage case that wasn't handled previously
- Return error 400 instead of 404

This fixes https://github.com/bootlin/elixir/issues/77

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-01 08:08:48 +01:00
Michael Opdenacker
51a6dff682 Python parentheses coding style fixes
- According to https://www.python.org/dev/peps/pep-0008/

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-12-01 07:01:26 +01:00
Michael Opdenacker
fee6c0b5ea web.py: simplify code and improve performance
Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-11-30 07:27:26 +01:00
Michael Opdenacker
340ae68124 web.py: implement actual error logging
- cgitb.enable() was not enough to get error message details

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2019-11-30 06:39:45 +01:00