如何在 Debian 软件包的脚本中引用已安装的文件?
我希望将一些 R 脚本和数据打包到 Debian 包中。
让我们将脚本称为 script-1.R、script-2.R 和 script-main.R
数据称为 mydata.csv。
目前我的文件夹结构是:
SRC/script-1.R
SRC/script-2.R
SRC/script-main.R
DATA/mydata.csv
script-main.R指的是script-1.R、script-2.R和mydata.csv。
我的 debian/install 文件将类似于:
/SRC/script-1.R /usr/bin
/SRC/script-2.R /usr/bin
/SRC/script-main.R /usr/bin
/DOC/mydata.csv /usr/bin
我的查询是: 如何从 script-main.R 引用 script-1.R 和 script-2.R 以及 mydata.csv 以便我可以运行我的包 打包之前和安装包之后?
另外,Debian Linux 文件系统层次结构标准中 script-1.R、script-2.R 和 mydata.csv 的正确文件夹应该是什么?
正确的数据目录可能应该是: /usr/share/
我在第 28 页读到此内容: 此文档
我在 此链接。
作者模仿了 /usr/bin 和 /usr/share/
我现在有一个类似但不同的查询。包的 bash 完成脚本存储在 debian 文件夹中。如何引用 /usr/share/
I wish to package some R scripts and data in a Debian package.
Lets call the scripts as script-1.R, script-2.R and script-main.R
The data is called mydata.csv.
Currently my folder structure is:
SRC/script-1.R
SRC/script-2.R
SRC/script-main.R
DATA/mydata.csv
script-main.R refers to script-1.R, script-2.R and mydata.csv.
My debian/install file will be something like:
/SRC/script-1.R /usr/bin
/SRC/script-2.R /usr/bin
/SRC/script-main.R /usr/bin
/DOC/mydata.csv /usr/bin
My query is: How do I refer to script-1.R and script-2.R and mydata.csv from script-main.R so that I can run my package both prior to packaging and after installing the package?
Also what should be the right folder for the script-1.R, script-2.R and mydata.csv in a Debian Linux Filesystem Heirarchy Standard?
The right directory for data should perhaps be: /usr/share/<package-name>/
I read this in Page 28 of : this document
I found my answer on this link.
The author mimics the /usr/bin and /usr/share/<package-name> directories in the debian package. I guess we have to follow this convention and not create folders like SRC or DATA which are not a part of the linux FHS.
I have a similar but different query now. The bash completion script for a package is stored in the debian folder. How can I refer to a txt file in the /usr/share/<package-name> folder from the bash completion script? I could hard code the /usr/share/<package-name>/database-for-bash-completion.txt in the bash completion script, but is there not a better way which will work for both prior and after packaging?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论