mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
commit
c7fa6e42b0
@ -1,82 +0,0 @@
|
||||
Wlzzzz-del is translating.
|
||||
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)
|
||||
|
||||
If you've been around open source software for any length of time, you'll hear the terms fork and distribution thrown around casually in conversation. For many people, the distinction between the two isn't clear, so here I'll try to clear up the confusion.
|
||||
|
||||
### First, some definitions
|
||||
|
||||
Before explaining the nuances of a fork vs. a distribution and the pitfalls thereof, let's define key concepts.
|
||||
|
||||
**[Open source software][1]** is software that:
|
||||
|
||||
* Is freely available to distribute under certain [license][2] restraints
|
||||
* Permits its source code to be viewable and modified under certain license restraints
|
||||
|
||||
|
||||
|
||||
Open source software can be **consumed** in the following ways:
|
||||
|
||||
* Downloaded in binary or source code format, often at no charge (e.g., the [Eclipse developer environment][3])
|
||||
* As a distribution (product) by a vendor, sometimes at a cost to the user (e.g., [Red Hat products][4])
|
||||
* Embedded into proprietary software solutions (e.g., some smartphones and browsers display fonts using the open source [freetype software][5])
|
||||
|
||||
|
||||
|
||||
**Free and open source (FOSS)** is not necessarily "free" as in "zero cost." Free and open source simply means the software is free to distribute, modify, study, and use, subject to the software's licensing. The software distributor may attach a purchase price to it. For example, Linux is available at no cost as Fedora, CentOS, Gentoo, etc. or as a paid distribution as Red Hat Enterprise Linux, SUSE, etc.
|
||||
|
||||
**Community** refers to the organizations and individuals that collaboratively work on an open source project. Any individual or organization can contribute to the project by writing or reviewing code, documentation, test suites, managing meetings, updating websites, etc., provided they abide by the license. For example, at [Openhub.net][6], we see government, nonprofit, commercial, and education organizations [contributing to some open source projects][7].
|
||||
|
||||
**project** is the result of this collaborative development, documentation, and testing. Most projects have a central repository where code, documentation, testing, and so forth are developed.
|
||||
|
||||
An open sourceis the result of this collaborative development, documentation, and testing. Most projects have a central repository where code, documentation, testing, and so forth are developed.
|
||||
|
||||
A **distribution** is a copy, in binary or source code format, of an open source project. For example, CentOS, Fedora, Red Hat Enterprise Linux, SUSE, Ubuntu, and others are distributions of the Linux project. Tectonic, Google Kubernetes Engine, Amazon Container Service, and Red Hat OpenShift are distributions of the Kubernetes project.
|
||||
|
||||
Vendor distributions of open source projects are often called **products** , thus Red Hat OpenStack Platform is the Red Hat OpenStack product that is a distribution of the OpenStack upstream project—and it is still 100% open source.
|
||||
|
||||
The **trunk** is the main workstream in the community where the open source project is developed.
|
||||
|
||||
An open source **fork** is a version of the open source project that is developed along a separate workstream from the main trunk.
|
||||
|
||||
Thus, **a distribution is not the same as a fork**. A distribution is a packaging of the upstream project that is made available by vendors, often as products. However, the core code and documentation in the distribution adhere to the version in the upstream project. A fork—and any distribution based on the fork—results in a version of the code and documentation that are different from the upstream project. Users who have forked upstream open source code have to maintain it on their own, meaning they lose the benefit of the collaboration that takes place in the upstream community.
|
||||
|
||||
To further explain a software fork, let's use the analogy of migrating animals. Whales and sea lions migrate from the Arctic to California and Mexico; Monarch butterflies migrate from Alaska to Mexico; and (in the Northern Hemisphere) swallows and many other birds fly south for the winter. The key to a successful migration is that all animals in the group stick together, follow the leaders, find food and shelter, and don't get lost.
|
||||
|
||||
### Risks of going it on your own
|
||||
|
||||
A bird, butterfly, or whale that strays from the group loses the benefit of remaining with the group and knowing where to find food, shelter, and the desired destination.
|
||||
|
||||
Similarly, users or organizations that fork and modify an upstream project and maintain it on their own run the following risks:
|
||||
|
||||
1. **They cannot update their code based on the upstream because their code differs.** This is known as technical debt; the more changes made to forked code, the more it costs in time and money to rebase the fork to the upstream project.
|
||||
2. **They potentially run less secure code.** If a vulnerability is found in open source code and fixed by the community in the upstream, a forked version of the code may not benefit from this fix because it is different from the upstream.
|
||||
3. **They might not benefit from new features.** The upstream community, using input from many organizations and individuals, creates new features for the benefit of all users of the upstream project. If an organization forks the upstream, they potentially cannot incorporate the new features because their code differs.
|
||||
4. **They might not integrate with other software packages.** Open source projects are rarely developed as single entities; rather they often are packaged together with other projects to create a solution. Forked code may not be able to be integrated with other projects because the developers of the forked code are not collaborating in the upstream with other participants.
|
||||
5. **They might not certify on hardware platforms.** Software packages are often certified to run on hardware platforms so, if problems arise, the hardware and software vendors can collaborate to find the root cause or problem.
|
||||
|
||||
|
||||
|
||||
In summary, an open source distribution is simply a packaging of an upstream, multi-organizational, collaborative open source project sold and supported by a vendor. A fork is a separate development workstream of an open source project and risks not being able to benefit from the collaborative efforts of the upstream community.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/7/forks-vs-distributions
|
||||
|
||||
作者:[Jonathan Gershater][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者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/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
|
@ -0,0 +1,73 @@
|
||||
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
|
Loading…
Reference in New Issue
Block a user