Download Specific Android Source Code - download

I would just like to know how to download specific version of Android Source Code. I have already tried the following command
repo init -u https://android.googlesource.com/platform/manifest
repo sync
and I was able to download gingerbread 2.3.4. However, I would also like to download 2.3.3. Is there anyone who can tell me the proper command? Is there also a way to the download the source code without version files because I have no plans of changing the source code and uploading?

You could download the source from http://grepcode.com/snapshot/repository.grepcode.com/java/ext/com.google.android/android/2.3.4_r1
Other versions are also available. You could search them in this site.

I was able to download 2.3.3 by using the these commands:
repo init -u git://android.git.kernel.org/platform/manifest.git -b android-2.3.3_r1
repo sync
Thanks for your help.

Although this question has been answered, none of the answers work for me. It took me a while to figure this out, so I thought I would share the answer as it may save someone some pain.
To download the source code go to the github mirror, you can download a ZIP (see the left of the screenshot the "Download ZIP" button) and select the tag of the version you want. See this screen shot.

There is not the android-2.3.4_r1 tag in https://android.googlesource.com/platform/manifest repository.
For example, https://android.googlesource.com/platform/dalvik repository has the android-2.3.4_r1 tag. You are able to see that tag on https://android.googlesource.com/platform/dalvik/+refs.
To sum up, the android-2.3.4_r1 tag is tagged in a part of android repositories.
If you check the android-2.3.4_r1 tagging source code on dalvik, try this commands as below.
repo init -u https://android.googlesource.com/platform/manifest
repo sync
cd dalvik
git checkout android-2.3.4_r1

Related

"the Package.resolved file is most likely severely out-of-date and is preventing correct resolution"

I'm getting the following error when trying to build. It shows up as the only item in the build log, too.
Here are the packages I'm using:
For me, it turned out that, even though Xcode was able to resolve and clone these packages, it didn't like that 2 of them pointed to the GitHub repo page, rather than the git file version.
Changing them so they're all .git URLs fixed it:

Issues with 'go build' on forked repository

I build a binary file for a GitHub repo (go code), which works fine. no issues.
I forked that repo, and modified a single line in the HTML file that has nothing to do with GO code, built the binary file for the new forked repo but the binary it generates refers to the original repo code, can't understand why.
I even cleaned all the code using go clean -i all command and manually removed all the installed code, binary files from $home/go/bin and the repo directory, but it still refers to the original repo code instead of new forked code.
Based on the solution suggested by Tobias, I performed the following steps:
After that, I executed go build in that repo directory, but the new binary file still refers to the old code. I even removed the old binary file and generated a new one.
That's a common problem in go. The references system in "location based" so it searches for these files in the "correct" path. Idk if go modules fix this issue, but atleast when not using go modules you'll have to work around it.
You can solve it by
Solution 1
Download the original repository you forked by:
go get http://github.com/awesome-org/tool
Add your fork as remote
git remote add awesome-you-fork http://github.com/awesome-you/tool
You'll have to make changes in the folder of the original downloaded repo and Push and Pull to/from your fork.
git pull --rebase awesome-you-fork
git push awesome-you-fork
Solution 2
Work around go get:
You create the path the original repo would have, but clone your own fork into it. That way you can push & pull to your fork. That may be the better solution
cd $GOPATH
mkdir -p {src,bin,pkg}
mkdir -p src/github.com/awesome-org/
cd src/github.com/awesome-org/
git clone git#github.com:awesome-you/tool.git # OR: git clone https://github.com/awesome-you/tool.git
cd tool/
go get ./...
These Solutions were found here: http://code.openark.org/blog/development/forking-golang-repositories-on-github-and-managing-the-import-path
The problem with a forked copy of a go packages is when the package is really multiple go packages in one repo, the import statements refer to original base repo, ie: github.com/orig/repo.
This is not an issue for repos with only one go package as it never refers to itself.
But if it has multiple, ie: package github.com/orig/repo/A imports github.com/orig/repo/B
And then you fork it as: github.com/fork/repo
Then when the go compiler sees import "github.com/orig/repo/B" in the source, it goes to download the original version and not your fork.
Fortunately, go modules solves this.
Basically, create a go.mod at the top of your forked repo and add:
module github.com/orig/repo
then, the go compiler will assume that you are "orig/repo" regardless of where you actually are checked out from.
so, when orig/repo/A imports orig/repo/B, it will look locally.
If there are other imports you need to override that are outside the main forked repo, you can also force dependencies to come from another place using replace
SOLVED
At first I thought it was problem with a FORK (which is a common problem experienced with fork of Go language repo's), but it turns out, it was Repo specific problem.
One of the dependent libraries had to be reinstalled for the forked repo to work, which was not mentioned in the Original repo docs.
Finally, this link helped: https://github.com/inconshreveable/ngrok/issues/181#issuecomment-65646229, the problem was not generic but repo specific
I followed the below steps from above link to resolve the dependency on go-bindata
go get github.com/jteeuwen/go-bindata
cd $GOPATH/src/github.com/jteeuwen/go-bindata/go-bindata
go build

Wget raw file from bitbucket and get the latest version without Commit-SHA number in the wget link

I try to download an installscript shell file which I host on BitBucket.
currently im using following command:
wget https://bitbucket.org/projectname/reponame/raw/commit-sha-num/installscript.sh
Later I want to have the possibility to modify my installscript.sh and want that the latest version is downloaded instead of a specific checkout with the commit-sha-number.
Im aware that it could be possible with git clone, but wget would be here more convenient for me if it was possible.
Is there a way to download everytime the latest version of this file from my master branch?
Thanks in advance
Yes. You can use the 'HEAD' keyword in the URL instead of the 'commit-sha-num' part.
wget https://bitbucket.org/projectname/reponame/raw/HEAD/installscript.sh
The "common" (and horribly insecure) approach to that is nowadays to pipe the downloaded content directly into the shell:
wget -O - https://bitbucket.org/projectname/reponame/master/installscript.sh | /bin/sh
See also
https://bitbucket.org/site/master/issues/9358/permalink-to-the-head-revision-of-a
Actually this is documented, see https://confluence.atlassian.com/bitbucket/hyperlinking-to-source-code-in-bitbucket-824476709.html.

Use Command Line for Github and push Xcode projects to Github

I just started using github and im having a really difficult time understanding how to use it with command line, as well as push my Xcode projects to github. I've googled whole bunch of stuff but it just didn't work on my computer. Could anybody tell me what exactly I need to do here? Thank you!
From the command line, simply go to the root folder of your XCode project: there should be a .git folder in it if that project is already under version control.
Create an Empty GitHub repo on ther GitHub site under your account.
Then in the root folder of your project, type:
git remote add origin https://<yourAccount>#github.com/<yourAccount>/<yourRepo>
git push -u origin master

Cannot find Mercurial global configuration file on osx

I am new to Bitbucket. I am trying to setup my computer to access Bitbucket using the following instructions. On Step 5, I am told to add ssh = ssh -C to file ~/.hgrc. I can't seem to find the file. Has anyone done this step successfully? How do I go about it?
It seems you don't have Mercurial installed at all. Step 3 of Bitbucket tutorial gives detailed description how to install it from MacPorts.
Once you have Mercurial installed just create .hgrc manually and add your configuration.
If you have not this file - create it. But you, maybe, just can't see it - dotted files are hidden. Anyway read hg help config
I had a problem with this too, but managed to find the .hgrc file. First get all hidden files visible by downloading this software http://invisiblix.read-write.fr/
Initially I tried to find the .hgrc file with spotlight but nothing came up. Happened to spotlight "~/", then this "~/.config" folder appeared, so I went there and found .hgrc in the same directory. Somehow it's always there but just not appearing even when called for in terminal.

Resources