Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Into: I like learning by reading sources. But it's tiring of searching them across internet splited on many many different project sites. I'd love to see central browsable repo with sources of many many apps in one place.

  • When someone want to find documentation of some Linux tool, best place is : man toolname.
  • When I want to browse Linux sources "on-demand" I can always jump to : Linux Cross Reference.
  • When I want to find most common staff, I can find all sources in Coreutils.
  • When I want to check how to build something, I can (for example) jump into http://www.archlinux.org/packages/ , check it's pkgbuild.

Is there any repo that holds sources of most of tools in one place ? - just like man holds documentation or Linux Cross Reference kernel sources.

I mean something for "rapid" "on-demand" checking how stuff is implemented. (Yes, I know google -> but I am tired of routine: 1. searching project site 2. browsing repo or even worse -> checking out it's repo 3. deleting when finished)

REMARK:

I've stressed out, I'd like to check tools : rapidly, fast, on-demand.

It means: I don't want to install whole app with it's sources just to take a look into it's sources. (btw. web resource is preferable, so I could check sources from many computers - I do not have admin on all of them)

share|improve this question
3  
Most distributions allow you to install sources for packages using the package manager. –  jippie Jun 8 '12 at 21:25
3  
For debian you can just run apt-get source $PACKAGE-NAME after you added the source repository –  Ulrich Dangel Jun 8 '12 at 21:54
    
Packages usually reply on other libraries to complete its functions –  warl0ck Jun 9 '12 at 7:47
    
I don't want to install each app I want to check. –  Grzegorz Wierzowiecki Jun 9 '12 at 8:48
2  
@GrzegorzWierzowiecki you don't have to install an application to have a look at the source, at least with apt-get source you can run this command as normal user. –  Ulrich Dangel Jun 9 '12 at 16:21

2 Answers 2

up vote 5 down vote accepted

Let me to respond to your question with a alternative answer. I guess you want read the code for the traditional Unix command line tools, not only the GNU version of these. Read the code of similar tools from different projects is a good practice for learning different ideas and implementations.

GNU has a nice web interface for the repo of coreutils: http://git.savannah.gnu.org/cgit/coreutils.git

The BSD family has similar web interfaces for the repos:

The BSD codebase is interesting because usually uses less code for the same tools, i.e.: only supports traditional options, no extra options, sh is a real shell and no just a link to other big shell (bash), etc. Tools similar to coreutils are within bin, sbin, usr.bin and usr.sbin.

You can also browse the same web interfaces if you want read the code for to build third party software (similar to arch's pkgbuild). NetBSD and DragonFly use pkgsrc from the NetBSD repo. OpenBSD and FreeBSD have these frameworks within their respective repos.

Other repos interesting for your purpose are:

share|improve this answer
    
Great answer. Thanks you for encouraging for comparison - comparing different approaches is educative. Could you expand your answer with some Linux repo(s) ? BSD codebases are interesting, but I am afraid there might be important differences in syscall etc stuff, so Linux repos would be great addition to your list. –  Grzegorz Wierzowiecki Jun 9 '12 at 21:47
    
One of the advantages of *BSD is that all the code is within one repo. The problem with Linux is that each package has a different origin. The coreutils repo (and the bash repo for the built-in functionality git.savannah.gnu.org/cgit/bash.git/tree) covers almost all the traditional tools. The "linux distro" repos only contain the framework for to build the third party packages and some patches, the repos don't contain real code (only contain the code for the distro's tools). –  Juan Francisco Cantero Hurtado Jun 9 '12 at 22:05
    
Respect to differences BSD vs Linux. The APIs are similar and habitually compatible with POSIX and other standards. The difference is the internal implementation of each API. In fact, tools from GNU works on *BSD and tools from *BSD works on Linux. E.g.: Debian ( packages.debian.org ) has some *BSD tools and the *BSDs have available coreutils and other GNU projects. –  Juan Francisco Cantero Hurtado Jun 9 '12 at 22:14

As there is no central place for open source development there is no central repository containing most open source software. Some use GitHub, BitBucket, private servers, Sourceforge, Launchpad, etc. So this is a truly distributed environment and there is no immediate benefit of having one repository just copying the source.

On the other hand binary Distributions (shipping binaries instead of source code) typically provide the source for most of their packages and provide them to all users. So your best chance is to use the infrastructure provided by Distributions. Please be aware that they don't necessarily contain the latest changes and fixes and may be outdated.

Examples how to download a source package from your distribution:

yumdownloader --source packagename
apt-get source packagename

For Arch have a look at the answers at the answers for a similar question on stackoverflow.

If you just want do download the source code you could use packages.debian.org, e.g link for coreutils. This will provide an download link to the original package (orig.* or the cleanuped source for some packages dsfg.*). You could do the same with the Arch Linux package list, e.g: arch coreutils page. The Download from Mirror will download the package.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.