mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-24 02:20:09 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
6b1c8510fe
@ -1,16 +1,16 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11023-1.html)
|
||||
[#]: subject: (VSCodium: 100% Open Source Version of Microsoft VS Code)
|
||||
[#]: via: (https://itsfoss.com/vscodium/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
VSCodium:Microsoft VS Code 的 100% 开源版本
|
||||
VSCodium:100% 开源的 VS Code
|
||||
======
|
||||
|
||||
_ **简介:VSCodium 是微软流行的 Visual Studio Code 编辑器的一个分支。它与 VS Code 完全相同,唯一不同的是,VSCodium 不跟踪你的使用数据。** _
|
||||
> VSCodium 是微软流行的 Visual Studio Code 编辑器的一个分支。它与 VS Code 完全相同,唯一不同的是,VSCodium 不跟踪你的使用数据。
|
||||
|
||||
微软的 [Visual Studio Code][1] 是一个出色的编辑器,不仅对于 Web 开发人员,也适合其他程序员。由于它的功能,它被认为是最好的开源代码编辑器之一。
|
||||
|
||||
@ -18,19 +18,19 @@ _ **简介:VSCodium 是微软流行的 Visual Studio Code 编辑器的一个
|
||||
|
||||
但它存在一个问题,对于普通用户而言可能不是问题,但对于纯粹开源主义者而言是重要的。
|
||||
|
||||
Microsoft 提供的即用二进制文件不是开源的。
|
||||
Microsoft 说提供的二进制文件是不开源的。
|
||||
|
||||
由困惑么?让我解释下。
|
||||
感到困惑么?让我解释下。
|
||||
|
||||
VS Code 的源码是在 MIT 许可下开源的。你可以在 [GitHub][3] 上访问它。但是,[Microsoft 创建的安装包含专有的跟踪程序][4]。
|
||||
|
||||
此跟踪基本上用来收集使用数据并将其发送给 Microsoft 以“帮助改进其产品和服务”。如今,远程报告在软件产品中很常见。即使 [Ubuntu 也这样做,但它透明度更高][5]。
|
||||
|
||||
你可以[在 VS Code 中禁用远程报告][6]但是你能完全信任微软吗?如果答案是否定的,那你有什么选择?
|
||||
你可以[在 VS Code 中禁用远程报告][6],但是你能完全信任微软吗?如果答案是否定的,那你有什么选择?
|
||||
|
||||
你可以从源代码构建它,从而保持所有开源。但是[从源代码安装][7]并不总是如今最好的选择,因为我们习惯于使用二进制文件。
|
||||
你可以从源代码构建它,从而保持全都是开源的。但是如今[从源代码安装][7]并不总是最好的选择,因为我们习惯于使用二进制文件。
|
||||
|
||||
另一种选择是使用 VSCodium!
|
||||
另一种选择是使用 VSCodium !
|
||||
|
||||
### VSCodium:100% 开源形式的 Visual Studio Code
|
||||
|
||||
@ -38,7 +38,7 @@ VS Code 的源码是在 MIT 许可下开源的。你可以在 [GitHub][3] 上访
|
||||
|
||||
[VSCodium][9] 是微软 Visual Studio Code 的一个分支。该项目的唯一目的是为你提供现成的二进制文件,而没有 Microsoft 的远程收集代码。
|
||||
|
||||
这解决了你想在没有 Microsoft 的专有代码的情况下使用 VS Code 但你不习惯从源代码构建它的问题,
|
||||
这解决了你想在去掉 Microsoft 的专有代码的情况下使用 VS Code ,而你又不习惯从源代码构建它的问题。
|
||||
|
||||
由于 [VSCodium 是 VS Code 的一个分支][11],它的外观和功能与 VS Code 完全相同。
|
||||
|
||||
@ -80,7 +80,7 @@ sudo apt update && sudo apt install codium
|
||||
|
||||
你可以在它的页面上找到[其他发行版的安装说明][15]。你还应该阅读[有关从 VS Code 迁移到 VSCodium 的说明][16]。
|
||||
|
||||
**你如何看待 VSCodium?**
|
||||
### 你如何看待 VSCodium?
|
||||
|
||||
就个人而言,我喜欢 VSCodium 的概念。说的老套一点,它的初心是好的。我认为,致力于开源的 Linux 发行版甚至可能开始将其包含在官方仓库中。
|
||||
|
||||
@ -95,7 +95,7 @@ via: https://itsfoss.com/vscodium/
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11022-1.html)
|
||||
[#]: subject: (Personal assistant with Mycroft and Fedora)
|
||||
[#]: via: (https://fedoramagazine.org/personal-assistant-with-mycroft-and-fedora/)
|
||||
[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/)
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
![][1]
|
||||
|
||||
还在找开源的私人助理么?[Mycroft][2] 让你运行开源服务,从而更好地控制你的数据。
|
||||
> 想要找个开源的私人助理么?[Mycroft][2] 可以让你运行一个开源的服务,从而更好地控制你的数据。
|
||||
|
||||
### 在 Fedora 上安装 Mycroft
|
||||
|
||||
@ -29,9 +29,9 @@ $ cd mycroft-core
|
||||
$ ./dev_setup.sh
|
||||
```
|
||||
|
||||
安装脚本会提示用户帮助他完成安装过程。建议运行稳定版本并获取自动更新。
|
||||
安装脚本会提示用户以帮助他完成安装过程。建议运行稳定版本并获取自动更新。
|
||||
|
||||
当提示在本地安装 Mimic 文字转语音引擎时,请回答否。因为根据安装描述,这可能需要很长时间,并且 Mimic 有适合 Fedora 的 rpm 包,因此可以使用 dnf 进行安装。
|
||||
当提示在本地安装 Mimic 文字转语音引擎时,请回答否。因为根据安装描述,这可能需要很长时间,并且 Mimic 有适合 Fedora 的 rpm 包,因此可以使用 `dnf` 进行安装。
|
||||
|
||||
```
|
||||
$ sudo dnf install mimic
|
||||
@ -63,12 +63,10 @@ Hey Mycroft, how are you ?
|
||||
Hey Mycroft, what's the weather like ?
|
||||
```
|
||||
|
||||
如果你对它是如何工作的感兴趣,_start-mycroft.sh_ 脚本提供了一个_命令行_选项,它能让你使用命令行交互。它也会显示用于调试的有用信息。
|
||||
如果你对它是如何工作的感兴趣,`start-mycroft.sh` 脚本提供了一个命令行选项,它能让你使用命令行交互。它也会显示用于调试的有用信息。
|
||||
|
||||
Mycroft 总在学习新技能,并且有很多方法给 Mycroft 社区做[贡献][6]。
|
||||
|
||||
* * *
|
||||
|
||||
由 [Przemyslaw Marczynski][7] 摄影,发布于 [Unsplash][8]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
@ -78,7 +76,7 @@ via: https://fedoramagazine.org/personal-assistant-with-mycroft-and-fedora/
|
||||
作者:[Clément Verna][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,3 +1,4 @@
|
||||
IEAST is translating
|
||||
### Unleash Your Creativity – Linux Programs for Drawing and Image Editing
|
||||
|
||||
By: [chabowski][1]
|
||||
@ -74,11 +75,11 @@ And indeed, the sky’s the limit on how creative a user wants to be when using
|
||||
|
||||
(
|
||||
|
||||
_**2** votes, average: **5.00** out of 5_
|
||||
_**2** votes, average: **5.00** out of 5_
|
||||
|
||||
)
|
||||
|
||||
_You need to be a registered member to rate this post._
|
||||
_You need to be a registered member to rate this post._
|
||||
|
||||
Tags: [drawing][19], [Getting Started with Linux][20], [GIMP][21], [image editing][22], [Images][23], [InkScape][24], [KDE][25], [Krita][26], [Leap 42.3][27], [LibreOffice][28], [Linux Magazine][29], [Okular][30], [openSUSE][31], [PDF][32] Categories: [Desktop][33], [Expert Views][34], [LibreOffice][35], [openSUSE][36]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (chen-ni)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (LuuMing)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
216
sources/tech/20190627 How to use Tig to browse Git logs.md
Normal file
216
sources/tech/20190627 How to use Tig to browse Git logs.md
Normal file
@ -0,0 +1,216 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to use Tig to browse Git logs)
|
||||
[#]: via: (https://opensource.com/article/19/6/what-tig)
|
||||
[#]: author: (Olaf Alders https://opensource.com/users/oalders/users/mbbroberg/users/marcobravo)
|
||||
|
||||
How to use Tig to browse Git logs
|
||||
======
|
||||
Tig is more than just a text-mode interface for Git. Here's how it can
|
||||
enhance your daily workflow.
|
||||
![A person programming][1]
|
||||
|
||||
If you work with Git as your version control system, you've likely already resigned yourself to the fact that Git is a complicated beast. It is a fantastic tool, but it can be cumbersome to navigate Git repositories. That's where a tool like [Tig][2] comes in.
|
||||
|
||||
From the [Tig man page][3]:
|
||||
|
||||
> Tig is an ncurses-based text-mode interface for git(1). It functions mainly as a Git repository browser, but can also assist in staging changes for commit at chunk level and act as a pager for output from various Git commands.
|
||||
|
||||
This basically means that Tig provides a text-based user interface you can run in your terminal. Tig makes it easy to browse your Git logs, but it can do much more than just bounce you around from your last commit to a previous one.
|
||||
|
||||
![Tig screenshot][4]
|
||||
|
||||
Many of the examples in this quick introduction to Tig have been poached directly from its excellent man page. I highly recommend reading it to learn more.
|
||||
|
||||
### Install Tig
|
||||
|
||||
* Fedora and RHEL: **sudo dnf install tig**
|
||||
* Ubuntu and Debian: **sudo apt install tig**
|
||||
* MacOS: **brew install tig**
|
||||
|
||||
|
||||
|
||||
See the official [installation instructions][5] for even more options.
|
||||
|
||||
### Browse commits in your current branch
|
||||
|
||||
If you want to browse the latest commits in your branch, enter:
|
||||
|
||||
|
||||
```
|
||||
`tig`
|
||||
```
|
||||
|
||||
That's it. This three-character command will launch a browser where you can navigate the commits in your current branch. You can think of it as a wrapper around **git log**.
|
||||
|
||||
To navigate the output, you can use the Up and Down arrow keys to move from one commit to another. Pressing the Return/Enter key will open a vertical split with the contents of the chosen commit on the right-hand side. You can continue to browse up and down in your commit history on the left-hand side, and your changes will appear on the right. Use **k** and **j** to navigate up and down by line and **-** and the Space Bar to page up and down on the right-hand side. Use **q** to exit the right-hand pane.
|
||||
|
||||
Searching on **tig** output is simple as well. Use **/** to search forward and **?** to search backward on both the left and right panes.
|
||||
|
||||
![Searching Tig][6]
|
||||
|
||||
That's enough to get you started navigating your commits. There are too many key bindings to cover here, but clicking **h** will display a Help menu where you can discover its navigation and command options. You can also use **/** and **?** to search the Help menu. Use **q** to exit Help.
|
||||
|
||||
![Tig Help][7]
|
||||
|
||||
### Browse revisions for a single file
|
||||
|
||||
Since Tig is a wrapper around **git log**, it conveniently accepts the same arguments that can be passed to **git log**. For instance, to browse the commit history for a single file, enter:
|
||||
|
||||
|
||||
```
|
||||
`tig README.md`
|
||||
```
|
||||
|
||||
Compare this with the output of the Git command being wrapped to get a clearer view of how Tig enhances the output.
|
||||
|
||||
|
||||
```
|
||||
`git log README.md`
|
||||
```
|
||||
|
||||
To include the patches in the raw Git output, you can add a **-p** option:
|
||||
|
||||
|
||||
```
|
||||
`git log -p README.md`
|
||||
```
|
||||
|
||||
If you want to narrow the commits down to a specific date range, try something like this:
|
||||
|
||||
|
||||
```
|
||||
`tig --after="2017-01-01" --before="2018-05-16" -- README.md`
|
||||
```
|
||||
|
||||
Again, you can compare this with the raw Git version:
|
||||
|
||||
|
||||
```
|
||||
`git log --after="2017-01-01" --before="2018-05-16" -- README.md`
|
||||
```
|
||||
|
||||
### Browse who changed a file
|
||||
|
||||
Sometimes you want to find out who made a change to a file and why. The command:
|
||||
|
||||
|
||||
```
|
||||
`tig blame README.md`
|
||||
```
|
||||
|
||||
is essentially a wrapper around **git blame**. As you would expect, it allows you to see who the last person was to edit a given line, and it also allows you to navigate to the commit that introduced the line. This is somewhat like the **:Gblame** command Vim's **vim-fugitive** plugin provides.
|
||||
|
||||
### Browse your stash
|
||||
|
||||
If you're like me, you may have a pile of edits in your stash. It's easy to lose track of them. You can view the latest item in your stash via:
|
||||
|
||||
|
||||
```
|
||||
`git stash show -p stash@{0}`
|
||||
```
|
||||
|
||||
You can find the second most recent item via:
|
||||
|
||||
|
||||
```
|
||||
`git stash show -p stash@{1}`
|
||||
```
|
||||
|
||||
and so on. If you can recall these commands whenever you need them, you have a much sharper memory than I do.
|
||||
|
||||
As with the Git commands above, Tig makes it easy to enhance your Git output with a simple invocation:
|
||||
|
||||
|
||||
```
|
||||
`tig stash`
|
||||
```
|
||||
|
||||
Try issuing this command in a repository with a populated stash. You'll be able to browse _and search_ your stash items, giving you a quick overview of everything you saved for a rainy day.
|
||||
|
||||
### Browse your refs
|
||||
|
||||
A Git ref is the hash of something you have committed. This includes files as well as branches. Using the **tig refs** command allows you to browse all of your refs and drill down to specific commits.
|
||||
|
||||
|
||||
```
|
||||
`tig refs`
|
||||
```
|
||||
|
||||
When you're finished, use **q** to return to a previous menu.
|
||||
|
||||
### Browse git status
|
||||
|
||||
If you want to view which files have been staged and which are untracked, use **tig status**, a wrapper around **git status**.
|
||||
|
||||
![Tig status][8]
|
||||
|
||||
### Browse git grep
|
||||
|
||||
You can use the **grep** command to search for expressions in text files. The command **tig grep** allows you to navigate the output of **git grep**. For example:
|
||||
|
||||
|
||||
```
|
||||
`tig grep -i foo lib/Bar`
|
||||
```
|
||||
|
||||
will navigate the output of a case-insensitive search for **foo** in the **lib/Bar** directory.
|
||||
|
||||
### Pipe output to Tig via STDIN
|
||||
|
||||
If you are piping a list of commit IDs to Tig, you must use the **\--stdin** flag so that **tig show** reads from stdin. Otherwise, **tig show** launches without input (rendering an empty screen).
|
||||
|
||||
|
||||
```
|
||||
`git rev-list --author=olaf HEAD | tig show --stdin`
|
||||
```
|
||||
|
||||
### Add custom bindings
|
||||
|
||||
You can customize Tig with an [rc][9] file. Here's how you can configure Tig to your liking, using the example of adding some helpful custom key bindings.
|
||||
|
||||
Create a file in your home directory called **.tigrc**. Open **~/.tigrc** in your favorite editor and add:
|
||||
|
||||
|
||||
```
|
||||
# Apply the selected stash
|
||||
bind stash a !?git stash apply %(stash)
|
||||
|
||||
# Drop the selected stash item
|
||||
bind stash x !?git stash drop %(stash)
|
||||
```
|
||||
|
||||
Run **tig stash** to browse your stash, as above. However, with these bindings in place, you can press **a** to apply an item from the stash to your repository and **x** to drop an item from the stash. Keep in mind that you'll need to perform these commands when browsing the stash _list_. If you're browsing a stash _item_, enter **q** to exit that view and press **a** or **x** to get the effect you want.
|
||||
|
||||
For more information, you can read more about [Tig key bindings][10].
|
||||
|
||||
### Wrapping up
|
||||
|
||||
I hope this has been a helpful demonstration of how Tig can enhance your daily workflow. Tig can do even more powerful things (such as staging lines of code), but that's outside the scope of this introductory article. There's enough information here to make you dangerous, but there's still more to explore.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/6/what-tig
|
||||
|
||||
作者:[Olaf Alders][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/oalders/users/mbbroberg/users/marcobravo
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming)
|
||||
[2]: https://jonas.github.io/tig/
|
||||
[3]: http://manpages.ubuntu.com/manpages/bionic/man1/tig.1.html
|
||||
[4]: https://opensource.com/sites/default/files/uploads/tig.jpg (Tig screenshot)
|
||||
[5]: https://jonas.github.io/tig/INSTALL.html
|
||||
[6]: https://opensource.com/sites/default/files/uploads/tig-search.png (Searching Tig)
|
||||
[7]: https://opensource.com/sites/default/files/uploads/tig-help.png (Tig Help)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/tig-status.png (Tig status)
|
||||
[9]: https://en.wikipedia.org/wiki/Run_commands
|
||||
[10]: https://github.com/jonas/tig/wiki/Bindings
|
@ -0,0 +1,64 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (OpenAssessIt Tooklit helps improve website accessibility)
|
||||
[#]: via: (https://opensource.com/article/19/6/openassessit-toolkit)
|
||||
[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas/users/petercheer)
|
||||
|
||||
OpenAssessIt Tooklit helps improve website accessibility
|
||||
======
|
||||
Open source application reports website accessibility problems in
|
||||
human-readable format so it is easier to find and fix them.
|
||||
![web development and design, desktop and browser][1]
|
||||
|
||||
People with disabilities often feel [excluded from society][2], despite laws like the Americans with Disabilities Act and the UK's Equality Act 2010 that were created to safeguard accessibility for people with different abilities. This is even true on the web. According to the [Web Accessibility Initiative][3]:
|
||||
|
||||
> _When websites and web tools are properly designed and coded, people with disabilities can use them. However, currently many sites and tools are developed with accessibility barriers that make them difficult or impossible for some people to use._
|
||||
|
||||
Unfortunately, because of poor website design decisions, a lot of content on the web (such as PDFs) is not accessible to people with hearing, sight, mobility, neurological, and other disabilities, and as the population rapidly ages, accessibility-related problems will increase.
|
||||
|
||||
Fortunately, many businesses, governments, and other organizations are taking strides to remedy inaccessible websites. There are two paths to achieving accessibility: fixing existing websites and doing the right things when sites are created. Fixing a website that has been in use for many years—with hundreds of pages, posts, images, and PDFs—can be a daunting task. Every element must be scrutinized for problems, and sometimes the fix is not obvious nor easy to accomplish.
|
||||
|
||||
There are many [tools][4] available to check and fix website accessibility issues, including [OpenAssessIt Toolkit][5], a new open source tool developed by [Joel Crawford-Smith][6], a self-described "relentless web accessibility fanatic" and "cat aficionado."
|
||||
|
||||
[OpenAssessIt][7] converts [Chrome Lighthouse][8] files into visual, human-readable web accessibility assessments. Lighthouse audits websites for accessibility issues and reports its findings as text that can be viewed in the browser or exported as a JSON file with valuable hidden data.
|
||||
|
||||
OpenAssessIt consumes Lighthouse's data-rich JSON files and outputs them in [Markdown][9], which is easy for people to read and edit. It also takes screenshots of each failing element and provides suggestions on how to fix each issue. Automated tools help detect accessibility issues, but a human must evaluate the validity and seriousness of each problem. "Seeing the issues visually [is] a good tool for training and development," Joel says.
|
||||
|
||||
The toolkit also includes [OpenDiffIt][10] to help prevent accidentally re-checking PDF files that have already been validated as accessible. It identifies new or modified PDF files by comparing user-generated CSV files from server logs or analytics, generating a unique hash for every file, and marking each one as New, Same, or Modified (based on the hash). By using OpenDiffIt, users can make sure all new or revised PDF files are validated without doing unnecessary work.
|
||||
|
||||
### OpenAssessIt development
|
||||
|
||||
Joel developed the OpenAssessIt Toolkit with Python, which he says "makes development fun."
|
||||
|
||||
OpenAssessIt is available as a native version that requires Python, headless Chrome, and Selenium, and as a simple Docker version, which doesn't require any Python knowledge to use. OpenDiffIt is only available as a Python version, but Joel says he hopes to make a Docker version available soon.
|
||||
|
||||
Joel concedes the OpenAssessIt Toolkit is still in a "primitive" stage and says it is a good option for people who don't have the money for big, enterprise-wide solutions. He hopes the software will be politely "roasted" by the open source community to help him improve it. He would also like help to give the tool a graphical user interface that is easier for less tech-savvy people to use.
|
||||
|
||||
Accessibility is an ongoing endeavor, and people like Joel Crawford-Smith are making the task less daunting by developing open source solutions.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/6/openassessit-toolkit
|
||||
|
||||
作者:[Jeff Macharyas][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/jeffmacharyas/users/petercheer
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/web_browser_desktop_devlopment_design_system_computer.jpg?itok=pfqRrJgh (web development and design, desktop and browser)
|
||||
[2]: https://rightsinfo.org/49-of-disabled-people-feel-excluded-from-society/
|
||||
[3]: https://www.w3.org/WAI/
|
||||
[4]: https://www.w3.org/WAI/ER/tools/
|
||||
[5]: https://github.com/OpenAssessItToolkit
|
||||
[6]: http://joelcrawfordsmith.com/
|
||||
[7]: https://github.com/OpenAssessItToolkit/openassessit
|
||||
[8]: https://developers.google.com/web/tools/lighthouse/
|
||||
[9]: https://en.wikipedia.org/wiki/Markdown
|
||||
[10]: https://github.com/OpenAssessItToolkit/opendiffit
|
339
sources/tech/20190627 RPM packages explained.md
Normal file
339
sources/tech/20190627 RPM packages explained.md
Normal file
@ -0,0 +1,339 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (RPM packages explained)
|
||||
[#]: via: (https://fedoramagazine.org/rpm-packages-explained/)
|
||||
[#]: author: (Ankur Sinha "FranciscoD" https://fedoramagazine.org/author/ankursinha/)
|
||||
|
||||
RPM packages explained
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Perhaps the best known way the Fedora community pursues its [mission of promoting free and open source software and content][2] is by developing the [Fedora software distribution][3]. So it’s not a surprise at all that a very large proportion of our community resources are spent on this task. This post summarizes how this software is “packaged” and the underlying tools such as _rpm_ that make it all possible.
|
||||
|
||||
### RPM: the smallest unit of software
|
||||
|
||||
The editions and flavors ([spins][4]/[labs][5]/[silverblue][6]) that users get to choose from are all very similar. They’re all composed of various software that is mixed and matched to work well together. What differs between them is the exact list of tools that goes into each. That choice depends on the use case that they target. The basic unit of all of these is an RPM package file.
|
||||
|
||||
RPM files are archives that are similar to ZIP files or tarballs. In fact, they uses compression to reduce the size of the archive. However, along with files, RPM archives also contain metadata about the package. This can be queried using the _rpm_ tool:
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
$ rpm -q fpaste
|
||||
fpaste-0.3.9.2-2.fc30.noarch
|
||||
|
||||
$ rpm -qi fpaste
|
||||
Name : fpaste
|
||||
Version : 0.3.9.2
|
||||
Release : 2.fc30
|
||||
Architecture: noarch
|
||||
Install Date: Tue 26 Mar 2019 08:49:10 GMT
|
||||
Group : Unspecified
|
||||
Size : 64144
|
||||
License : GPLv3+
|
||||
Signature : RSA/SHA256, Thu 07 Feb 2019 15:46:11 GMT, Key ID ef3c111fcfc659b9
|
||||
Source RPM : fpaste-0.3.9.2-2.fc30.src.rpm
|
||||
Build Date : Thu 31 Jan 2019 20:06:01 GMT
|
||||
Build Host : buildhw-07.phx2.fedoraproject.org
|
||||
Relocations : (not relocatable)
|
||||
Packager : Fedora Project
|
||||
Vendor : Fedora Project
|
||||
URL : <https://pagure.io/fpaste>
|
||||
Bug URL : <https://bugz.fedoraproject.org/fpaste>
|
||||
Summary : A simple tool for pasting info onto sticky notes instances
|
||||
Description :
|
||||
It is often useful to be able to easily paste text to the Fedora
|
||||
Pastebin at <http://paste.fedoraproject.org> and this simple script
|
||||
will do that and return the resulting URL so that people may
|
||||
examine the output. This can hopefully help folks who are for
|
||||
some reason stuck without X, working remotely, or any other
|
||||
reason they may be unable to paste something into the pastebin
|
||||
|
||||
$ rpm -ql fpaste
|
||||
/usr/bin/fpaste
|
||||
/usr/share/doc/fpaste
|
||||
/usr/share/doc/fpaste/README.rst
|
||||
/usr/share/doc/fpaste/TODO
|
||||
/usr/share/licenses/fpaste
|
||||
/usr/share/licenses/fpaste/COPYING
|
||||
/usr/share/man/man1/fpaste.1.gz
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
When an RPM package is installed, the _rpm_ tools know exactly what files were added to the system. So, removing a package also removes these files, and leaves the system in a consistent state. This is why installing software using _rpm_ is preferred over installing software from source whenever possible.
|
||||
|
||||
### Dependencies
|
||||
|
||||
Nowadays, it is quite rare for software to be completely self-contained. Even [fpaste][7], a simple one file Python script, requires that the Python interpreter be installed. So, if the system does not have Python installed (highly unlikely, but possible), _fpaste_ cannot be used. In packager jargon, we say that “Python is a **run-time dependency** of _fpaste_“.
|
||||
|
||||
When RPM packages are built (the process of building RPMs is not discussed in this post), the generated archive includes all of this metadata. That way, the tools interacting with the RPM package archive know what else must must be installed so that fpaste works correctly:
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
$ rpm -q --requires fpaste
|
||||
/usr/bin/python3
|
||||
python3
|
||||
rpmlib(CompressedFileNames) &lt;= 3.0.4-1
|
||||
rpmlib(FileDigests) &lt;= 4.6.0-1
|
||||
rpmlib(PayloadFilesHavePrefix) &lt;= 4.0-1
|
||||
rpmlib(PayloadIsXz) &lt;= 5.2-1
|
||||
|
||||
$ rpm -q --provides fpaste
|
||||
fpaste = 0.3.9.2-2.fc30
|
||||
|
||||
$ rpm -qi python3
|
||||
Name : python3
|
||||
Version : 3.7.3
|
||||
Release : 3.fc30
|
||||
Architecture: x86_64
|
||||
Install Date: Thu 16 May 2019 18:51:41 BST
|
||||
Group : Unspecified
|
||||
Size : 46139
|
||||
License : Python
|
||||
Signature : RSA/SHA256, Sat 11 May 2019 17:02:44 BST, Key ID ef3c111fcfc659b9
|
||||
Source RPM : python3-3.7.3-3.fc30.src.rpm
|
||||
Build Date : Sat 11 May 2019 01:47:35 BST
|
||||
Build Host : buildhw-05.phx2.fedoraproject.org
|
||||
Relocations : (not relocatable)
|
||||
Packager : Fedora Project
|
||||
Vendor : Fedora Project
|
||||
URL : <https://www.python.org/>
|
||||
Bug URL : <https://bugz.fedoraproject.org/python3>
|
||||
Summary : Interpreter of the Python programming language
|
||||
Description :
|
||||
Python is an accessible, high-level, dynamically typed, interpreted programming
|
||||
language, designed with an emphasis on code readability.
|
||||
It includes an extensive standard library, and has a vast ecosystem of
|
||||
third-party libraries.
|
||||
|
||||
The python3 package provides the "python3" executable: the reference
|
||||
interpreter for the Python language, version 3.
|
||||
The majority of its standard library is provided in the python3-libs package,
|
||||
which should be installed automatically along with python3.
|
||||
The remaining parts of the Python standard library are broken out into the
|
||||
python3-tkinter and python3-test packages, which may need to be installed
|
||||
separately.
|
||||
|
||||
Documentation for Python is provided in the python3-docs package.
|
||||
|
||||
Packages containing additional libraries for Python are generally named with
|
||||
the "python3-" prefix.
|
||||
|
||||
$ rpm -q --provides python3
|
||||
python(abi) = 3.7
|
||||
python3 = 3.7.3-3.fc30
|
||||
python3(x86-64) = 3.7.3-3.fc30
|
||||
python3.7 = 3.7.3-3.fc30
|
||||
python37 = 3.7.3-3.fc30
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
### Resolving RPM dependencies
|
||||
|
||||
While _rpm_ knows the required dependencies for each archive, it does not know where to find them. This is by design: _rpm_ only works on local files and must be told exactly where they are. So, if you try to install a single RPM package, you get an error if _rpm_ cannot find the package’s run-time dependencies. This example tries to install a package downloaded from the Fedora package set:
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
$ ls
|
||||
python3-elephant-0.6.2-3.fc30.noarch.rpm
|
||||
|
||||
$ rpm -qpi python3-elephant-0.6.2-3.fc30.noarch.rpm
|
||||
Name : python3-elephant
|
||||
Version : 0.6.2
|
||||
Release : 3.fc30
|
||||
Architecture: noarch
|
||||
Install Date: (not installed)
|
||||
Group : Unspecified
|
||||
Size : 2574456
|
||||
License : BSD
|
||||
Signature : (none)
|
||||
Source RPM : python-elephant-0.6.2-3.fc30.src.rpm
|
||||
Build Date : Fri 14 Jun 2019 17:23:48 BST
|
||||
Build Host : buildhw-02.phx2.fedoraproject.org
|
||||
Relocations : (not relocatable)
|
||||
Packager : Fedora Project
|
||||
Vendor : Fedora Project
|
||||
URL : <http://neuralensemble.org/elephant>
|
||||
Bug URL : <https://bugz.fedoraproject.org/python-elephant>
|
||||
Summary : Elephant is a package for analysis of electrophysiology data in Python
|
||||
Description :
|
||||
Elephant - Electrophysiology Analysis Toolkit Elephant is a package for the
|
||||
analysis of neurophysiology data, based on Neo.
|
||||
|
||||
$ rpm -qp --requires python3-elephant-0.6.2-3.fc30.noarch.rpm
|
||||
python(abi) = 3.7
|
||||
python3.7dist(neo) >= 0.7.1
|
||||
python3.7dist(numpy) >= 1.8.2
|
||||
python3.7dist(quantities) >= 0.10.1
|
||||
python3.7dist(scipy) >= 0.14.0
|
||||
python3.7dist(six) >= 1.10.0
|
||||
rpmlib(CompressedFileNames) &lt;= 3.0.4-1
|
||||
rpmlib(FileDigests) &lt;= 4.6.0-1
|
||||
rpmlib(PartialHardlinkSets) &lt;= 4.0.4-1
|
||||
rpmlib(PayloadFilesHavePrefix) &lt;= 4.0-1
|
||||
rpmlib(PayloadIsXz) &lt;= 5.2-1
|
||||
|
||||
$ sudo rpm -i ./python3-elephant-0.6.2-3.fc30.noarch.rpm
|
||||
error: Failed dependencies:
|
||||
python3.7dist(neo) >= 0.7.1 is needed by python3-elephant-0.6.2-3.fc30.noarch
|
||||
python3.7dist(quantities) >= 0.10.1 is needed by python3-elephant-0.6.2-3.fc30.noarch
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
In theory, one could download all the packages that are required for _python3-elephant_, and tell _rpm_ where they all are, but that isn’t convenient. What if _python3-neo_ and _python3-quantities_ have other run-time requirements and so on? Very quickly, the **dependency chain** can get quite complicated.
|
||||
|
||||
#### Repositories
|
||||
|
||||
Luckily, _dnf_ and friends exist to help with this issue. Unlike _rpm_, _dnf_ is aware of **repositories**. Repositories are collections of packages, with metadata that tells _dnf_ what these repositories contain. All Fedora systems come with the default Fedora repositories enabled by default:
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
$ sudo dnf repolist
|
||||
repo id repo name status
|
||||
fedora Fedora 30 - x86_64 56,582
|
||||
fedora-modular Fedora Modular 30 - x86_64 135
|
||||
updates Fedora 30 - x86_64 - Updates 8,573
|
||||
updates-modular Fedora Modular 30 - x86_64 - Updates 138
|
||||
updates-testing Fedora 30 - x86_64 - Test Updates 8,458
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
There’s more information on [these repositories][8], and how they [can be managed][9] on the Fedora quick docs.
|
||||
|
||||
_dnf_ can be used to query repositories for information on the packages they contain. It can also search them for software, or install/uninstall/upgrade packages from them:
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
$ sudo dnf search elephant
|
||||
Last metadata expiration check: 0:05:21 ago on Sun 23 Jun 2019 14:33:38 BST.
|
||||
============================================================================== Name &amp; Summary Matched: elephant ==============================================================================
|
||||
python3-elephant.noarch : Elephant is a package for analysis of electrophysiology data in Python
|
||||
python3-elephant.noarch : Elephant is a package for analysis of electrophysiology data in Python
|
||||
|
||||
$ sudo dnf list \\*elephant\\*
|
||||
Last metadata expiration check: 0:05:26 ago on Sun 23 Jun 2019 14:33:38 BST.
|
||||
Available Packages
|
||||
python3-elephant.noarch 0.6.2-3.fc30 updates-testing
|
||||
python3-elephant.noarch 0.6.2-3.fc30 updates
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
#### Installing dependencies
|
||||
|
||||
When installing the package using _dnf_ now, it _resolves_ all the required dependencies, then calls _rpm_ to carry out the _transaction_:
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
$ sudo dnf install python3-elephant
|
||||
Last metadata expiration check: 0:06:17 ago on Sun 23 Jun 2019 14:33:38 BST.
|
||||
Dependencies resolved.
|
||||
==============================================================================================================================================================================================
|
||||
Package Architecture Version Repository Size
|
||||
==============================================================================================================================================================================================
|
||||
Installing:
|
||||
python3-elephant noarch 0.6.2-3.fc30 updates-testing 456 k
|
||||
Installing dependencies:
|
||||
python3-neo noarch 0.8.0-0.1.20190215git49b6041.fc30 fedora 753 k
|
||||
python3-quantities noarch 0.12.2-4.fc30 fedora 163 k
|
||||
Installing weak dependencies:
|
||||
python3-igor noarch 0.3-5.20150408git2c2a79d.fc30 fedora 63 k
|
||||
|
||||
Transaction Summary
|
||||
==============================================================================================================================================================================================
|
||||
Install 4 Packages
|
||||
|
||||
Total download size: 1.4 M
|
||||
Installed size: 7.0 M
|
||||
Is this ok [y/N]: y
|
||||
Downloading Packages:
|
||||
(1/4): python3-igor-0.3-5.20150408git2c2a79d.fc30.noarch.rpm 222 kB/s | 63 kB 00:00
|
||||
(2/4): python3-elephant-0.6.2-3.fc30.noarch.rpm 681 kB/s | 456 kB 00:00
|
||||
(3/4): python3-quantities-0.12.2-4.fc30.noarch.rpm 421 kB/s | 163 kB 00:00
|
||||
(4/4): python3-neo-0.8.0-0.1.20190215git49b6041.fc30.noarch.rpm 840 kB/s | 753 kB 00:00
|
||||
\----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Total 884 kB/s | 1.4 MB 00:01
|
||||
Running transaction check
|
||||
Transaction check succeeded.
|
||||
Running transaction test
|
||||
Transaction test succeeded.
|
||||
Running transaction
|
||||
Preparing : 1/1
|
||||
Installing : python3-quantities-0.12.2-4.fc30.noarch 1/4
|
||||
Installing : python3-igor-0.3-5.20150408git2c2a79d.fc30.noarch 2/4
|
||||
Installing : python3-neo-0.8.0-0.1.20190215git49b6041.fc30.noarch 3/4
|
||||
Installing : python3-elephant-0.6.2-3.fc30.noarch 4/4
|
||||
Running scriptlet: python3-elephant-0.6.2-3.fc30.noarch 4/4
|
||||
Verifying : python3-elephant-0.6.2-3.fc30.noarch 1/4
|
||||
Verifying : python3-igor-0.3-5.20150408git2c2a79d.fc30.noarch 2/4
|
||||
Verifying : python3-neo-0.8.0-0.1.20190215git49b6041.fc30.noarch 3/4
|
||||
Verifying : python3-quantities-0.12.2-4.fc30.noarch 4/4
|
||||
|
||||
Installed:
|
||||
python3-elephant-0.6.2-3.fc30.noarch python3-igor-0.3-5.20150408git2c2a79d.fc30.noarch python3-neo-0.8.0-0.1.20190215git49b6041.fc30.noarch python3-quantities-0.12.2-4.fc30.noarch
|
||||
|
||||
Complete!
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
Notice how dnf even installed _python3-igor_, which isn’t a direct dependency of _python3-elephant_.
|
||||
|
||||
### DnfDragora: a graphical interface to DNF
|
||||
|
||||
While technical users may find _dnf_ straightforward to use, it isn’t for everyone. [Dnfdragora][10] addresses this issue by providing a graphical front end to _dnf_.
|
||||
|
||||
![dnfdragora \(version 1.1.1-2 on Fedora 30\) listing all the packages installed on a system.][11]
|
||||
|
||||
From a quick look, dnfdragora appears to provide all of _dnf_‘s main functions.
|
||||
|
||||
There are other tools in Fedora that also manage packages. GNOME Software, and Discover are two examples. GNOME Software is focused on graphical applications only. You can’t use the graphical front end to install command line or terminal tools such as _htop_ or _weechat_. However, GNOME Software does support the installation of [Flatpaks][12] and Snap applications which _dnf_ does not. So, they are different tools with different target audiences, and so provide different functions.
|
||||
|
||||
This post only touches the tip of the iceberg that is the life cycle of software in Fedora. This article explained what RPM packages are, and the main differences between using _rpm_ and using _dnf_.
|
||||
|
||||
In future posts, we’ll speak more about:
|
||||
|
||||
* The processes that are needed to create these packages
|
||||
* How the community tests them to ensure that they are built correctly
|
||||
* The infrastructure that the community uses to get them to community users in future posts.
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/rpm-packages-explained/
|
||||
|
||||
作者:[Ankur Sinha "FranciscoD"][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/ankursinha/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/rpm.png-816x345.jpg
|
||||
[2]: https://docs.fedoraproject.org/en-US/project/#_what_is_fedora_all_about
|
||||
[3]: https://getfedora.org
|
||||
[4]: https://spins.fedoraproject.org/
|
||||
[5]: https://labs.fedoraproject.org/
|
||||
[6]: https://silverblue.fedoraproject.org/
|
||||
[7]: https://src.fedoraproject.org/rpms/fpaste
|
||||
[8]: https://docs.fedoraproject.org/en-US/quick-docs/repositories/
|
||||
[9]: https://docs.fedoraproject.org/en-US/quick-docs/adding-or-removing-software-repositories-in-fedora/
|
||||
[10]: https://src.fedoraproject.org/rpms/dnfdragora
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2019/06/dnfdragora-1024x558.png
|
||||
[12]: https://fedoramagazine.org/getting-started-flatpak/
|
Loading…
Reference in New Issue
Block a user