Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5730 → Rev 5731

/contrib/other/kpm/kpm.c
12,6 → 12,7
 
#define BUFFSIZE (64*1024)
 
char conbuf[256];
 
char *make_url(const char *name)
{
91,6 → 92,10
memcpy(buf, http->content_ptr+count, tail);
offset = tail;
}
 
sprintf(conbuf, "%d bytes loaded\r", http->content_received);
con_write_asciiz(conbuf);
 
}
received = http->content_received;
}
119,7 → 124,6
return received;
}
 
 
int main(int argc, char *argv[])
{
int count;
129,6 → 133,8
if(http_init())
goto err_init;
 
con_init(80, 25, 80, 250, "Kolibri package manager");
 
tmp_path = make_tmp_path("packages.xml");
 
count = http_load_file(tmp_path, make_url("packages.xml"));
151,7 → 157,10
remove_missing_packages(&install_list, &download_list);
 
list_for_each_entry(pkg, &install_list, list)
printf("install package %s-%s\n", pkg->name, pkg->version);
{
sprintf(conbuf,"install package %s-%s\n", pkg->name, pkg->version);
con_write_asciiz(conbuf);
};
 
set_cwd("/tmp0/1");
 
159,6 → 168,8
};
}
 
con_exit(0);
 
return 0;
 
err_init:
227,10 → 238,12
 
list_for_each_entry_safe(pkg, tmp, download_list, list)
{
printf("package %s-%s\n", pkg->name, pkg->version);
sprintf(conbuf,"package %s-%s\n", pkg->name, pkg->version);
con_write_asciiz(conbuf);
cache_path = make_cache_path(pkg->filename);
count = http_load_file(cache_path, make_url(pkg->filename));
printf("%s loaded %d bytes\n",cache_path, count);
sprintf(conbuf,"%s %d bytes loaded\n",cache_path, count);
con_write_asciiz(conbuf);
if( !test_archive(cache_path))
list_del_pkg(pkg);
else
248,7 → 261,8
{
if(ipkg->id == mpkg->id)
{
printf("skip missing package %s-%s\n", ipkg->name, ipkg->version);
sprintf(conbuf,"skip missing package %s-%s\n", ipkg->name, ipkg->version);
con_write_asciiz(conbuf);
list_del_pkg(ipkg);
};
}