2012-02-26 33 views
0

在建設,我們使用的是Debian/mypackagename.install文件告訴debhelper的包裝工具,其中複製文件和文件夾的Debian軟件包。刪除.svn文件,同時建立Debian軟件包

的問題是,文件夾包含被複制到包樹終於進入到目標機器的.svn文件夾!有沒有一種標準的方式來建立包時排除.svn文件夾?

+2

我不知道Debian和包裝,但你可以使用svn出口導出的工作拷貝(不包括的.svn文件),然後打包導出的目錄。 – 2012-02-26 07:37:45

+0

謝謝,你是對的,使用svn export是我忘記的標準方式。 – amin 2012-02-26 07:52:11

+0

或者,你可以創建一個bash腳本從項目文件夾和子文件夾中刪除所有.svn目錄。與你的源代碼構建名爲.tar.gz當 – ecle 2012-02-26 07:52:27

回答

2

我不知道你的編譯系統中看起來的樣子,但要排除的.svn(CVS,git的,等等),你可以使用-X選項dh_install細節:在

$ dh_install -X .svn 

或出口DH_ALWAYS_EXCLUDE變量debian/rules文件:

$ cat debian/rules 
#!/usr/bin/make -f 
# -*- makefile -*- 
# Sample debian/rules that uses debhelper. 
# This file was originally written by Joey Hess and Craig Small. 
# As a special exception, when this file is copied by dh-make into a 
# dh-make output file, you may use that output file without restriction. 
# This special exception was added by Craig Small in version 0.37 of dh-make. 

# Uncomment this to turn on verbose mode. 
# export DH_VERBOSE=1 

export DH_ALWAYS_EXCLUDE=CVS:.svn 

%: 
    dh [email protected] 
+2

另外'$ debuild -I'會忽略VCS目錄。這個'-I'選項在man中沒有提到,但是你可以在debuild的源頭找到它。 – 2012-02-26 11:05:17

1

由於@JB_Nizet正確寫下您可以使用svn export獲得目錄,而所有的.svn目錄。如果你不能使用導出,可以使用find -name .svn -and -type d -exec rm -rf {} +刪除所有.svn目錄目錄中的遞歸。