如何从Linux交叉引用库(由LXR引擎生成)下载源代码?

时间:2020-12-31 21:05:39

I wanted to download Linux kernel module source code from http://lxr.free-electrons.com/source/net/bluetooth/. Is there any tool like SVN to download the source code generated by LXR engine? Thanks in advance!

我想从http://lxr.free-electrons.com/source/net/bluetooth/下载Linux内核模块源代码。有没有像SVN这样的工具可以下载LXR引擎生成的源代码?提前谢谢!

5 个解决方案

#1


2  

If you're still looking for an answer, here is a procedure based on a low documented feature of LXR.

如果您还在寻找答案,这里有一个基于LXR的低文档化特性的过程。

  1. Display the file you are interested in
  2. 显示您感兴趣的文件
  3. Modify the URL in the browser address bar, adding at the end ?_raw=1 and go there (i.e. press return key)
  4. 修改浏览器地址栏中的URL,在末尾添加?_raw=1,然后到那里(即按return键)
  5. The file is then displayed "as is", without any decoration (it is sent as text/plain)
  6. 然后文件显示为“原样”,没有任何修饰(它以文本/普通格式发送)
  7. You can now save the file from browser menu command File->Save as
  8. 您现在可以从浏览器菜单命令文件->保存为

NOTES:

注:

  1. The ?_raw=1 argument can be used to have HTML files interpreted by your browser, i.e. displayed as HTML because they will be sent as text/html.
  2. 可以使用?_raw=1参数让浏览器解释HTML文件,例如显示为HTML,因为它们将作为文本/ HTML发送。
  3. The feature has been present in LXR for ages, though in versions older than 0.10 the argument is spelled ?raw=1 (without underscore).
  4. 这个特性在LXR中已经存在很长一段时间了,但是在0.10以上的版本中,参数被写成?raw=1(没有下划线)。
  5. I checked that ?raw=1 works with free-electrons though they use 0.3.1 which was released in 2003!
  6. 我检查过了吗?raw=1对*电子有效,尽管他们使用的是2003年发布的0.3.1。

#2


0  

The documentation on lxr states that there is a git repo. http://lxr.linux.no/ I have never tried it, but it may be what you are looking for

lxr的文档说明有一个git repo。http://lxr.linux。没有/我从来没有试过,但它可能是你想要的。

#3


0  

Not exactly an answer, but I was looking for a related thing - the possibility to download individual C files from LXR as plain text. If it was possible to download files as text, in principle you could write some sort of a parser/automatic downloader for a whole directory.

这不是一个确切的答案,但我正在寻找一个相关的东西——从LXR下载单个C文件作为纯文本的可能性。如果可以以文本形式下载文件,原则上可以为整个目录编写某种解析器/自动下载器。

The documentation for the LXR engine seems to be here:

LXR引擎的文档似乎在这里:

... and as far as I could see from the 1.0 PDF manual (note that lxr.free-electrons.com seems to run on version 0.3.1, though), there is no mention of plain-text source files being exported (in addition) to the HTML.

…从1.0 PDF手册(请注意,lxr.free-electrons.com似乎运行在0.3.1版本上)中我可以看到,没有提到将纯文本源文件(另外)导出到HTML的情况。

So, very likely, as the plain-text source files seem not to be available in an LXR export, there will be no tool that will be able to download. (Btw, I too wish there was a tool like this, otherwise the only option is to clone the entire Linux source tree via git).

因此,很有可能,由于纯文本源文件似乎在LXR导出中不可用,因此将没有工具能够下载。(顺便说一句,我也希望有这样的工具,否则唯一的选择就是通过git克隆整个Linux源代码树)。

 

 

Note, however, that there is also an experimental version of LXR from lxr.linux.no ; that one generates HTML that requires JavaScript, and it will show a "download" button in its interface; then one can download the plain-text source file. As lxr.linux.no is down for me for the moment, here's a link to an annotated HTML page to another site, that seems to use the same engine (there is no note ATM for the LXR engine numeric version):

但是,请注意,LXR也有一个来自LXR .linux的实验性版本。没有;它生成需要JavaScript的HTML,并在界面中显示“下载”按钮;然后可以下载纯文本源文件。lxr.linux。不,我暂时不知道,这里有一个链接指向另一个站点的带注释的HTML页面,它似乎使用了相同的引擎(LXR引擎的数字版本没有note ATM):

... and this is how the link looks like to obtain plain-text version:

…这就是链接获取纯文本版本的方式:

Note that this is a different URL format than what lxr.free-electrons.com would use:

请注意,这是一个不同于lxr.free-的URL格式:

... and there is a note on the start page ( http://lxr.missinglinkelectronics.com/ ) once you enable JavaScript, which states that:

…在开始页面(http://lxr.missinglinkelectronics.com/)上有一个注意事项,当你启用JavaScript时,它表明:

lxr.missinglinkelectronics.com is currently running an experimental fork of the LXR software provided by lxr.linux.no.

目前正在运行LXR .linux.no的LXR软件的实验叉。

... or, in other words: the link format for downloading plain-text source files from lxr.linux.no, will not work for the (current) lxr.free-electrons.com installation.

…或者,换句话说:从lxr.linux下载纯文本源文件的链接格式。不,不适用于(当前)lxr.free-electrons.com的安装。

#4


0  

Here you can browse the references and also can download the source file https://code-grep.com/view/project/54b083273b2082684a000008/linux-3.19-rc2

在这里你可以浏览参考资料,也可以下载源文件https://code grep.com/view/project/54b083273b2082684a000008/linux-3.19-rc2。

#5


0  

On free-electrons.com, it works by adding the argument "raw=1" in the URL. For example, this URL...

在free-electrons.com上,它通过在URL中添加参数“raw=1”来工作。例如,这个URL……

http://lxr.free-electrons.com/source/drivers/misc/lis3lv02d/lis3lv02d.c?v=3.8

http://lxr.free-electrons.com/source/drivers/misc/lis3lv02d/lis3lv02d.c?v=3.8

... will become this :

…将成为:

http://lxr.free-electrons.com/source/drivers/misc/lis3lv02d/lis3lv02d.c?v=3.8&raw=1

http://lxr.free-electrons.com/source/drivers/misc/lis3lv02d/lis3lv02d.c?v=3.8&raw=1

The resulting page can then be saved using the "file saving" feature of your browser. On Linux and Windows, this is usually mapped to the ctrl+s keyboard shortcut.

然后可以使用浏览器的“文件保存”特性来保存结果页面。在Linux和Windows上,这通常被映射到ctrl+s键盘快捷键。

#1


2  

If you're still looking for an answer, here is a procedure based on a low documented feature of LXR.

如果您还在寻找答案,这里有一个基于LXR的低文档化特性的过程。

  1. Display the file you are interested in
  2. 显示您感兴趣的文件
  3. Modify the URL in the browser address bar, adding at the end ?_raw=1 and go there (i.e. press return key)
  4. 修改浏览器地址栏中的URL,在末尾添加?_raw=1,然后到那里(即按return键)
  5. The file is then displayed "as is", without any decoration (it is sent as text/plain)
  6. 然后文件显示为“原样”,没有任何修饰(它以文本/普通格式发送)
  7. You can now save the file from browser menu command File->Save as
  8. 您现在可以从浏览器菜单命令文件->保存为

NOTES:

注:

  1. The ?_raw=1 argument can be used to have HTML files interpreted by your browser, i.e. displayed as HTML because they will be sent as text/html.
  2. 可以使用?_raw=1参数让浏览器解释HTML文件,例如显示为HTML,因为它们将作为文本/ HTML发送。
  3. The feature has been present in LXR for ages, though in versions older than 0.10 the argument is spelled ?raw=1 (without underscore).
  4. 这个特性在LXR中已经存在很长一段时间了,但是在0.10以上的版本中,参数被写成?raw=1(没有下划线)。
  5. I checked that ?raw=1 works with free-electrons though they use 0.3.1 which was released in 2003!
  6. 我检查过了吗?raw=1对*电子有效,尽管他们使用的是2003年发布的0.3.1。

#2


0  

The documentation on lxr states that there is a git repo. http://lxr.linux.no/ I have never tried it, but it may be what you are looking for

lxr的文档说明有一个git repo。http://lxr.linux。没有/我从来没有试过,但它可能是你想要的。

#3


0  

Not exactly an answer, but I was looking for a related thing - the possibility to download individual C files from LXR as plain text. If it was possible to download files as text, in principle you could write some sort of a parser/automatic downloader for a whole directory.

这不是一个确切的答案,但我正在寻找一个相关的东西——从LXR下载单个C文件作为纯文本的可能性。如果可以以文本形式下载文件,原则上可以为整个目录编写某种解析器/自动下载器。

The documentation for the LXR engine seems to be here:

LXR引擎的文档似乎在这里:

... and as far as I could see from the 1.0 PDF manual (note that lxr.free-electrons.com seems to run on version 0.3.1, though), there is no mention of plain-text source files being exported (in addition) to the HTML.

…从1.0 PDF手册(请注意,lxr.free-electrons.com似乎运行在0.3.1版本上)中我可以看到,没有提到将纯文本源文件(另外)导出到HTML的情况。

So, very likely, as the plain-text source files seem not to be available in an LXR export, there will be no tool that will be able to download. (Btw, I too wish there was a tool like this, otherwise the only option is to clone the entire Linux source tree via git).

因此,很有可能,由于纯文本源文件似乎在LXR导出中不可用,因此将没有工具能够下载。(顺便说一句,我也希望有这样的工具,否则唯一的选择就是通过git克隆整个Linux源代码树)。

 

 

Note, however, that there is also an experimental version of LXR from lxr.linux.no ; that one generates HTML that requires JavaScript, and it will show a "download" button in its interface; then one can download the plain-text source file. As lxr.linux.no is down for me for the moment, here's a link to an annotated HTML page to another site, that seems to use the same engine (there is no note ATM for the LXR engine numeric version):

但是,请注意,LXR也有一个来自LXR .linux的实验性版本。没有;它生成需要JavaScript的HTML,并在界面中显示“下载”按钮;然后可以下载纯文本源文件。lxr.linux。不,我暂时不知道,这里有一个链接指向另一个站点的带注释的HTML页面,它似乎使用了相同的引擎(LXR引擎的数字版本没有note ATM):

... and this is how the link looks like to obtain plain-text version:

…这就是链接获取纯文本版本的方式:

Note that this is a different URL format than what lxr.free-electrons.com would use:

请注意,这是一个不同于lxr.free-的URL格式:

... and there is a note on the start page ( http://lxr.missinglinkelectronics.com/ ) once you enable JavaScript, which states that:

…在开始页面(http://lxr.missinglinkelectronics.com/)上有一个注意事项,当你启用JavaScript时,它表明:

lxr.missinglinkelectronics.com is currently running an experimental fork of the LXR software provided by lxr.linux.no.

目前正在运行LXR .linux.no的LXR软件的实验叉。

... or, in other words: the link format for downloading plain-text source files from lxr.linux.no, will not work for the (current) lxr.free-electrons.com installation.

…或者,换句话说:从lxr.linux下载纯文本源文件的链接格式。不,不适用于(当前)lxr.free-electrons.com的安装。

#4


0  

Here you can browse the references and also can download the source file https://code-grep.com/view/project/54b083273b2082684a000008/linux-3.19-rc2

在这里你可以浏览参考资料,也可以下载源文件https://code grep.com/view/project/54b083273b2082684a000008/linux-3.19-rc2。

#5


0  

On free-electrons.com, it works by adding the argument "raw=1" in the URL. For example, this URL...

在free-electrons.com上,它通过在URL中添加参数“raw=1”来工作。例如,这个URL……

http://lxr.free-electrons.com/source/drivers/misc/lis3lv02d/lis3lv02d.c?v=3.8

http://lxr.free-electrons.com/source/drivers/misc/lis3lv02d/lis3lv02d.c?v=3.8

... will become this :

…将成为:

http://lxr.free-electrons.com/source/drivers/misc/lis3lv02d/lis3lv02d.c?v=3.8&raw=1

http://lxr.free-electrons.com/source/drivers/misc/lis3lv02d/lis3lv02d.c?v=3.8&raw=1

The resulting page can then be saved using the "file saving" feature of your browser. On Linux and Windows, this is usually mapped to the ctrl+s keyboard shortcut.

然后可以使用浏览器的“文件保存”特性来保存结果页面。在Linux和Windows上,这通常被映射到ctrl+s键盘快捷键。