Merge branch 'LCTT:master' into master

This commit is contained in:
Piaoshi 2021-07-22 22:15:00 +08:00 committed by GitHub
commit 3cf16d80fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 522 additions and 73 deletions

View File

@ -0,0 +1,77 @@
分支与发行版有什么不同?
======
> 开源软件的发行版和分支是不一样的。了解其中的区别和潜在的风险。
![](https://img.linux.net.cn/data/attachment/album/202107/22/205518spblrgcpxrlnbibe.jpg)
如果你们对开源软件有过一段时间的了解,一定曾在许多相关方面中听说过<ruby>分支<rt>fork</rt></ruby><ruby>发行版<rt>distribution</rt></ruby>两个词。许多人对这两个词的区别不太清楚,因此我将试着通过这篇文章为大家解答这一疑惑。
LCTT 译注fork 一词,按我们之前的倡议,在版本控制工作流中,为了避免和同一个仓库的 branch 一词混淆,我们建议翻译为“复刻”。但是在项目和发行版这个语境下,没有这个混淆,惯例上还是称之为“分支”。)
### 首先,一些定义
在解释分支与发行版两者的细微区别与相似之处之前,让我们先给一些相关的重要概念下定义。
**[开源软件][1]** 是指具有以下特点的软件:
* 在特定的 [许可证][2] 限制下,软件供所有人免费分发
* 在特定的许可证限制下,软件源代码可以供所有人查看与修改
开源软件可以按以下方式 **使用**
* 以二进制或者源代码的方式下载,通常是免费的。(例如,[Eclipse 开发者环境][3]
* 作为一个商业公司的产品,有时向用户提供一些服务并以此收费。(例如,[红帽产品][4]
* 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的 [Freetype 软件][5]
<ruby>自由开源软件<rt>free and open source software</rt></ruby>FOSS不一定是“零成本”的“<ruby>免费<rt>free</rt></ruby>”。自由开源软件仅仅意味着这个软件在遵守软件许可证的前提下可以自由地分发、修改、研究和使用。软件分发者也可能为该软件定价。例如Linux 可以是 Fedora、Centos、Gentoo 等免费发行版,也可以是付费的发行版,如红帽企业版 LinuxRHEL、SUSE Linux 企业版SLES等。
<ruby>社区<rt>community</rt></ruby>指的是在一个开源项目上协作的团体或个人。任何人或者团体都可以在遵守协议的前提下,通过编写或审查代码/文档/测试套件、管理会议、更新网站等方式为开源项目作出贡献。例如,在 [Openhub.net][6] 网站上,我们可以看见政府、非营利性机构、商业公司和教育团队等组织都在 [为一些开源项目作出贡献][7]。
一个开源<ruby>项目<rt>project</rt></ruby>是集协作开发、文档和测试的结果。大多数项目都搭建了一个中央仓库用来存储代码、文档、测试文件和目前正在开发的文件。
<ruby>发行版<rt>distribution</rt></ruby>是指开源项目的一份的二进制或源代码的副本。例如CentOS、Fedora、红帽企业版 LinuxRHEL、SUSE Linux、Ubuntu 等都是 Linux 项目的发行版。Tectonic、谷歌的 Kubernetes 引擎GKE、亚马逊的容器服务和红帽的 OpenShift 都是 Kubernetes 项目的发行版。
开源项目的商业发行版经常被称作<ruby>产品<rt>products</rt></ruby>,因此,红帽 OpenStack 平台是红帽 OpenStack 的产品,它是 OpenStack 上游项目的一个发行版,并且是百分百开源的。
<ruby>主干<rt>trunk</rt></ruby>是开发开源项目的社区的主要工作流。
开源<runy>分支<rt>fork</rt></ruby>是开源项目主干的一个版本,它是分离自主干的独立工作流。
因此,**发行版并不等同于分支**。发行版是上游项目的一种包装,由厂商提供,经常作为产品进行销售。然而,发行版的核心代码和文档与上游项目的版本保持一致。分支,以及任何基于分支的的发行版,导致代码和文档的版本与上游项目不同。对上游项目进行了分支的用户必须自己来维护分支项目,这意味着他们失去了上游社区协同工作带来的好处。
为了进一步解释软件分支,让我来用动物迁徙作比喻。鲸鱼和海狮从北极迁徙到加利福尼亚和墨西哥;帝王斑蝶从阿拉斯加迁徙到墨西哥;并且北半球的燕子和许多其他鸟类飞翔南方去过冬。成功迁徙的关键因素在于,团队中的所有动物团结一致,紧跟领导者,找到食物和庇护所,并且不会迷路。
### 独立前行带来的风险
一只鸟、帝王蝶或者鲸鱼一旦掉队就失去了许多优势,例如团队带来的保护,以及知道哪儿有食物、庇护所和目的地。
相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险:
1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术债,对分支的代码修改的越多,将这一分支重新归入上游项目需要花费的时间和金钱成本就越高。
2. **分支用户有可能运行不太安全的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能无法从这次修复中受益。
3. **分支用户可能不会从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户利益的新特性。如果一个组织从上游分支,由于代码不同,它们可能无法纳入新的功能。
4. **它们可能无法和其他软件包整合在一起。** 开源项目很少是作为单一实体开发的;相反地,它们经常被与其他项目打包在一起构成一套解决方案。分支代码可能无法与其他项目整合,因为分支代码的开发者没有与上游的其他参与者们合作。
5. **它们可能不会得到硬件平台认证。** 软件包通常被搭载在硬件平台上进行认证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。
总之,开源发行版只是一个来自上游的、多组织协同开发的、由供应商销售与支持的打包集合。分支是一个开源项目的独立开发工作流,有可能无法从上游社区协同工作的结果中受益。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/7/forks-vs-distributions
作者:[Jonathan Gershater][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[Wlzzzz-del](https://github.com/Wlzzzz-del)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/jgershat
[1]:https://opensource.com/resources/what-open-source
[2]:https://opensource.com/tags/licensing
[3]:https://www.eclipse.org/che/getting-started/download/
[4]:https://access.redhat.com/downloads
[5]:https://www.freetype.org/
[6]:http://openhub.net
[7]:https://www.openhub.net/explore/orgs

View File

@ -0,0 +1,91 @@
[#]: subject: (You Can Now Use KDE Connect in Windows as Well)
[#]: via: (https://news.itsfoss.com/kde-connect-windows/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
You Can Now Use KDE Connect in Windows as Well
======
KDE Connect is a popular open-source tool that lets you share a connection between a phone and your computer.
While it was always limited to the Linux platform, it looks like that it is coming to Windows after all.
And, cross-platform availability of software is always a good thing.
### What is KDE Connect?
In case you are coming across it for the first time—KDE connect lets you share files, links, sync notifications, gives you the ability to reply to messages, and more.
You can also choose to control your desktop and perform some custom commands remotely. And, you can also use your phone to control the volume/skip the music playing on your computer.
### KDE Connect Available as Beta in Microsoft Store
![][1]
As per a Reddit thread posted a few weeks back, a KDE contributor mentions that the beta version is available from the [Microsoft Store][2].
However, it is only accessible through the private link and cannot be found when you search for it in the Microsoft Store.
This also marks official support for Windows.
![][3]
### KDE Connect for Windows: Heres How it Looks
![][4]
You just need to make sure that both of your devices are connected to the same network.
Next, all you have to do is pair them and then start sharing files/links, browse your phone, and also get notifications.
You can choose to tweak some of the options that include storage paths for shared images or change the sound to play when you try to ring the device.
![][5]
As you can notice here, you have a variety of options to make use of.
I tried connecting my Android device for a while, and it worked just fine. You may want to explore more to learn what else you can do with it.
### Why is it Good News for Windows Users?
Undoubtedly Windows users already had plenty of options to achieve the same functions without KDE Connect. But with KDE connect onboard, it will finally provide the opportunity to use an open-source and privacy-friendly tool that they can pair their devices with.
After all, you would not want your notifications, and links/files that you share to be spied upon by a shoddy third-party application.
In that case, KDE Connect is your friend.
Even though it is in beta right now. You can try it out by visiting the link and installing it from the Microsoft store.
[KDE Connect on Microsoft Store][2]
**Via**: [Omg!Ubuntu!][6]
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/kde-connect-windows/
作者:[Ankush Das][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://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIyOCIgd2lkdGg9Ijc2MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[2]: https://www.microsoft.com/en-gb/p/kde-connect/9n93mrmsxbf0?&activetab=pivot:overviewtab
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI4NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2MyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: https://www.omgubuntu.co.uk/2021/07/kde-connect-windows-app

View File

@ -0,0 +1,219 @@
[#]: subject: (Run GitHub Actions on Fedora CoreOS)
[#]: via: (https://fedoramagazine.org/run-github-actions-on-fedora-coreos/)
[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Run GitHub Actions on Fedora CoreOS
======
![][1]
[United Artists][2], Public domain, via Wikimedia Commons
[GitHub Actions][3] is a service provided to quickly setup continuous integration and delivery (CI/CD) workflows . These workflows run on hosts called _runners_. GitHub provides [hosted runners][4] with a limited set of operating system choice (Windows Server, Ubuntu, MacOS).
Another option is to use [self-hosted][5] runners which gives the repository administrator more control on the runners. Self-hosted runners are dedicated to a repository or organization. The following article goes through the steps of configuring self-hosted runners using Fedora CoreOS.
### Getting Started
Fedora CoreOS is a minimalist operating system designed to be easy to deploy and maintain at scale. The operating system will automaticaly update and provide, by default, the tools needed to run containers. For all of these reasons, Fedora CoreOS is a great choice to consider for running CI/CD workflows.
The first step to configure and provision a Fedora CoreOS machine is to generate an [Ignition][6] file. [Butane][7] allows you to generate Ignitions file using a friendlier format (YAML).
#### Configure a Fedora CoreOS runner
To execute GitHub actions on Fedora CoreOS, the host needs the binaries and scripts used to register and run the runner. Download the binaries and scripts from the [actions runner project][8] and deploy under _/usr/local/sbin/actions-runner_.
```
version: "1.3.0"
variant: fcos
storage:
directories:
- path: /usr/local/sbin/actions-runner
mode: 0755
user:
name: core
group:
name: core
files:
- path: /usr/local/sbin/actions-runner/actions-runner-linux.tar.gz
overwrite: true
contents:
source: https://github.com/actions/runner/releases/download/v2.278.0/actions-runner-linux-x64-2.278.0.tar.gz
mode: 0755
user:
name: core
group:
name: core
```
#### Registration and Removal token
Configuring runners for a project requires a “token”. This prevents registering or removing self-hosted runners from projects without the correct permissions. Tokens provided by Github have a one hour expiration time. If the runner restarts after this time it will require a new registration token.
The token can be problematic, in particular with Fedora CoreOS automatic updates. The update process expects that the host will restart at least once every couple weeks after receiving new data.
Luckily, it is possible to use GitHub REST API to obtain these tokens and automatically configure the runner every time the host restarts. The following _manage-runner.sh_ script uses the APIs to retrieve a token, remove any runner already configured and register the runner with a new token.
```
#!/bin/bash
# Handles the Github Action runner configuration.
# Remove and Registration token expires after 1 hour, if we want our runner
# to work after a reboot (auto update) we need to refresh the tokens.
# First remove the runner with a fresh remove token
REMOVE_TOKEN=$(curl -u ${GITHUB_USER}:${GITHUB_TOKEN} -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/actions/runners/remove-token | jq -r '.token')
/usr/local/sbin/actions-runner/config.sh remove --token ${REMOVE_TOKEN}
# Then register the runner with a fresh registration token
REGISTRATION_TOKEN=$(curl -u ${GITHUB_USER}:${GITHUB_TOKEN} -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/actions/runners/registration-token | jq -r '.token')
/usr/local/sbin/actions-runner/config.sh --url https://github.com/cverna/fcos-actions-runner --token ${REGISTRATION_TOKEN} --labels fcos --unattended
```
The script above uses a few environment variables that contain a GitHub username and a [Personal Access Token][9] used to authenticate the REST API requests. The Personal Access Token requires the repo permissions in order to successfully retrieve the runner registration and removal tokens. The token is security sensitive so it is better to store it in a different file with stricter permissions. In this example that file is _actions-runner_.
```
GITHUB_USER=<user>
GITHUB_REPO=<repo>
GITHUB_TOKEN=<personal_access_token>
```
Following is the Butane snippet that creates these two files _manage-runner.sh_ and _actions-runner_.
```
- path: /usr/local/sbin/actions-runner/manage-runner.sh
contents:
local: manage-runner.sh
mode: 0755
user:
name: core
group:
name: core
- path: /etc/actions-runner
contents:
local: actions-runner
mode: 0700
user:
name: core
group:
name: core
```
### Running Actions on Fedora CoreOS
Finally, create the systemd services that will configure and start the runner. Define the services in the Butane configuration file.
```
systemd:
units:
- name: github-runner-configure.service
enabled: true
contents: |
[Unit]
Description=Configure the github action runner for a repository
After=network-online.target boot-complete.target
Requires=boot-complete.target
[Service]
EnvironmentFile=/etc/actions-runner
Type=oneshot
RemainAfterExit=yes
User=core
WorkingDirectory=/usr/local/sbin/actions-runner
ExecStartPre=tar xvf actions-runner-linux.tar.gz --no-same-owner
ExecStart=/usr/local/sbin/actions-runner/manage-runner.sh
[Install]
WantedBy=multi-user.target
- name: github-runner.service
enabled: true
contents: |
[Unit]
Description=Run the github action runner
After=github-runner-configure.service
[Service]
WorkingDirectory=/usr/local/sbin/actions-runner
User=core
ExecStart=/usr/local/sbin/actions-runner/run.sh
[Install]
WantedBy=multi-user.target
```
This creates two services, _github-runner-configure.service_ (running once when the host has finished booting) and _github-runner.service_ (running the Actions runner binaries and waiting for new CI/CD jobs).
Now that the Butane configuration is complete, generate an Ignition file out of it and provision a Fedora CoreOS Actions runner.
```
$ podman run -i --rm -v $PWD:/code:z --workdir /code quay.io/coreos/butane:release --pretty --strict --files-dir /code config.yaml -o config.ignition
```
Once the Ignition file is generated, it can be used to provision a runner on the platforms where Fedora CoreOS is [available][10].
> [Getting started with Fedora CoreOS][11]
### Configure an Action to use a self-hosted runner
The following test Action workflow will test the FCOS self-hosted worker. Create the following file in your git repository _.github/workflows/main.yml_
```
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: fcos
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a single command using the runners shell
- name: Run a one-line script
run: podman run --rm fedora-minimal:34 echo Hello World !
```
Note that the _runs-on_ configuration is set up to use a runner with the label _fcos_.
The code presented in this article is available [here][12].
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/run-github-actions-on-fedora-coreos/
作者:[Clément Verna][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/cverna/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/modern-times-816x345.jpg
[2]: https://commons.wikimedia.org/wiki/File:Chaplin_-_Modern_Times.jpg
[3]: https://docs.github.com/en/actions
[4]: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
[5]: https://docs.github.com/en/actions/hosting-your-own-runners
[6]: https://github.com/coreos/ignition
[7]: https://github.com/coreos/butane
[8]: https://github.com/actions/runner
[9]: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
[10]: https://docs.fedoraproject.org/en-US/fedora-coreos/bare-metal/
[11]: https://fedoramagazine.org/getting-started-with-fedora-coreos/
[12]: https://github.com/cverna/fcos-actions-runner

View File

@ -0,0 +1,135 @@
[#]: subject: (Top Android Emulators to Run and Test Android Apps on Linux)
[#]: via: (https://itsfoss.com/android-emulators-linux/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Top Android Emulators to Run and Test Android Apps on Linux
======
Android is built on top of a heavily customized Linux kernel. So, running mobile apps on Linux makes sense using an Android emulator.
While this is not something new that you can do on your Linux machine, it is a feature more in demand after Windows introduced the ability to run Android apps in 2021.
Not just limited to using apps, some of the Android emulators can also come in handy for development and testing.
Hence, I have compiled a list of the best emulators that you can use to test or run Android applications/games on Linux.
### 1\. Anbox
Anbox is a pretty popular emulator that lets Linux users run Android apps. Probably this is what Deepin Linux utilizes to make help run Android apps out of the box.
It isolates the Android operating system from the host using a container, which also lets them make the latest Android version available to use.
Android apps running will not have direct access to your hardware—which is a good security decision.
Unlike some of the other options here, Anbox does not technically need an emulation layer to make Android work. In other words, it is as close to a native Android experience on your Linux system.
For this reason, it may not be the easiest option available. You cannot just use the Google Play Store to install applications, you need to utilize Android Debug Bridge (ADB). All you need is the APK file of an app to install and use it.
[Anbox][1]
### 2\. Genymotion
![][2]
Genymotion is an impressive solution tailored for testing and development.
It is not a free and open-source option. They provide virtual Android experiences as a service through the cloud or a desktop client that is independent of Android Studio.
You can simulate a variety of hardware configurations and Android versions to create a virtual device for testing. It also gives you the ability to scale up and has multiple Android virtual devices running for extensive tests.
It can help you test how file uploading works in your app, impacts battery, performance, memory, and so on.
While it is a premium solution mostly for professionals, it does support the latest Linux distributions that include Ubuntu 20.04 LTS.
[Genymotion][3]
### 3\. Android-x86
![][4]
Android x86 is an open-source project to make Android run on a PC with 32-bit support.
You can choose to install it using a virtual machine manager on your Linux system or directly try it on your PC.
Official [installation instructions][5] are available if you need to go ahead.
Unlike some other options, it is a simple emulator that tries to work on a PC with no fancy features.
[Android x86][6]
### 4\. Android Studio (Virtual Devices)
![][7]
Android Studio is a full-fledged tool for development and testing. Fortunately, with the support for Linux, you can use it to emulate the Android experience for experiments if you need to.
You just need to create an Android Virtual Device (AVD) that you can configure and then simulate as an emulator.
There are good chances to find support for some of the latest smartphones, TVs, and smartwatches as well.
It needs a certain learning curve to be able to pull it off, but it is free and completely open-source.
[Android Studio][8]
### 5\. ARChon
![][9]
An interesting solution is an Android emulator that you can use in Linux and any other platform.
It helps run Android apps on Chrome OS or with Chrome browser on any operating system. Unlike some others, you may not get a complete Android experience but only the ability to run Android apps.
You just have to unpack the runtime and load it into Chrome extensions. Next, add the app you want to use by downloading the APK file onto it.
[ARChon][10]
### 6\. Bliss OS
![][11]
Bliss OS is yet another open-source project, similar to Android x86 that aims to make Android run on PC.
Unlike Android x86, it gives more compatibility options by supporting both 32-bit and 64-bit architectures. Also, you can download the compatible file as per your processor.
It is actively maintained and supports the latest Android versions available in the market.
[Bliss OS][12]
### Wrapping Up
While you will find several Android emulators available for Linux, they may not replace a full-fledged smartphone experience.
Every emulator comes with a set of features along with a specific purpose. Choose the one that you need!
Have you tried Android emulators yet? Whats your favorite emulator that you have used in Linux? Feel free to let me know in the comments down below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/android-emulators-linux/
作者:[Ankush Das][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://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://anbox.io
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/genymotion-android-emulator.png?resize=800%2C508&ssl=1
[3]: https://www.genymotion.com
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/android-x86-emulator.jpg?resize=1920%2C1080&ssl=1
[5]: https://www.android-x86.org/installhowto.html
[6]: https://www.android-x86.org
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/android-virtual-devices-studio.png?resize=800%2C296&ssl=1
[8]: https://developer.android.com/studio
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/arcrhon.jpg?resize=800%2C426&ssl=1
[10]: https://archon-runtime.github.io
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/bliss-os-android.png?resize=800%2C576&ssl=1
[12]: https://blissos.org

View File

@ -1,73 +0,0 @@
What's the difference between a fork and a distribution?
分支与发行版有什么不同?
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/spoons_forks_520x292_jh.png?itok=DzEzZBuG)
如果你们对开源软件有过一段时间地了解,一定曾在许多相关的途径中听说过分支(fork)和发行版(distribution)两个词。许多人对这两个词的区别不太清楚,因此我将试着通过这篇文章为大家解答这一疑惑。
### 首先地,关于定义
在解释分支与发行版两者的细微区别与相似之处之前,让我们先给一些相关的重要概念下定义。
**[开源软件][1]** 是指具有以下特点的软件:
* 在特定的 [协议][2] 限制下,软件供所有人免费传播与使用
* 在特定的协议限制下,软件源代码供所有人使用与修改
开源软件有以下几种 **消费** 方式:
* 以二进制或者源代码的方式下载,通常是不收费的。(例如,[Eclipse开发者环境][3]
* 作为一个商业公司的产品,有时向用户提供一些服务并以此收费。(例如,[红帽产品][4]
* 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的[Freetype软件][5]
**自由且开源(FOSS)** 中的”自由“理解成“零成本”是不准确的。自由且开源仅仅意味着这个软件在遵守软件协议的前提下是可以免费传播、修改、学习和使用的。软件传播者也可能为该软件定价。例如免费使用的Linux发行版有Fedora、Centos等。另外收费的发行版有红帽企业版Linux、SUSE等。
**社区(community)** 指的是为一个开源项目协同工作和贡献的团体或个人。任何人或者团体都可以在遵守协议的前提下通过例如编写或者审查代码、撰写使用文档、测试软件、管理会议、更新网站等方式为开源项目作出贡献。例如,在[Openhub.net][6]网站,我们可以看见政府、非营利性机构、商业公司和教育团队等组织都在[为一些开源项目作出贡献][7]。
**项目(project)** 是集合作开发、文档和测试的结果。绝大多数项目都搭建了主要仓库用来存储代码、文档、测试文件和目前正在开发的文件。
**发行版(distribution)** 是指开源项目的一份的副本通常以二进制或源代码为样式。例如Centos、Fedora、红帽企业版Linux、SUSE、Ubuntu等都是Linux这一项目的发行版。Tectonic、谷歌的Kubernetes引擎、亚马逊的容器服务和红帽的OpenShift都是Kubernetes项目的发行版。
开源项目的商业发行版经常被称作 **产品(products)** 类似地红帽OpenStack平台是红帽OpenStack产品系列旗下的一个基于OpenStack上游项目搭建并且百分百开源的发行版。
**主干(trunk)** 是该开源项目发展的主要社区工作流。
**分支(fork)** 是开源项目主干的一个版本,他是分离自主干的独立工作流。
因此, **一个发行版并不等同于一个分支** 。发行版是上游项目的包裹,具有可用性,经常作为产品进行销售。然而,发行版的核心代码和文档需要遵守上游项目的版本规则。从上游版本中获取开源代码的分支用户必须依靠他们自身来维护分支项目,这意味着他们失去了上游社区协同工作带来的好处。
为了对软件分支进行进一步的解释,让我来用动物迁徙作比喻。鲸鱼和海狮从北极迁徙到加利福尼亚和墨西哥;帝王蝶从阿拉斯加迁徙到墨西哥;并且北半球的燕子和许多其他鸟类飞翔南方去过冬。成功迁徙的关键因素在于,团队中的所有动物团结一致,紧跟领导者,找到食物和庇护所,并且不会迷路。
### 独立前行带来的风险
一只鸟、帝王蝶或者鲸鱼一旦掉队就失去了许多优势,例如团队带来的保护以及知道哪儿有食物、庇护所和目的地。
相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险:
1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。
2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益。
3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。
4. **他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。
5. **他们可能不能够在硬件平台上验证分支代码可行性。** 软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。
总之,开源发行版只是一个由上游组织协同开发、并且提供商业服务与支持的包裹。分支是开源项目的独立发展工作流,并且不能从上游社区协同工作开发的结果中收益。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/7/forks-vs-distributions
作者:[Jonathan Gershater][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[Wlzzzz-del](https://github.com/Wlzzzz-del)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/jgershat
[1]:https://opensource.com/resources/what-open-source
[2]:https://opensource.com/tags/licensing
[3]:https://www.eclipse.org/che/getting-started/download/
[4]:https://access.redhat.com/downloads
[5]:https://www.freetype.org/
[6]:http://openhub.net
[7]:https://www.openhub.net/explore/orgs