Skip to content

Commit 72f5ac0

Browse files
authored
Replace grep with sed in IdentityModel script patch (#185)
1 parent 97df159 commit 72f5ac0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

patches/azure-activedirectory-identitymodel-extensions-for-dotnet/0002-Add-updateAssemblyInfo-bash-script.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ index 00000000..39173e2c
2525
+# Formats the date by replacing the 4-digit year with a 2-digit value and then subtract 19
2626
+dateTimeStamp=$(echo $((10#${date:0:2}-19)))${date:2}
2727
+
28-
+assemblyVersion=$(grep -oP '(?<=<assemblyVersion>)[^<]+' $PWD/buildConfiguration.xml)
28+
+assemblyVersion=$(sed -n 's/.*<assemblyVersion>\([^<]*\)<.*/\1/p' $PWD/buildConfiguration.xml)
2929
+assemblyFileVersion="$assemblyVersion.${dateTimeStamp::-6}" # Trim the time portion of the date/time
3030
+
3131
+# TODO: The commit SHA needs to be appended to the end of this version (see https://github.com/dotnet/source-build/issues/3573)
@@ -35,7 +35,7 @@ index 00000000..39173e2c
3535
+echo "assemblyFileVersion: $assemblyFileVersion"
3636
+echo "assemblyInformationalVersion: $assemblyInformationalVersion"
3737
+
38-
+nugetSuffix=$(grep -oP '(?<=<nugetSuffix>)[^<]+' $PWD/buildConfiguration.xml)
38+
+nugetSuffix=$(sed -n 's/.*<nugetSuffix>\([^<]*\)<.*/\1/p' $PWD/buildConfiguration.xml)
3939
+versionSuffix=""
4040
+
4141
+echo "nugetSuffix: $nugetSuffix"
@@ -47,7 +47,7 @@ index 00000000..39173e2c
4747
+echo "$version" > $versionPath
4848
+
4949
+# Get the names of all src projects from the buildConfiguration.xml file
50-
+projects=$(grep -zoP '(?<=<src>)(.|[\s])*?(?=<\/src>)' $PWD/buildConfiguration.xml | grep -aoP 'name="\K[^"]+')
50+
+projects=$(sed -n '/<src>/,/<\/src>/p' $PWD/buildConfiguration.xml | sed -n 's/.*name="\([^"]*\)".*/\1/p')
5151
+
5252
+# Inject the new version numbers into the AssemblyInfo.cs files for each project
5353
+for project in $projects; do

0 commit comments

Comments
 (0)