Download all Apple open source OS X files at once
来源:互联网 发布:联想笔记本电脑 知乎 编辑:程序博客网 时间:2024/05/17 03:05
While it is well known that Mac OS X contains open source code, how to access and download that source code is perhaps less well known. Apple publishes all its open source code on their Apple Open Source site. However, this site makes you download each program individually, without an obvious option to download an entire OS X release at once (i.e., all public sources for 10.6.1).
So I wrote the following bash script to automate the download procedure. It downloads the individual tarballs for each program, expands them locally, and then rolls everything up into one big tarball for local storage. Some caveats are that this script does not build the code, and that you are bound by a variety of licenses which are not included here (because no Apple code is included here).
Save the above somewhere on your path, make it executable (chmod a+x scriptname), and then run it with the version number you'd like to download: getsource 10.6.1, for instance. I am a bit shy about releasing my scripts, so please be gentle!
以上转自:http://hints.macworld.com/article.php?story=20091014194517371
另附:非常有用的参考网址:
tar包下载地址(全):www.opensource.apple.com/tarballs/
source在线查看(全):www.opensource.apple.com/source/
release发布包下载地址:
Mac OS X 10.6.2: www.opensource.apple.com/release/mac-os-x-1062/
Mac OS X 10.8: www.opensource.apple.com/release/mac-os-x-108/
脚本下载地址:http://download.csdn.net/detail/duanyipeng/8831335
So I wrote the following bash script to automate the download procedure. It downloads the individual tarballs for each program, expands them locally, and then rolls everything up into one big tarball for local storage. Some caveats are that this script does not build the code, and that you are bound by a variety of licenses which are not included here (because no Apple code is included here).
#!/usr/bin/env bash# --- applesource.bash --- downloads source code for an entire Apple release# Take input from command-line (use "10.5.8", "10.6.1", etc.) version="mac-os-x-`echo $* | tr -d "."`"# URL: homepage="http://www.opensource.apple.com" URL="${homepage}/release/${version}/"# Announce beginning, and prepare a directory for the untarred sources echo "Preparing to download..." sources="./${version}-sources" mkdir -p ${sources} # Process the webpage for the locations of the tarballs themselves curl --silent ${URL} | sed -n 's/<a href="\(.*.tar.gz\)">/\1/p' | \ while read line; do # Find and announce the name of the next tarball to be downloaded tarball=".${line}" echo -e "\nDownloading `basename ${tarball}`..." # Download the tarball and keep Apple's original directory structure intact curl --create-dirs --output ${tarball} "${homepage}${line}" # Untar into the "sources" directory (see line 13) tar xfz "${tarball}" -C ${sources} done# Compress all sourcefiles into a single tarball for posterity echo "Creating ${version}.tar.gz from all sources..." tar cfvz "${version}.tar.gz" ${sources}# Explicitly show that everything finished. echo "Done."# I like for my Mac to talk to me, although sometimes this can be creepy. say "The source of ${version} is now ready."
Save the above somewhere on your path, make it executable (chmod a+x scriptname), and then run it with the version number you'd like to download: getsource 10.6.1, for instance. I am a bit shy about releasing my scripts, so please be gentle!
以上转自:http://hints.macworld.com/article.php?story=20091014194517371
另附:非常有用的参考网址:
tar包下载地址(全):www.opensource.apple.com/tarballs/
source在线查看(全):www.opensource.apple.com/source/
release发布包下载地址:
Mac OS X 10.6.2: www.opensource.apple.com/release/mac-os-x-1062/
Mac OS X 10.8: www.opensource.apple.com/release/mac-os-x-108/
脚本下载地址:http://download.csdn.net/detail/duanyipeng/8831335
0 0
- Download all Apple open source OS X files at once
- Open source website Download
- Qt Open Source Download
- Apple - Open Source
- Apple Open Source
- Open at the source.
- Test Dozens of Browsers All At Once
- Inspections Open at Apple Manufacturers in China
- iOS: Open In … All Files
- Once Apple, Forever Apple
- 1342 open source and commercial UI components for iOS and OS X.
- Convert HTML Page To a PDF Using Open Source Tool [ Linux / OS X / Windows ]
- Open source all over the world
- Mac OS X - Apple Events (1) - Building an Apple Event
- HTML5:多文件上传 Upload multiple files at once with HTML5, jQuery and PHP
- Mac OS X: Running items at login
- (OS X) Loading Code at Runtime
- Retrieving the list of items in a directory all at once
- 写在离职前!
- C语言回顾(九、文件读写各种操作)——iOS开发基础
- [数据结构]纸牌游戏——小猫钓鱼
- ReportView报表控件使用方法
- PHP数据库连接文件
- Download all Apple open source OS X files at once
- 笔记2:win7下 OpenCv2.4.3+Qt5.0.1版本的配置
- C++ 12.4.5 类成员的显示初始化----数据成员都是public类型且没有构造函数的类
- Ubuntu 12.04下安装RabbitVCS,类似Windows的TortoiseSVN
- 对于TCP的TCB的相关疑惑???
- C#录制视频聊天
- JPEG: Exif信息相关
- jdk:HashSet基于HashMap实现
- CSDN-markdown编辑器使用说明