mirror of
https://github.com/RubyMetric/chsrc
synced 2025-07-06 21:02:44 +08:00
Fix bugs in ubuntu to 'make' successfully
This commit is contained in:
parent
13eb213434
commit
1a8f7ee07f
6
chsrc.c
6
chsrc.c
@ -180,7 +180,7 @@ lets_test_speed_ (source_info* sources, size_t size, const char* target)
|
|||||||
xy_warn ("chsrc: 跳过该站点");
|
xy_warn ("chsrc: 跳过该站点");
|
||||||
speed = 0;
|
speed = 0;
|
||||||
} else {
|
} else {
|
||||||
printf (xy_strjoin(3, "chsrc: 测速 ", src.mirror->site , " ... "));
|
printf ("%s",xy_strjoin(3, "chsrc: 测速 ", src.mirror->site , " ... "));
|
||||||
speed = test_speed_url (url);
|
speed = test_speed_url (url);
|
||||||
}
|
}
|
||||||
speeds[i] = speed;
|
speeds[i] = speed;
|
||||||
@ -1166,7 +1166,9 @@ os_gentoo_setsrc(char* option)
|
|||||||
char * yuan = xy_strjoin(3,"GENTOO_MIRRORS=\"https://",
|
char * yuan = xy_strjoin(3,"GENTOO_MIRRORS=\"https://",
|
||||||
source.url,
|
source.url,
|
||||||
"gentoo\"");
|
"gentoo\"");
|
||||||
cmd = xy_strjoin("cat ",yuan," >> /etc/portage/make.conf");
|
cmd = xy_strjoin(3,"cat ",
|
||||||
|
yuan,
|
||||||
|
" >> /etc/portage/make.conf");
|
||||||
chsrc_logcmd(cmd);
|
chsrc_logcmd(cmd);
|
||||||
system(cmd);
|
system(cmd);
|
||||||
|
|
||||||
|
1
chsrc.h
1
chsrc.h
@ -375,6 +375,7 @@ os_mysys2_sources[] = {
|
|||||||
{&Sohu, "https://mirrors.sohu.com/msys2/"}
|
{&Sohu, "https://mirrors.sohu.com/msys2/"}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2023-09-05 更新
|
* 2023-09-05 更新
|
||||||
*
|
*
|
||||||
|
11
xy.h
11
xy.h
@ -23,6 +23,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
// #define NDEBUG
|
// #define NDEBUG
|
||||||
|
|
||||||
@ -46,7 +47,7 @@
|
|||||||
static bool xy_on_macos = false;
|
static bool xy_on_macos = false;
|
||||||
static bool xy_on_bsds = false;
|
static bool xy_on_bsds = false;
|
||||||
|
|
||||||
static char* xy_os_devnull = "/dev/null"
|
static char* xy_os_devnull = "/dev/null";
|
||||||
|
|
||||||
#define xy_useutf8()
|
#define xy_useutf8()
|
||||||
|
|
||||||
@ -74,9 +75,9 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define putf(n) printf("%f\n", n)
|
void putf(double n) {printf("%f\n", n);}
|
||||||
#define puti(n) printf("%d\n", n)
|
void puti(long long n) {printf("%lld\n", n);}
|
||||||
#define putb(n) if(n) puts("true"); else puts("false");
|
void putb(bool n) {if(n) puts("true"); else puts("false");}
|
||||||
|
|
||||||
#define xy_arylen(x) (sizeof(x) / sizeof(x[0]))
|
#define xy_arylen(x) (sizeof(x) / sizeof(x[0]))
|
||||||
|
|
||||||
@ -131,7 +132,7 @@ xy_log_ (int level, const char* str)
|
|||||||
|
|
||||||
sprintf (buf, color_fmt_str, str);
|
sprintf (buf, color_fmt_str, str);
|
||||||
if (to_stderr) {
|
if (to_stderr) {
|
||||||
fprintf(stderr, buf);
|
fprintf(stderr, "%s",buf);
|
||||||
} else {
|
} else {
|
||||||
puts(buf);
|
puts(buf);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user