Skip to content

Commit edcf858

Browse files
authored
Merge pull request #3775 from smoe/github_ci_apt_repeat
GitHub CI: apt repeat
2 parents 8993411 + 9572373 commit edcf858

7 files changed

Lines changed: 45 additions & 39 deletions

File tree

.github/workflows/ci.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
- name: Build RIP & test
3131
run: |
3232
set -x
33-
sudo apt-get install -y eatmydata
33+
sudo apt-get --yes -o Acquire::Retries=5 install eatmydata
3434
eatmydata ./scripts/travis-install-build-deps.sh
35-
sudo eatmydata apt --quiet --yes upgrade
35+
sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
3636
cd src
3737
eatmydata ./autogen.sh
3838
eatmydata ./configure --with-realtime=uspace --disable-check-runtime-deps
@@ -55,10 +55,10 @@ jobs:
5555
- name: Clang build RIP & test
5656
run: |
5757
set -x
58-
sudo apt-get install -y eatmydata
58+
sudo apt-get --yes -o Acquire::Retries=5 install eatmydata
5959
eatmydata ./scripts/travis-install-build-deps.sh
60-
sudo eatmydata apt-get install -y clang
61-
sudo eatmydata apt --quiet --yes upgrade
60+
sudo eatmydata apt-get -y -o Acquire::Retries=5 install clang
61+
sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
6262
cd src
6363
eatmydata ./autogen.sh
6464
CC=clang CXX=clang++ eatmydata ./configure --with-realtime=uspace --disable-check-runtime-deps
@@ -81,8 +81,8 @@ jobs:
8181
- name: Build HTML docmentation
8282
run: |
8383
./scripts/travis-install-build-deps.sh
84-
sudo apt-get install -y eatmydata
85-
sudo eatmydata apt --quiet --yes upgrade
84+
sudo apt-get -y -o Acquire::Retries=5 install eatmydata
85+
sudo eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
8686
cd src
8787
eatmydata ./autogen.sh
8888
eatmydata ./configure --with-realtime=uspace --disable-check-runtime-deps --enable-build-documentation=html
@@ -113,11 +113,11 @@ jobs:
113113
run: |
114114
set -e
115115
set -x
116-
apt-get --quiet update
117-
apt-get --yes --quiet install eatmydata curl
118-
eatmydata apt --quiet --yes upgrade
116+
apt-get --quiet -o Acquire::Retries=5 update
117+
apt-get --yes --quiet -o Acquire::Retries=5 install eatmydata curl
118+
eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
119119
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
120-
eatmydata apt-get --yes --quiet install --no-install-suggests git lsb-release python3 devscripts
120+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts
121121
122122
- uses: actions/checkout@v3
123123
with:
@@ -138,11 +138,11 @@ jobs:
138138
esac
139139
set -e
140140
set -x
141-
eatmydata apt-get --yes --quiet install --no-install-recommends gpg software-properties-common
141+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-recommends gpg software-properties-common
142142
eatmydata gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF
143143
DIST=$(echo ${{matrix.image}} | cut -d : -f 2)
144144
eatmydata add-apt-repository "deb http://linuxcnc.org $DIST base"
145-
eatmydata apt-get --quiet update
145+
eatmydata apt-get --quiet -o Acquire::Retries=5 update
146146
147147
- name: Build architecture-specific Debian packages
148148
env:
@@ -157,16 +157,16 @@ jobs:
157157
eatmydata debian/update-dch-from-git
158158
eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
159159
eatmydata git diff
160-
eatmydata apt-get --yes --quiet build-dep --arch-only .
160+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 build-dep --arch-only .
161161
eatmydata debuild -us -uc --build=any
162162
- name: Test debian packages
163163
env:
164164
DEBIAN_FRONTEND: noninteractive
165165
run: |
166166
set -e
167167
set -x
168-
eatmydata apt-get --yes --quiet install ../*.deb
169-
eatmydata apt-get --yes --quiet install sudo # some tests run sudo...
168+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb
169+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install sudo # some tests run sudo...
170170
eatmydata adduser --disabled-password --gecos "" testrunner
171171
eatmydata passwd -d testrunner
172172
eatmydata adduser testrunner sudo
@@ -220,11 +220,11 @@ jobs:
220220
run: |
221221
set -e
222222
set -x
223-
apt-get --quiet update
224-
apt-get --yes --quiet install eatmydata curl
225-
eatmydata apt --quiet --yes upgrade
223+
apt-get --quiet -o Acquire::Retries=5 update
224+
apt-get --yes --quiet -o Acquire::Retries=5 install eatmydata curl
225+
eatmydata apt --yes --quiet -o Acquire::Retries=5 upgrade
226226
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
227-
eatmydata apt-get --yes --quiet install --no-install-suggests git lsb-release python3 devscripts
227+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install --no-install-suggests git lsb-release python3 devscripts
228228
229229
- uses: actions/checkout@v3
230230
with:
@@ -245,11 +245,11 @@ jobs:
245245
esac
246246
set -e
247247
set -x
248-
eatmydata apt-get --yes --quiet install gpg software-properties-common
248+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install gpg software-properties-common
249249
eatmydata gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF
250250
DIST=$(echo ${{matrix.image}} | cut -d : -f 2)
251251
eatmydata add-apt-repository "deb http://linuxcnc.org $DIST base"
252-
eatmydata apt-get --quiet update
252+
eatmydata apt-get --quiet -o Acquire::Retries=5 update
253253
254254
- name: Build architecture-independent Debian packages
255255
env:
@@ -264,15 +264,15 @@ jobs:
264264
eatmydata debian/update-dch-from-git
265265
eatmydata scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
266266
eatmydata git diff
267-
eatmydata apt-get --yes --quiet build-dep --indep-only .
267+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 build-dep --indep-only .
268268
eatmydata debuild -us -uc --build=all
269269
- name: Test install debian packages
270270
env:
271271
DEBIAN_FRONTEND: noninteractive
272272
run: |
273273
set -e
274274
set -x
275-
eatmydata apt-get --yes --quiet install ../*.deb
275+
eatmydata apt-get --yes --quiet -o Acquire::Retries=5 install ../*.deb
276276
- name: Gather build artifacts
277277
run: |
278278
set -e
@@ -311,7 +311,7 @@ jobs:
311311
run: |
312312
set -x
313313
git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/*
314-
sudo apt-get -y install cppcheck shellcheck
314+
sudo apt-get --yes -o Acquire::Retries=5 install cppcheck shellcheck
315315
scripts/cppcheck.sh
316316
- name: Shellcheck
317317
continue-on-error: true

src/emc/rs274ngc/interp_remap.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,12 @@ int Interp::parse_remap(const char *inistring, int lineno)
368368
if ((s = strchr(iniline, '#')) != NULL) {
369369
*s = '\0';
370370
}
371-
s = strtok((char *) iniline, " \t");
371+
char* saveptr;
372+
s = strtok_r((char *) iniline, " \t", &saveptr);
372373

373374
while( s != NULL && argc < MAX_REMAPOPTS - 1) {
374375
argv[argc++] = s;
375-
s = strtok( NULL, " \t" );
376+
s = strtok_r( NULL, " \t", &saveptr);
376377
}
377378
if (argc == MAX_REMAPOPTS) {
378379
Error("parse_remap: too many arguments (max %d)", MAX_REMAPOPTS);

src/emc/rs274ngc/rs274ngc_pre.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,8 @@ int Interp::init()
975975
}
976976

977977
rtapi_strxcpy(tmpdirs,inistring);
978-
nextdir = strtok(tmpdirs,":"); // first token
978+
char *saveptr;
979+
nextdir = strtok_r(tmpdirs,":",&saveptr); // first token
979980
dct = 0;
980981
while (1) {
981982
char tmp_path[PATH_MAX];
@@ -996,7 +997,7 @@ int Interp::init()
996997
logDebug("too many entries in SUBROUTINE_PATH, max=%d", MAX_SUB_DIRS);
997998
break;
998999
}
999-
nextdir = strtok(NULL,":");
1000+
nextdir = strtok_r(NULL,":",&saveptr);
10001001
if (nextdir == NULL) break; // no more tokens
10011002
}
10021003
}

src/emc/task/emctask.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ int emcTaskInit()
147147
}
148148
strncpy(tmpdirs, inistring, sizeof(tmpdirs));
149149

150-
nextdir = strtok(tmpdirs,":"); // first token
150+
char* saveptr;
151+
nextdir = strtok_r(tmpdirs,":", &saveptr); // first token
151152
dct = 1;
152153
while (dct < MAX_M_DIRS) {
153154
if (nextdir == NULL) break; // no more tokens
@@ -157,7 +158,7 @@ int emcTaskInit()
157158
return -1;
158159
}
159160
strncpy(mdir[dct], nextdir, sizeof(mdir[dct]));
160-
nextdir = strtok(NULL,":");
161+
nextdir = strtok_r(NULL,":",&saveptr);
161162
dct++;
162163
}
163164
dmax=dct;

src/emc/tooldata/tooldata_common.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,15 @@ int tooldata_read_entry(const char *input_line,
9393
orientation = empty.orientation;
9494
offset = empty.offset;
9595

96-
buff = strtok(work_line, ";");
96+
char* saveptr;
97+
buff = strtok_r(work_line, ";", &saveptr);
9798
if (strlen(buff) <=1) {
9899
//fprintf(stderr,"skip blankline %s\n",__FILE__);
99100
return 0;
100101
}
101-
comment = strtok(NULL, "\n");
102+
comment = strtok_r(NULL, "\n", &saveptr);
102103

103-
token = strtok(buff, " ");
104+
token = strtok_r(buff, " ", &saveptr);
104105
while (token != NULL) {
105106
switch (toupper(token[0])) {
106107
case 'T':
@@ -188,7 +189,7 @@ int tooldata_read_entry(const char *input_line,
188189
valid = 0;
189190
break;
190191
}
191-
token = strtok(NULL, " ");
192+
token = strtok_r(NULL, " ", &saveptr);
192193
} // while token
193194

194195
if (valid) {

src/emc/tooldata/tooldata_db.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ int tooldata_db_init(char progname_plus_args[],int random_toolchanger)
242242
if (getenv( (char*)"DB_SHOW") ) {db_show = 1;}
243243
int child_argc = 0;
244244
char* child_argv[MAX_DB_PROGRAM_ARGS] = {0};
245-
char* token = strtok(progname_plus_args, " ");
245+
char* saveptr;
246+
char* token = strtok_r(progname_plus_args, " ", &saveptr);
246247
while (token != NULL) {
247248
child_argv[child_argc] = token;
248249
child_argc++;
@@ -251,7 +252,7 @@ int tooldata_db_init(char progname_plus_args[],int random_toolchanger)
251252
,MAX_DB_PROGRAM_ARGS);
252253
return -1;
253254
}
254-
token = strtok(NULL, " ");
255+
token = strtok_r(NULL, " ", &saveptr);
255256
}
256257
snprintf(db_childname,sizeof(db_childname),"%s",child_argv[0]);
257258
is_random_toolchanger = random_toolchanger;

src/libnml/rcs/rcs_print.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,10 @@ int separate_words(char **_dest, int _max, char *_src)
275275
return -1;
276276
}
277277
rtapi_strxcpy(word_buffer, _src);
278-
_dest[0] = strtok(word_buffer, " \n\r\t");
278+
char* saveptr;
279+
_dest[0] = strtok_r(word_buffer, " \n\r\t", &saveptr);
279280
for (i = 0; NULL != _dest[i] && i < _max - 1; i++) {
280-
_dest[i + 1] = strtok(NULL, " \n\r\t");
281+
_dest[i + 1] = strtok_r(NULL, " \n\r\t", &saveptr);
281282
}
282283
if (_dest[_max - 1] == NULL && i == _max - 1) {
283284
i--;

0 commit comments

Comments
 (0)