Skip to content
Snippets Groups Projects
Unverified Commit fdb4be83 authored by Daniel Körner's avatar Daniel Körner Committed by GitHub
Browse files

fix(conan): correct regex for packages without @user/channel but with revisions (#26702)

parent 1679f05b
No related branches found
No related tags found
No related merge requests found
[requires] [requires]
poco/1.9.4 poco/1.9.4
zlib/[~1.2.3, loose=False] zlib/[~1.2.3, loose=False]
fake/8.62.134@test/dev fake/8.62.134@test/dev
cairo/1.17.2#aff2d03608351db075ec1348a3afc9ff
cairo/1.17.2@_/_#aff2d03608351db075ec1348a3afc9ff cairo/1.17.2@_/_#aff2d03608351db075ec1348a3afc9ff
[build_requires] [build_requires]
7zip/[>1.1 <2.1, include_prerelease=True] 7zip/[>1.1 <2.1, include_prerelease=True]
curl/[~1.2.3, loose=False, include_prerelease=True]@test/dev curl/[~1.2.3, loose=False, include_prerelease=True]@test/dev
boost/[>1.1 <2.1] boost/[>1.1 <2.1]
catch2/[2.8] catch2/[2.8]
openssl/[~=3.0]@test/prod openssl/[~=3.0]@test/prod
cmake/[>1.1 || 0.8] cmake/[>1.1 || 0.8]
cryptopp/[1.2.7 || >=1.2.9 <2.0.0]@test/local cryptopp/[1.2.7 || >=1.2.9 <2.0.0]@test/local
#commentedout/1.2 #commentedout/1.2
# commentedout/3.4 # commentedout/3.4
...@@ -29,4 +30,4 @@ openssl:shared=True ...@@ -29,4 +30,4 @@ openssl:shared=True
[imports] [imports]
bin, *.dll -> ./bin # Copies all dll files from packages bin folder to my local "bin" folder bin, *.dll -> ./bin # Copies all dll files from packages bin folder to my local "bin" folder
lib, *.dylib* -> ./bin # Copies all dylib files from packages lib folder to my local "bin" folder lib, *.dylib* -> ./bin # Copies all dylib files from packages lib folder to my local "bin" folder
\ No newline at end of file
...@@ -35,6 +35,16 @@ describe('modules/manager/conan/extract', () => { ...@@ -35,6 +35,16 @@ describe('modules/manager/conan/extract', () => {
packageName: 'fake/8.62.134@test/dev', packageName: 'fake/8.62.134@test/dev',
replaceString: 'fake/8.62.134@test/dev', replaceString: 'fake/8.62.134@test/dev',
}, },
{
autoReplaceStringTemplate:
'{{depName}}/{{newValue}}@_/_{{#if newDigest}}#{{newDigest}}{{/if}}',
currentDigest: 'aff2d03608351db075ec1348a3afc9ff',
currentValue: '1.17.2',
depName: 'cairo',
depType: 'requires',
packageName: 'cairo/1.17.2@_/_',
replaceString: 'cairo/1.17.2#aff2d03608351db075ec1348a3afc9ff',
},
{ {
autoReplaceStringTemplate: autoReplaceStringTemplate:
'{{depName}}/{{newValue}}@_/_{{#if newDigest}}#{{newDigest}}{{/if}}', '{{depName}}/{{newValue}}@_/_{{#if newDigest}}#{{newDigest}}{{/if}}',
......
...@@ -4,7 +4,7 @@ import type { PackageDependency, PackageFileContent } from '../types'; ...@@ -4,7 +4,7 @@ import type { PackageDependency, PackageFileContent } from '../types';
import { isComment } from './common'; import { isComment } from './common';
const regex = regEx( const regex = regEx(
`(?<name>[-_a-z0-9]+)/(?<version>[^@\n{*"']+)(?<userChannel>@[-_a-zA-Z0-9]+(?:/[^#\n.{*"' ]+|))?#?(?<revision>[-_a-f0-9]+[^\n{*"'])?`, `(?<name>[-_a-z0-9]+)/(?<version>[^@#\n{*"']+)(?<userChannel>@[-_a-zA-Z0-9]+(?:/[^#\n.{*"' ]+|))?#?(?<revision>[-_a-f0-9]+[^\n{*"'])?`,
); );
function setDepType(content: string, originalType: string): string { function setDepType(content: string, originalType: string): string {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment