上一篇: http://r40eubuntu.blogspot.tw/2011/03/python-check-git-no-git-folder.html
在更新過 python 版本後,好像沒辦法在 for loop 中更改 loop list 內容。
所以要改一下,
所以檢查 android source 與 repo, git 是否完整的 python script 就是:
他會先找出是否有哪個folder 還沒有 git 管轄
然後從 manifest.xml 找出所有的 project path。
檢查是不是所有 git folder 都有在 manifest.xml 中
檢查是不是所有 manifest.xml 的 project 都實際存在。
放在: https://github.com/checko/python_repo
ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上
2015年8月18日 星期二
python : 找出沒有在 git control 下的 folder
因為 vendor 給的 android source 沒有包含 git, repo 資訊,
所以只好採用 .. repo sync 一個相近的 source, 覆蓋後 commit
所以覆蓋後,要檢查是不是有沒被 versio control 的 folder:
用 python 寫:
所以就用修改 dirlist 的方式來作:
但是這個結果會把所有沒有 git control 的 folder, subfolder 都印出來,(因為他沒辦法判斷要從哪裡算起,是一個 project)
這部份要自己作。
這個動態刪除 dirlist 的作法在更換 python 版本的時候出了問題。
原來是在判斷包含 .git 後直接作 dirlist.remove(ss)
但是卻發現這樣會影像到下一個 ss (in dirlist) 的判斷。
所以只好先放在 toremove[] 中,最後再一次修改全部
放在: https://github.com/checko/python_repo
所以只好採用 .. repo sync 一個相近的 source, 覆蓋後 commit
所以覆蓋後,要檢查是不是有沒被 versio control 的 folder:
用 python 寫:
import os
i=0
for root, dirlist, filelist in os.walk("./"):
toremove=[]
for ss in ['.repo','out']:
if ss in dirlist:
toremove.append(ss)
for ss in dirlist:
gpath = os.path.join(root,ss,'.git')
if os.path.isdir(gpath):
toremove.append(ss)
for ss in toremove:
dirlist.remove(ss)
if (len(dirlist)==0) and (len(toremove)==0):
print i, root
i=i+1
因為 os.walk 會依照top down 的方式,到 dirlist 中搜尋。所以就用修改 dirlist 的方式來作:
- 先排除 .repo, out 目錄
- 排除含有 .git 的次目錄
但是這個結果會把所有沒有 git control 的 folder, subfolder 都印出來,(因為他沒辦法判斷要從哪裡算起,是一個 project)
這部份要自己作。
這個動態刪除 dirlist 的作法在更換 python 版本的時候出了問題。
原來是在判斷包含 .git 後直接作 dirlist.remove(ss)
但是卻發現這樣會影像到下一個 ss (in dirlist) 的判斷。
所以只好先放在 toremove[] 中,最後再一次修改全部
放在: https://github.com/checko/python_repo
github 終於可以動了
github 可以動了。
這一篇 http://help.github.com/troubleshooting-ssh/ 有 ssh 的 trouble shooting.
github 可以為每一個 repo 建立一個 homepage,follow instruction。
http://pages.github.com/#project_page_generator
要注意的是,這個 default 的 homepage 產生需要時間,所以按下 button 後馬上去看會是 404 page。
要等大約 3 min (說明是說 10 min)才會出現。
ref:
用 https ,不用 ssh
如果有一些公司的mis 不願意開 ssh port,github 也有提供另一種 access 的方法:
需要 1.6.6 以上的 git (git --version 會顯示,ubuntu 10.10 的版本是 1.7)。
command:
project : 你的 repository 名稱。
這個新版的 git 會 prompt 要你輸入 password。你就要輸入 你在 github 的 password。
ref: https://github.com/blog/642-smart-http-support
另外,在 proxy 後面,clone OK, push fail:
修改該 repo 的 .git/config, 加上紅色部份...
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://checko@github.com/checko/mdnsreponder_gingerbread.git
ref: https://github.com/markkolich/blog/blob/master/content/entries/pushing-to-an-http-git-remote-ref-on-ubuntu-1004-lts-with-git-1704-403-inforefs.md
git config 修改 remote:
git config 命令可以修改 config 檔。
cat config 出來看一下:
根據每一個機器.account,要 copy account 的 dsa /rsa pub key 到 github 中。
然後就可以把 github 當 git server 用了。
create new project/repository 可以用 github 的介面完成。
這一篇 http://help.github.com/troubleshooting-ssh/ 有 ssh 的 trouble shooting.
github 可以為每一個 repo 建立一個 homepage,follow instruction。
http://pages.github.com/#project_page_generator
要注意的是,這個 default 的 homepage 產生需要時間,所以按下 button 後馬上去看會是 404 page。
要等大約 3 min (說明是說 10 min)才會出現。
ref:
用 https ,不用 ssh
如果有一些公司的mis 不願意開 ssh port,github 也有提供另一種 access 的方法:
需要 1.6.6 以上的 git (git --version 會顯示,ubuntu 10.10 的版本是 1.7)。
command:
$ git clone https://username@github.com/username/project.git
username : 你在 github 使用的 username。project : 你的 repository 名稱。
這個新版的 git 會 prompt 要你輸入 password。你就要輸入 你在 github 的 password。
ref: https://github.com/blog/642-smart-http-support
另外,在 proxy 後面,clone OK, push fail:
$ git push error: The requested URL returned error: 403 while accessing https://github.com/checko/mdnsreponder_gingerbread.git/info/refs fatal: HTTP request failed可以參考這篇:http://blog.csdn.net/happyteafriends/article/details/11554043
修改該 repo 的 .git/config, 加上紅色部份...
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://checko@github.com/checko/mdnsreponder_gingerbread.git
ref: https://github.com/markkolich/blog/blob/master/content/entries/pushing-to-an-http-git-remote-ref-on-ubuntu-1004-lts-with-git-1704-403-inforefs.md
git config 修改 remote:
git config 命令可以修改 config 檔。
cat config 出來看一下:
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = https://checko@github.com/checko/python_repo.git [branch "master"] remote = origin merge = refs/heads/master修改 remote origin 的 url 就用:
$ git config remote.origin.url https://checko@github.com/checko/python_repo.git就可以了。
2015年8月17日 星期一
加上 --mirror
沒加 --mirror 的話。
GIT_DIR 會在 .repo/project-objects/platform/external/openssl.git
然後動做一樣。
最後的 checkout,在 --trace 中看不到一些動作。
所以要配盒source code 來看。
project.py:
copy .git 的內容。
export GIT_DIR=~/openssl.git git init git config --file ~/openssl.git/config --replace-all remote.aosp.url git://robot/android5.0.2r1/platform/external/openssl git config --file ~/openssl.git/config --replace-all remote.aosp.projname platform/external/openssl git config --file ~/openssl.git/config --replace-all remote.aosp.fetch +refs/heads/*:refs/heads/* git fetch --update-head-ok aosp --tags +refs/heads/*:refs/heads/* git pack-refs --all --prune git symbolic-ref -m 'manifest set tp refs/tags/android-5.0.2_r1' HEAD refs/tags/android-5.0.2_r1 git -c pack.thread=1 gc --auto
沒加 --mirror 的話。
GIT_DIR 會在 .repo/project-objects/platform/external/openssl.git
然後動做一樣。
最後的 checkout,在 --trace 中看不到一些動作。
所以要配盒source code 來看。
project.py:
def _InitWorkTree(self):
dotgit = os.path.join(self.worktree,'.git')
if not os.path.exist(gotgit):
os.makedirs(dotgit)
self._ReferenceGitDir(self.gitdir, dotgit, share_ref=True, copy_all=False)
_lwrite(os.path.join(dotgit, HEAD). '%s\n" % self.GetRevisionId())
cmd = ['read-tree', '--reset', '-u']
cmd.append('-v')
cmd.append(HEAD)
if GitCommand(self,cmd),Wait() != 0
raise GitError("cannot initialize work Tree")
self._CopyAndLinkFiles()
裡面的東西,幾忽就是 git 在做的事...copy .git 的內容。
2015年8月14日 星期五
2015年8月12日 星期三
Android Studio v1.3 -- gradle.properties
升級玩出現:
結果sync 一樣fail, 說 gradle 找不到 route
打開 gradle.properties 來看,多了:
改成:
Starting with version 1.3, Android Studio no longer Support IDE-specific Gradle JVM arguments. Android Studio will remove any stored Grandle JVM arguments.我的是..
Would you like to copy these JVM arguments: -Dhttp.proxyHost=192.168.147.123 -Dhttp.proxyPort=3128 to the project's gradle.properties file?選 Yes.
結果sync 一樣fail, 說 gradle 找不到 route
打開 gradle.properties 來看,多了:
org.gradle.jvmargs=-Dhttp.proxyHost\=192.168.147.123 -Dhttp.proxyPort\=3128ref: https://docs.gradle.org/current/userguide/build_environment.html#N11961
改成:
systemProp.http.proxyHost=192.168.147.123 systemProp.http.proxyPort=3128 systemProp.https.proxyHost=192.168.147.123 systemProp.https.proxyPort=3128就 OK了。
2015年8月3日 星期一
Old version Chrome.
因為某次更新後,chrome 內輸入中文都會出現最後一個字輸出兩次的情況,所以想安裝舊版本。
link 在: http://www.filehippo.com/download_google_chrome/history
現在 46.0.2467.2-1 沒問題。
link 在: http://www.filehippo.com/download_google_chrome/history
現在 46.0.2467.2-1 沒問題。
標籤
- 3g (19)
- 工作的備worklog (93)
- 自言自語 (36)
- 草稿 (1)
- 亂亂寫 (8)
- 翻譯 (3)
- administration (76)
- alsa (7)
- android (299)
- apple (5)
- application (42)
- archlinux (1)
- audio (3)
- avr (6)
- backup_restore (2)
- bluetooth (5)
- bookmark (38)
- bootloader (21)
- browser (5)
- cellphone (28)
- command (8)
- Configuration (27)
- debug (7)
- django (1)
- driver (15)
- earphone (1)
- editor (1)
- EFL (1)
- ffmpeg (18)
- Filesystem (4)
- GCC (8)
- Gentoo (1)
- google (1)
- Graphic (3)
- hardware (40)
- hero (7)
- hibernation (9)
- iMX51 (38)
- Info (3)
- Install (30)
- java (4)
- Kernel (102)
- language (2)
- life (2)
- make (11)
- MantainLog (38)
- MCU_P (9)
- memo (8)
- microcontroller (3)
- MINGW (7)
- network (19)
- OpenCL (1)
- OS (11)
- package (3)
- pad (1)
- ProblemAndSolve (15)
- programming (8)
- Python (7)
- raspberry_pi (23)
- SDL (2)
- sensation (13)
- setup (3)
- software_package (36)
- SQL (1)
- suspend (2)
- ToDo (5)
- tool (3)
- ubuntu (1)
- VersionControl (45)
- Virtualization (15)
- VLC (5)
- wheezy (1)
- wifi (3)
- Windows (16)
- xiaomi (1)
- xperia (1)