![](/img/trans.png)
[英]Mercurial and Hudson on web hosting. Can I install Mercurial
[英]Can I install Mercurial in my home directory?
我想在沒有root
訪問權限的Linux系統上安裝Mercurial。
我怎樣才能這樣做,以便我可以輕松卸載Mercurial並在新版本發布時升級它?
另外,我是否可以獲得不需要管理員權限才能安裝Windows的軟件包?
在您的主目錄中編譯和安裝Mercurial非常容易,我自己也這樣做了。
如果您有疑問,這個鏈接的wiki-post肯定會提供一些幫助;
使用make install-home
將hg
安裝到你的主目錄,它會將二進制文件放在〜/ bin和〜/ lib中的關聯文件中。
卸載或升級到新版本時,您可以刪除makefile放入的文件,或者讓make install-home
(如果升級)覆蓋現有文件。
確保在安裝后更新$PATH
,使其包含~/bin
。
點擊下面的鏈接,您將進入Mercurial的下載部分。 在那里,您將能夠找到不需要管理權限的Windows安裝包。
我知道這個問題已經得到解答,但有人可能處於我的狀態,那就是必須在沒有C編譯器和make的情況下安裝。
可以在以下鏈接中找到解決方案的完整說明。
命令列表,不使用make
wget http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg
mkdir -p ~/software/lib/python2.5/site-packages
export PYTHONPATH=~/software/lib/python2.5/site-packages
sh setuptools-0.6c11-py2.5.egg --prefix=~/software
export PATH=${PATH}:~/software/bin
easy_install --prefix=~/software docutils
cd ~/software
wget https://www.mercurial-scm.org/release/mercurial-2.5.2.tar.gz
tar xzvf mercurial-2.5.2.tar.gz
cd mercurial-2.5.2.tar.gz
python setup.py --pure install --home="~/software" --force
cd ~/software/lib/python
mv hgext/ ../python2.5/site-packages/
mv mercurial ../python2.5/site-packages/
mv mercurial-2.5.2.egg-info ../python2.5/site-packages/
將以下行附加到.bashrc
:
export PYTHONPATH=~/software/lib/python2.5/site-packages
export PATH=${PATH}:~/software/bin
校驗:
~$ hg
Mercurial Distributed SCM
etc...
Mercurial源附帶一個具有local
目標的Makefile
。 如果你運行它,那么你將就地構建C擴展:
$ make local
... (lots of output) ...
python hg version
Mercurial Distributed SCM (version 5b66e55c0d93+20111216)
(see https://www.mercurial-scm.org for more information)
Copyright (C) 2005-2011 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
您將需要Python頭文件,它們通常位於python-dev
包中。 然后,您可以將hg
腳本符號鏈接到PATH
的目錄中。 我用~/bin
代表:
$ cd ~/bin
$ ln -s ../src/mercurial/hg
您現在可以從任何目錄運行hg
。
如果要卸載Mercurial,就像刪除編譯所在的目錄一樣簡單。 升級也很簡單:在目錄中解壓縮新版本並再次運行make local
。 您還可以使用新安裝的Mercurial來克隆Mercurial存儲庫本身:
$ hg clone https://www.mercurial-scm.org/repo/hg
$ cd hg
$ make local
這為您提供了default
分支中的Mercurial版本。 如果您希望從stable
分支進行構建,請在編譯之前使用hg update stable
。 該分支僅更新錯誤修正。
在該平台上,您可以使用Inno設置安裝程序 。 他們不需要管理員權限。 如果您願意,可以將它與便攜版TortoiseHg結合使用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.