2012-06-22 38 views
2

我在Powerhell腳本中有一個函數,它應該解開我的CppUnit.tar.bz2文件。我已經安裝了7-ZIP,並在我的功能我有以下幾點:在Windows命令行上使用7-zip的Untar * .tar.bz2

Function untar ($targetFile) {   
     $z ="7z.exe" 

     $defaultDestinationFolder = 'C:\Program Files\' 
     $destinationFolder = (Get-Item $defaultDesitantionFolder).fullname 

     $tarbz2Source = $targetFile 
     & "$z" x -y $tarbz2Source 

     $tarSource = (get-item $targetFile).basename 
     & "$z" x -y $tarSource -o $destinationFolder 

     Remove-Item $tarSource 
} 

運行此提取所有,我想他們的文件,但所有文件獲得「V」作爲自己的結局:

... 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\estring.h,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TestSuite.h,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\Test.h,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TestCase.h,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TextTestResult.h,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\Makefile.am,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TestSuite.cpp,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\Exception.cpp,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\cppunit.dsw,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TestFailure.h,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TestCaller.h,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TestResult.h,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TextTestResult.cpp,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TestRegistry.h,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TestFailure.cpp,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\Exception.h,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TestRegistry.cpp,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\cppunit.dsp,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TestResult.cpp,v 
Extracting cppunit-cvs-repo-archive\cppunit\cppunit\Attic\TestCase.cpp,v 

Everything is Ok 

Folders: 149 
Files: 1128 
Size:  20671974 
Compressed: 21626880 

誰能告訴我怎麼解決這個問題?

回答

4

,v後綴表示,這些都不是由CVS維護的文件本身,但版本的歷史文件 - 每個,v文件不僅包含了最新版本的文件,但增量來重建文件的任何以前的版本。他們都在Attic子目錄中的事實表明它們在某個時間點通過cvs remove全部被刪除。這些以及基本目錄爲cppunit-cvs-repo-archive的事實表明,您需要將解壓後的存檔作爲CVS存儲庫處理,並使用適當的工具來檢出要使用的文件,而不僅僅是「修復」看起來像錯誤名稱的文件。 ..

+0

啊哈,謝謝。這確實是解決方案! –

+0

下載正確的cppunit軟件包,運行該功能,它都很好。 :) –