File tree Expand file tree Collapse file tree
parts/linux/cloud-init/artifacts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -564,32 +564,6 @@ semverCompare() {
564564 return 1
565565}
566566
567-
568-
569- apt_get_download () {
570- retries=$1 ; wait_sleep=$2 ; shift && shift ;
571- local ret=0
572- pushd $APT_CACHE_DIR || return 1
573- for i in $( seq 1 " $retries " ) ; do
574- dpkg --configure -a --force-confdef
575- wait_for_apt_locks
576-
577- # Pull the first quoted URL from --print-uris
578- url=" $( apt-get --print-uris -o Dpkg::Options::=--force-confold download -y -- " $@ " \
579- | awk -F" '" ' NR==1 && $2 {print $2}' ) "
580- if [ -n " $url " ]; then
581- # This avoids issues with the naming in the package. `apt-get download`
582- # encodes the package names with special characters and does not decode
583- # them when saving to disk, but `curl -J` handles the names correctly.
584- if curl -fLJO -- " $url " ; then ret=0; break ; fi
585- fi
586-
587- if [ " $i " -eq " $retries " ]; then ret=1; else sleep " $wait_sleep " ; fi
588- done
589- popd || return 1
590- return " $ret "
591- }
592-
593567getCPUArch () {
594568 arch=$( uname -m)
595569 # shellcheck disable=SC3010
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ apt_get_download () {
4+ retries=$1 ; wait_sleep=$2 ; shift && shift ;
5+ local ret=0
6+ pushd $APT_CACHE_DIR || return 1
7+ for i in $( seq 1 " $retries " ) ; do
8+ dpkg --configure -a --force-confdef
9+ wait_for_apt_locks
10+
11+ # Pull the first quoted URL from --print-uris
12+ url=" $( apt-get --print-uris -o Dpkg::Options::=--force-confold download -y -- " $@ " \
13+ | awk -F" '" ' NR==1 && $2 {print $2}' ) "
14+ if [ -n " $url " ]; then
15+ # This avoids issues with the naming in the package. `apt-get download`
16+ # encodes the package names with special characters and does not decode
17+ # them when saving to disk, but `curl -J` handles the names correctly.
18+ if curl -fLJO -- " $url " ; then ret=0; break ; fi
19+ fi
20+
21+ if [ " $i " -eq " $retries " ]; then ret=1; else sleep " $wait_sleep " ; fi
22+ done
23+ popd || return 1
24+ return " $ret "
25+ }
26+
327removeContainerd () {
428 apt_get_purge 10 5 300 moby-containerd
529}
You can’t perform that action at this time.
0 commit comments