使用git通过自动工具进行分发 [英] Using git for distribution with autotools

查看:196
本文介绍了使用git通过自动工具进行分发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究这个主题有一段时间了,我想我知道我所需要的所有信息:我应该将我的自动工具生成的文件放到我的仓库中吗?".我同意每个人的意见,每个人都说您不应该这样做,只需要输入wat即可生成它们.

我认为这是用于开发目的的正确方法,我编写了一个框架,该框架使用git进行版本控制(在develop分支中),并使用master分支来分发代码.我的问题是,是否有一种简单的方法来将git包含在autotools的dist包中的文件包含在git中?这个想法是,每个克隆存储库的用户都可以执行通常的./configure && make && make install过程,而不必担心autogen或东西.鉴于框架的性质,发送tar文件等有点麻烦,并且用户可以更轻松地克隆存储库以使用它. 也许在git或某些标准gitignore文件中有一些选项,或者可以做到这一点.

非常感谢!

解决方案

许多人坚持认为不应检入自动工具生成的文件.但是,随着git变得无处不在,我看不到这样做的危害,如果您使用最新的稳定自动工具来生成文件.实际上,我建议您包括它们:

正如您所指出的,这使某人可以简单地检出项目并对其进行配置-否则,您需要为不了解自动工具的人提供.tar[.bz2]快照...也不应该提供.自动工具的整个想法使开发人员有责任最小化最终用户的需求和努力.

例如,在命令行上使用./configure ...make [install]传递shell变量就足够了.

如果某人确实想要重建生成的文件,则应确保使用autoreconf -fvi之类的东西就足够了.如果需要更复杂的步骤,请提供autogen.sh脚本.任何执行此步骤的人都必须安装自动工具,并且大概对它们的工作方式有更好的了解-例如,维护者模式"熟练程度.

I have been looking about this subject for a while and I think I know all I need about "should I put my autotools generated files in my repo?". I agree with everyone who says that you should not and include just wat is needed to generate them.

Althought I think this is the right approach for development purposes I write a framework which uses git for version control (in the develop branches) and uses the master branch to distribute the code. My question is, is there an easy way to include in git the same files that will be included in the dist package by autotools?. The idea is that every user who clone the repo can just do the usual ./configure && make && make install procedure and not worry about autogen or stuff. Given the nature of the framework it is a little cumbersome to send tar files and so on and easier for users to clone the repo to use it. Maybe there is some options in git or some standard gitignore file or something to do this.

Thanks a lot!

解决方案

Many will insist that the autotools generated files should not be checked in. However, with git becoming so ubiquitous, I don't see the harm in doing so, provided you use the latest stable autotools to generate the files. In fact, I suggest you include them:

As you point out, this allows someone to simply checkout the project and configure it - otherwise, you need to provide .tar[.bz2] snapshots for people who don't understand the autotools... and nor should they. The whole idea of the autotools is putting the burden on the developer to minimise the requirements and efforts of the end user.

e.g., passing shell variables on the command line with ./configure ... and make [install] should be sufficient.

If someone really wants to rebuild the generated files, you should ensure that something like autoreconf -fvi is sufficient. If more complex steps are required, provide an autogen.sh script. Anyone performing this step must have the autotools installed, and presumably has a better understanding of how they work - e.g., a 'maintainer-mode' proficiency.

这篇关于使用git通过自动工具进行分发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆