Skip to content

Commit 7de85e1

Browse files
committed
Add some comments in line for the sed regex
1 parent a3aefde commit 7de85e1

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

scripts/generate_buildinfo_config.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ echo "export SONIC_VERSION_CONTROL_COMPONENTS=$SONIC_VERSION_CONTROL_COMPONENTS"
1111
echo "export SONIC_VERSION_CACHE=${SONIC_VERSION_CACHE}" >> $BUILDINFO_CONFIG
1212
echo "export SONIC_VERSION_CACHE_SOURCE=${SONIC_VERSION_CACHE_SOURCE}" >> $BUILDINFO_CONFIG
1313
echo "export DISTRO=${DISTRO}" >> $BUILDINFO_CONFIG
14-
echo "export MIRROR_SNAPSHOT=$MIRROR_SNAPSHOT" >> $BUILDINFO_CONFIG
14+
echo "export MIRROR_SNAPSHOT=$MIRROR_SNAPSHOT" >> $BUILDINFO_CONFIG

scripts/versions_manager.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -573,14 +573,14 @@ def get_default_module(self):
573573
for dist in dists:
574574
versions = self._get_versions(ctype, dist)
575575
common_versions = self._get_common_versions(versions)
576-
component = Component(common_versions, ctype, dist)
576+
component = Component(self.verbose, common_versions, ctype, dist)
577577
components.append(component)
578578
else:
579579
versions = self._get_versions(ctype)
580580
common_versions = self._get_common_versions(versions)
581-
component = Component(common_versions, ctype)
581+
component = Component(self.verbose, common_versions, ctype)
582582
components.append(component)
583-
module = VersionModule(DEFAULT_MODULE, components)
583+
module = VersionModule(self.verbose, DEFAULT_MODULE, components)
584584
module.overwrite(default_module, True, True)
585585
return module
586586

src/sonic-build-hooks/scripts/buildinfo_base.sh

+2
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,13 @@ set_reproducible_mirrors()
112112
{
113113
# Remove the charater # in front of the line if matched
114114
local expression="s/^#\(.*$REPR_MIRROR_URL_PATTERN\)/\1/"
115+
# Add the character # in front of the line, if not match the URL pattern condition
115116
local expression2="/^#*deb.*$REPR_MIRROR_URL_PATTERN/! s/^#*deb/#&/"
116117
local expression3="\$a#SET_REPR_MIRRORS"
117118
if [ "$1" = "-d" ]; then
118119
# Add the charater # in front of the line if match
119120
expression="s/^deb.*$REPR_MIRROR_URL_PATTERN/#\0/"
121+
# Remove the character # in front of the line, if not match the URL pattern condition
120122
expression2="/^#*deb.*$REPR_MIRROR_URL_PATTERN/! s/^#(#*deb)/\1/"
121123
expression3="/#SET_REPR_MIRRORS/d"
122124
fi

src/sonic-build-hooks/scripts/collect_version_files

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ dpkg-query -W -f '${Package}==${Version}\n' | grep -Ev "${SKIP_VERSION_PACKAGE}"
2727

2828
## Add mirror versions
2929
while read -r line; do
30-
mirror=$(echo "$line" | sed "s/.*\///" | sed "s/_InRelease.*//")
31-
date=$(date --date="$(echo "$line" | cut -d: -f3-)" +%Y-%m-%dT%H:%M:%SZ)
32-
echo "$mirror==$date" >> ${TARGET_PATH}/versions-mirror
30+
mirror=$(echo "$line" | sed "s/.*\///" | sed "s/_InRelease.*//")
31+
date=$(date --date="$(echo "$line" | cut -d: -f3-)" +%Y-%m-%dT%H:%M:%SZ)
32+
echo "$mirror==$date" >> ${TARGET_PATH}/versions-mirror
3333
done < <(grep Date: /var/lib/apt/lists/*_InRelease 2>/dev/null)
3434

3535
## Print the unique and sorted result

0 commit comments

Comments
 (0)