MinGW 自动批量下载源码
2012-12-02 20:03
176 查看
最近工作中要用FORTRAN,自然就想到了要用MinGW,官方给的mingw-get-inst还是很好用的。如果网络不给力,可以网搜索MinGW离线下载安装包。
如果想要获得相应包的码,可以使用mingw-get source pakcagename
如果想要获得已安装包的全部源码,怎么办?
那就动手改一下mingw-get的源码。
已改好的,可以直接下载使用:
http://download.csdn.net/detail/waji2000/4837926
1、将mingw-get-0.dll覆盖C:\MinGW\libexec\mingw-get目录下的原文件。
2、将mingw-get.exe覆盖C:\MinGW\bin目录下的原文件。
3、使用命令
mingw-get update
mingw-get --download-only upgrade
说明:基于mingw-get-0.5-mingw32-beta-20120426-1-src修改。
修改的地方:
1、在pkgbase.h中类pkgXmlDocument添加相应的函数,可直接加在 void RescheduleInstalledPackages( unsigned long );下面:
void DownloadSourcePackages( unsigned long );
2、在pkgdeps.cpp中添加如下函数:
void pkgXmlDocument::DownloadSourcePackages( unsigned long action )
{
/* Wrapper function to retrieve the list of all installed packages,
* passing each entry in turn to the standard task scheduler. We
* begin by locating the first sysroot entry in the XML database...
*/
pkgXmlNode *sysroot = GetRoot()->FindFirstAssociate( sysroot_key );
/* ...then, while we have sysroots to examine...
*/
while( sysroot != NULL )
{
/* ...we retrieve the first package installation record within
* the current sysroot data set.
*/
pkgXmlNode *package = sysroot->FindFirstAssociate( installed_key );
/* Within each sysroot, until we've retrieved all embedded
* installation records...
*/
while( package != NULL )
{
/* ...we read the canonical tarname for the package,
* and when it is appropriately specified...
*/
const char *tarname = package->GetPropVal( tarname_key, NULL );
if( tarname != NULL )
{
/* ...we decode it, to determine the package name,
* subsystem name and component class.
*/
pkgSpecs decode( tarname );
const char *pkgname = decode.GetPackageName();
const char *sysname = decode.GetSubSystemName();
const char *cptname = decode.GetComponentClass();
/* From these three, we need to reconstruct an effective
* package name for the scheduler look-up; this reconstruction
* is performed using the following formatted buffer.
*/
const char *fmt = "%s-%s";
char refname[3 + strlen( sysname ) + strlen( pkgname ) + strlen( cptname )];
if( FindPackageByName( pkgname, sysname ) == NULL )
{
/* The package name alone is insufficient for a successful
* look-up; assume that the effective package name has been
* defined by prefixing the sysroot name.
*/
sprintf( refname, fmt, sysname, pkgname );
pkgname = refname;
}
if( cptname != NULL )
{
/* A fully qualified logical package name should include
* the component class name, abstracted from the canonical
* tarname, and appended to the package name.
*/
sprintf( refname, fmt, pkgname, cptname );
pkgname = refname;
}
/* Having constructed the effective logical package name,
* we download the source
*/
GetSourceArchive( pkgname, action );
}
/* ...then move on to the next installed package, if any,
* within the current sysroot data set...
*/
package = package->FindNextAssociate( installed_key );
}
/* ...and ultimately, to the next sysroot, if any, in the
* XML database.
*/
sysroot = sysroot->FindNextAssociate( sysroot_key );
}
}
3、在climain.cpp中在 dbase.RescheduleInstalledPackages( ACTION_UPGRADE );下增加如下语句:
dbase.DownloadSourcePackages(ACTION_SOURCE);
如果想要获得相应包的码,可以使用mingw-get source pakcagename
如果想要获得已安装包的全部源码,怎么办?
那就动手改一下mingw-get的源码。
已改好的,可以直接下载使用:
http://download.csdn.net/detail/waji2000/4837926
1、将mingw-get-0.dll覆盖C:\MinGW\libexec\mingw-get目录下的原文件。
2、将mingw-get.exe覆盖C:\MinGW\bin目录下的原文件。
3、使用命令
mingw-get update
mingw-get --download-only upgrade
说明:基于mingw-get-0.5-mingw32-beta-20120426-1-src修改。
修改的地方:
1、在pkgbase.h中类pkgXmlDocument添加相应的函数,可直接加在 void RescheduleInstalledPackages( unsigned long );下面:
void DownloadSourcePackages( unsigned long );
2、在pkgdeps.cpp中添加如下函数:
void pkgXmlDocument::DownloadSourcePackages( unsigned long action )
{
/* Wrapper function to retrieve the list of all installed packages,
* passing each entry in turn to the standard task scheduler. We
* begin by locating the first sysroot entry in the XML database...
*/
pkgXmlNode *sysroot = GetRoot()->FindFirstAssociate( sysroot_key );
/* ...then, while we have sysroots to examine...
*/
while( sysroot != NULL )
{
/* ...we retrieve the first package installation record within
* the current sysroot data set.
*/
pkgXmlNode *package = sysroot->FindFirstAssociate( installed_key );
/* Within each sysroot, until we've retrieved all embedded
* installation records...
*/
while( package != NULL )
{
/* ...we read the canonical tarname for the package,
* and when it is appropriately specified...
*/
const char *tarname = package->GetPropVal( tarname_key, NULL );
if( tarname != NULL )
{
/* ...we decode it, to determine the package name,
* subsystem name and component class.
*/
pkgSpecs decode( tarname );
const char *pkgname = decode.GetPackageName();
const char *sysname = decode.GetSubSystemName();
const char *cptname = decode.GetComponentClass();
/* From these three, we need to reconstruct an effective
* package name for the scheduler look-up; this reconstruction
* is performed using the following formatted buffer.
*/
const char *fmt = "%s-%s";
char refname[3 + strlen( sysname ) + strlen( pkgname ) + strlen( cptname )];
if( FindPackageByName( pkgname, sysname ) == NULL )
{
/* The package name alone is insufficient for a successful
* look-up; assume that the effective package name has been
* defined by prefixing the sysroot name.
*/
sprintf( refname, fmt, sysname, pkgname );
pkgname = refname;
}
if( cptname != NULL )
{
/* A fully qualified logical package name should include
* the component class name, abstracted from the canonical
* tarname, and appended to the package name.
*/
sprintf( refname, fmt, pkgname, cptname );
pkgname = refname;
}
/* Having constructed the effective logical package name,
* we download the source
*/
GetSourceArchive( pkgname, action );
}
/* ...then move on to the next installed package, if any,
* within the current sysroot data set...
*/
package = package->FindNextAssociate( installed_key );
}
/* ...and ultimately, to the next sysroot, if any, in the
* XML database.
*/
sysroot = sysroot->FindNextAssociate( sysroot_key );
}
}
3、在climain.cpp中在 dbase.RescheduleInstalledPackages( ACTION_UPGRADE );下增加如下语句:
dbase.DownloadSourcePackages(ACTION_SOURCE);
相关文章推荐
- maven struts—spring-ibatis依赖配置 加上了部分源码的配置 都可以自动从开源库中下载
- FreeMarker_模板引擎_代码自动生成器_源码下载
- Windows下批量下载Android源码
- 自己写的一个代码自动生成工具_java版_源码下载
- 下载android源码中断后自动继续下载
- Windows下批量下载Android源码
- IDEA如何配置maven自动下载源码和文档
- eclipse 设置maven来自动下载源码与doc
- eclipse添加自动下载源码包插件
- DiscuzNT改造-远程内容自动采集-DNT2.5(定时采集、源码下载)
- 让maven自动下载源码和doc。
- android Listview分批加载+自动加载(附源码下载)
- eclipse 设置maven来自动下载源码与doc
- 批量 project svn 更新, mvn 源码下载工具
- --------------=struts1.2 批量自动上传,批量下载(无组件)=--------------
- FreeMarker_模板引擎_代码自动生成器_源码下载
- Maven引入依赖后自动下载并关联源码(Source)
- IntelliJ IDEA配置maven自动下载源码和文档
- 自动更新程序源码下载(C#.Net)
- 全自动备份vss和sql数据库(含源码下载)