Skip to content

Commit fc64a04

Browse files
committed
create 0.15.2 branch
Signed-off-by: leleliu008 <leleliu008@gmail.com>
1 parent 584fe47 commit fc64a04

22 files changed

+174
-113
lines changed

.github/workflows/alpinelinux.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: alpinelinux
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
alpinelinux:

.github/workflows/archlinux.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: archlinux
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
archlinux:

.github/workflows/centos.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CentOS Linux
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
centos8:

.github/workflows/codacy-analysis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: codacy-analysis
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
codacy-analysis:

.github/workflows/debian.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Debian GNU/Linux
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
test:

.github/workflows/fedora.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Fedora
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
test:

.github/workflows/freebsd.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: FreeBSD
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
freebsd:

.github/workflows/gentoo.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: gentoo
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
gentoo:

.github/workflows/linuxmint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: LinuxMint
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
test:

.github/workflows/macos.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: macos
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010

.github/workflows/manjaro.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Manjaro Linux
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
test:

.github/workflows/netbsd.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: NetBSD
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
netbsd:

.github/workflows/openbsd.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: OpenBSD
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
openbsd:

.github/workflows/opensuse.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: openSUSE
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
opensuse:

.github/workflows/ppkg.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: ppkg
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
ppkg:

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616
with:
17-
ref: 0.15.1
17+
ref: 0.15.2
1818

1919
- id: check-if-has-new-commit
2020
run: |

.github/workflows/ubuntu.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: ubuntu
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
vcpkg:

.github/workflows/valgrind.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: valgrind
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
valgrind:

.github/workflows/voidlinux.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: voidlinux
22

33
on:
44
push:
5-
branches: [ 0.15.1 ]
5+
branches: [ 0.15.2 ]
66
pull_request:
7-
branches: [ 0.15.1 ]
7+
branches: [ 0.15.2 ]
88

99
jobs:
1010
voidlinux:

src/formula-repo-list-update.c

+89-28
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,113 @@
22
#include <string.h>
33

44
#include "core/sysinfo.h"
5+
56
#include "uppm.h"
67

8+
static int uppm_formula_repo_url_of_official_core(char buf[], const size_t bufSize) {
9+
char osType[31] = {0};
10+
11+
if (sysinfo_type(osType, 30) != 0) {
12+
return UPPM_ERROR;
13+
}
14+
15+
char osArch[31] = {0};
16+
17+
if (sysinfo_arch(osArch, 30) != 0) {
18+
return UPPM_ERROR;
19+
}
20+
21+
char osVers[31] = {0};
22+
23+
if (sysinfo_vers(osVers, 30) != 0) {
24+
return UPPM_ERROR;
25+
}
26+
27+
int ret;
28+
29+
#if defined (__APPLE__)
30+
int osVersMajor = 0;
31+
32+
for (int i = 0; i < 31; i++) {
33+
if (osVers[i] == '\0') {
34+
break;
35+
}
36+
37+
if (osVers[i] == '.') {
38+
osVers[i] = '\0';
39+
osVersMajor = atoi(osVers);
40+
break;
41+
}
42+
}
43+
44+
if (osVersMajor < 10) {
45+
fprintf(stderr, "MacOSX %d.x is not supported.\n", osVersMajor);
46+
return UPPM_ERROR;
47+
}
48+
49+
if (osVersMajor > 13) {
50+
osVersMajor = 13;
51+
}
52+
53+
ret = snprintf(buf, bufSize, "https://github.com/leleliu008/uppm-package-repository-%s-%d.0-%s", osType, osVersMajor, osArch);
54+
#elif defined (__DragonFly__)
55+
ret = snprintf(buf, bufSize, "https://github.com/leleliu008/uppm-package-repository-%s-%s-%s", osType, osVers, osArch);
56+
#elif defined (__FreeBSD__)
57+
ret = snprintf(buf, bufSize, "https://github.com/leleliu008/uppm-package-repository-%s-%s-%s", osType, osVers, osArch);
58+
#elif defined (__OpenBSD__)
59+
ret = snprintf(buf, bufSize, "https://github.com/leleliu008/uppm-package-repository-%s-%s-%s", osType, osVers, osArch);
60+
#elif defined (__NetBSD__)
61+
ret = snprintf(buf, bufSize, "https://github.com/leleliu008/uppm-package-repository-%s-%s-%s", osType, osVers, osArch);
62+
#else
63+
ret = snprintf(buf, bufSize, "https://github.com/leleliu008/uppm-formula-repository-%s-%s", osType, osArch);
64+
#endif
65+
66+
if (ret < 0) {
67+
perror(NULL);
68+
return UPPM_ERROR;
69+
} else {
70+
return UPPM_OK;
71+
}
72+
}
73+
774
int uppm_formula_repo_list_update() {
875
UPPMFormulaRepoList * formulaRepoList = NULL;
976

1077
int ret = uppm_formula_repo_list(&formulaRepoList);
1178

12-
if (ret == UPPM_OK) {
13-
bool officialCoreIsThere = false;
14-
15-
for (size_t i = 0; i < formulaRepoList->size; i++) {
16-
UPPMFormulaRepo * formulaRepo = formulaRepoList->repos[i];
79+
if (ret != UPPM_OK) {
80+
return ret;
81+
}
1782

18-
if (strcmp(formulaRepo->name, "official-core") == 0) {
19-
officialCoreIsThere = true;
20-
}
83+
bool officialCoreIsThere = false;
2184

22-
ret = uppm_formula_repo_sync(formulaRepo);
85+
for (size_t i = 0U; i < formulaRepoList->size; i++) {
86+
UPPMFormulaRepo * formulaRepo = formulaRepoList->repos[i];
2387

24-
if (ret != UPPM_OK) {
25-
break;
26-
}
88+
if (strcmp(formulaRepo->name, "official-core") == 0) {
89+
officialCoreIsThere = true;
2790
}
2891

29-
uppm_formula_repo_list_free(formulaRepoList);
92+
ret = uppm_formula_repo_sync(formulaRepo);
3093

31-
if (!officialCoreIsThere) {
32-
char osType[31] = {0};
94+
if (ret != UPPM_OK) {
95+
break;
96+
}
97+
}
3398

34-
if (sysinfo_type(osType, 30) != 0) {
35-
return UPPM_ERROR;
36-
}
99+
uppm_formula_repo_list_free(formulaRepoList);
37100

38-
char osArch[31] = {0};
101+
if (officialCoreIsThere) {
102+
return UPPM_OK;
103+
}
39104

40-
if (sysinfo_arch(osArch, 30) != 0) {
41-
return UPPM_ERROR;
42-
}
105+
char formulaRepoUrl[120];
43106

44-
size_t formulaRepoUrlLength = strlen(osType) + strlen(osArch) + 56U;
45-
char formulaRepoUrl[formulaRepoUrlLength];
46-
snprintf(formulaRepoUrl, formulaRepoUrlLength, "https://github.com/leleliu008/uppm-formula-repository-%s-%s", osType, osArch);
107+
ret = uppm_formula_repo_url_of_official_core(formulaRepoUrl, 120);
47108

48-
ret = uppm_formula_repo_add("official-core", formulaRepoUrl, "master", false, true);
49-
}
109+
if (ret != UPPM_OK) {
110+
return ret;
50111
}
51112

52-
return ret;
113+
return uppm_formula_repo_add("official-core", formulaRepoUrl, "master", false, true);
53114
}

src/install.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ int uppm_install(const char * packageName, bool verbose) {
8484

8585
if (stat(receiptFilePath, &st) == 0 && S_ISREG(st.st_mode)) {
8686
uppm_formula_free(formula);
87-
fprintf(stderr, "package [%s] already has been installed.\n", packageName);
87+
fprintf(stderr, "uppm package '%s' already has been installed.\n", packageName);
8888
return UPPM_OK;
8989
}
9090

9191
//////////////////////////////////////////////////////////////////////////
9292

93-
fprintf(stderr, "prepare to install package [%s].\n", packageName);
93+
fprintf(stderr, "uppm package '%s' to be installed.\n", packageName);
9494

9595
size_t uppmDownloadDirLength = uppmHomeDirLength + 11U;
9696
char uppmDownloadDir[uppmDownloadDirLength];
@@ -418,7 +418,7 @@ int uppm_install(const char * packageName, bool verbose) {
418418

419419
fclose(receiptFile);
420420

421-
fprintf(stderr, "\npackage [%s] successfully installed.\n", packageName);
421+
fprintf(stderr, "\nuppm package '%s' was successfully installed.\n", packageName);
422422

423423
return UPPM_OK;
424424
}

0 commit comments

Comments
 (0)