Subject: [bug#74825] [PATCH] import/utils: Replace '.' by '-' in snake-case procedure.

From: Maxim Cournoyer <[email-masked]>
Date: Thu, 12 Dec 2024 21:05:23 +0900

* guix/import/utils.scm (snake-case): Replace '.' by '-'.  Update doc.

Change-Id: I46f2e066c82849627464d0690549288ebbc4e926
---
 guix/import/utils.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index faeec60845..0e3fe87f9b 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -317,9 +317,12 @@ (define (license->symbol license)
   (assoc-ref licenses license))
 
 (define (snake-case str)
-  "Return a downcased version of the string STR where underscores are replaced
-with dashes."
-  (string-join (string-split (string-downcase str) #\_) "-"))
+  "Return a downcased version of the string STR where underscores and periods
+are replaced with dashes."
+  (string-map (match-lambda
+                ((or #\_ #\.) #\-)
+                (chr chr))
+              (string-downcase str)))
 
 (define* (beautify-description description #:optional (length 80))
   "Improve the package DESCRIPTION by turning a beginning sentence fragment into

base-commit: df4575bc1490420de6ce99ae7342ef9a027b8fc7
prerequisite-patch-id: a21c54f528edd5e24ce9748533c158cdec067ef6
prerequisite-patch-id: 82ffcaa85fbcb430ce8dd00dd83ce4f458ad9a54
prerequisite-patch-id: 340a96c1fd73f48dafab5b499c69a754df2032c5
prerequisite-patch-id: 3239f9775e90c114bb5467a8496cb651c003350e
prerequisite-patch-id: d9d828f6e7af64c9c7724351eebf4f7171717c6b
prerequisite-patch-id: d7c9f7c07c91463c6284ab8013b2958636bfc68b
prerequisite-patch-id: d0546595635bec8116a46673e85ba999e92681ab
prerequisite-patch-id: 6daa85c3c5c427efd2919cc0a0f636f8f9ee9f96
prerequisite-patch-id: 5a3dc3234eff33a733d29df680a30b8940c32c27
prerequisite-patch-id: 8e6243c0e311087902b1e9ea558e32289f007ce4
prerequisite-patch-id: 0b351118ea3fb52f657c1c2fbfca4db839d97d0a
prerequisite-patch-id: 87b257d37e8213e5c7dd1981a1bdefd412b1e9cd
prerequisite-patch-id: fc310a85ed954204cb875d2cc930b5e328c04f56
prerequisite-patch-id: 8631c5bf8a18bde94232626c86376874353a1676
prerequisite-patch-id: e99736823b13de9de7c531624457c3e415162ca6
prerequisite-patch-id: 9efeb5e7a4c391e44bb97df912bad8343f63c4c1
prerequisite-patch-id: 96de186649e1f9badc97aa4fd366058bd7464c36
prerequisite-patch-id: 435d3eb22d167bbcb056df8b464e4111338cada1
prerequisite-patch-id: fe49cba7c523ec139b66198418342435a91bb602
prerequisite-patch-id: ffb13c5afee6c6f010ed79ecaf2061afbbbd98b0
prerequisite-patch-id: 7ab52749357832217dee06036f45b4e846193f50
prerequisite-patch-id: 1df9d7ad03a66492dbc0ab3895261d6651534e45
prerequisite-patch-id: 6733d8bc1dca98ac388d4cc40e09664acea16b70
prerequisite-patch-id: 5848c4d1de163270b696254b63d225f0005e83dd
prerequisite-patch-id: 50bdd6edf13698db1d5440f88ed4b4cc7aed91be
prerequisite-patch-id: b4227f5b390e8dabf6d3766c3a2a85f0da976c70
prerequisite-patch-id: 6b4d885fffc94d28f1823ff58134b4086f166c1e
prerequisite-patch-id: a77003dd69b5c2e2b35a14e35f5f637fc7224caf
prerequisite-patch-id: 6eee03591fe52033d4e8791c1c06491ad9c2ac5e
prerequisite-patch-id: 7e9d69211810d2c331d0ca6c2140e81f54fa6f23
prerequisite-patch-id: 11de23178a7a7fddec40a92a5312ccdf09843937
prerequisite-patch-id: 991edc110fb95c812a2958a1b4ad7f9a7217dd69
prerequisite-patch-id: 60d1d1e218d7cc733635e8204373975f84e5378e
prerequisite-patch-id: bc1c2e0978c0218e89b4688246abb29cfb30f3ed
prerequisite-patch-id: 552fc576a50730441180bddb040f8f20d44c22bf
prerequisite-patch-id: 1f6c465ad6923a4f3a6f65317d6991fc14831e0a
prerequisite-patch-id: 04e82d07f39bbf895d4b27ef33dee5b81684d54f
prerequisite-patch-id: d995e36e5b3aada77c50167196038197a5832813
prerequisite-patch-id: 2b29b5178f7fb98cf1e892efc5b60f2536ce4111
prerequisite-patch-id: 6fee0aabee5a969ad521674b858f5e66e6340b17
prerequisite-patch-id: beddbe4413ca5017c72930e5baccf848c30e4720
prerequisite-patch-id: ed9f908fe0248117358df72258b4012b5bb4bdc8
prerequisite-patch-id: d6bf4cb011a177317de4bfbcc60194a273fb94bb
prerequisite-patch-id: 9256cb57e75e61498c131c73abd3d85199597f27
prerequisite-patch-id: 30bf0a4d508250570d305f56647722669038d15f
prerequisite-patch-id: 9e40f63a834098eaab622e811474ab2d135d4254
prerequisite-patch-id: 69f3fe4a1795a500bad256630f9bc83eac593b1f
prerequisite-patch-id: 36bc5148952f72204968c3773d41e144337b1bea
prerequisite-patch-id: 14b4d0211431b0e2c1df0564056f5db647a46ac2
prerequisite-patch-id: bdea5856d22551eb7274fd1d28d95a51ecaa3f91
prerequisite-patch-id: 65c58d86d435a080f01b983e1a556d927bad812e
prerequisite-patch-id: 4a3c86016e8ee44173910a3f5f9676dad1920f48
prerequisite-patch-id: bfec763b27d9a39ea682e5b7c68293086f5f6b83
prerequisite-patch-id: 62895aa7ffccdb96f64bb845988dc9e9f35cf7bb
prerequisite-patch-id: 018d595d34d56eab38525728b25c9228b0626bad
prerequisite-patch-id: 85187547fe9df91f66be6fae24a729f3a6a720a9
prerequisite-patch-id: 1bdf97b1664423c00afebd65c5ac115ffee87101
prerequisite-patch-id: 43fea37760dd512c1d66d1b6c3b782acc736564c
prerequisite-patch-id: 152e44ccd557e2f72b1b408ecb70cbe53fb2d0b2
prerequisite-patch-id: 6d7dc1d6284d39d587943010d1f67266a20742a2
prerequisite-patch-id: fe63717be825d9093f95f858060c9781a9c8f346
prerequisite-patch-id: 540e01ec1a711f8bddf7c4065fa16bf357d2cfcb
prerequisite-patch-id: e3f9fd79f994724ef75c233d8a4828653dca13ea
prerequisite-patch-id: 730075a13d109406247c9cd1fedab8bb995fb98b
prerequisite-patch-id: 3f85798f6b4aca520592c5368bef5ba773c90a31
prerequisite-patch-id: 2ca390d1ff76eacdddd01409f1d60f187f75f2eb
prerequisite-patch-id: 8fc2d3d5fa634e3f483e5ec2d7d9f16b55a86ed5
prerequisite-patch-id: b19173597630d0b8f9feb0dacef391ffae24cf93
prerequisite-patch-id: 60cd3c592af7545a094b3ff36db20ecd972e5e8d
prerequisite-patch-id: f7fe67b733c0d23f0912633500a25664b13e1a1d
prerequisite-patch-id: 056e6082d5504898b52935f079ee22b5d45121b9
prerequisite-patch-id: 9612ab1cb6b54fd8f13ad934477e19fafed1d991
prerequisite-patch-id: 7fb12c22a9829f48f484dd386f59ee71f1285408
prerequisite-patch-id: 0af2587d5bf030249355a4aae53811b682774e10
prerequisite-patch-id: 95cd93e705dad88457ba1dc2e7151122ff9676a5
prerequisite-patch-id: f7321181dabf7cf557c1c29aefaefc0f77609368
prerequisite-patch-id: 6e60177c1ea46cce156db8871c4545f4538370a5
prerequisite-patch-id: bb5bc97fbb562618b0dd7f71ec63657a5dfbdf43
prerequisite-patch-id: bd7e7509fd4f346ef49d6906f2ea0b8e77650bee
prerequisite-patch-id: f761b1c3744dea3597a4d5ddd4a2bbbe63147bf2
prerequisite-patch-id: ae7f23237236a5fe24e832c05d7f8de0f1e1c523
prerequisite-patch-id: 25eb75377e75220efa62e620e4a8cde55321c5e9
prerequisite-patch-id: b15bcf3959e7d94a8ea62f96e5ad1d30f866348f
prerequisite-patch-id: 627eedc60ec745d71d0aaab09c454d00c69ac591
prerequisite-patch-id: c4e78ccbc5a433df7e453a24cab4b03f5cbd6575
prerequisite-patch-id: b6ae48f2c4f7fba67e057e87fc3699618487b692
prerequisite-patch-id: 942f2c0543468b39cff2e92b553448ae3a1e6289
prerequisite-patch-id: c3be38542329d11164ec776a19c9fbf0aa630bb5
prerequisite-patch-id: d66c6b09be5a9f266936009b975038e958170930
prerequisite-patch-id: 05761f817107947c37876c08ce8989b9d9195c48
prerequisite-patch-id: 9c6f8d5508bd80382f9fa334b715d83fb1ba528e
prerequisite-patch-id: d92a5fa2ac6062ee2429903f257ef6d8323c113e
prerequisite-patch-id: 6b54f62e87c24c7d5effad02a9bdb1eafc134ef8
prerequisite-patch-id: a0fefc620da07b1c5a0c9fba93772b51645e7dcd
prerequisite-patch-id: 3385c9d6f916ff35578fd73b6bdae383b1f7fad3
prerequisite-patch-id: 196a8ecc57e534c1297fe9ede0cf697464dc7998
prerequisite-patch-id: b08eb25c238bf2dc353503231242162d4d7005cd
prerequisite-patch-id: e9470714c3b55c15be4e449907f1a94eab49d092
prerequisite-patch-id: 12b0a6ea2d24480fa5ddbc3a03fd5c7d1f65f37a
prerequisite-patch-id: b03bdcbf3f24f1e35a48db8f65407751aee5b97d
prerequisite-patch-id: b59e6f8e922f4a46bbc112b1ac4a5812df4cd7b7
prerequisite-patch-id: 22951b20460a6f4836e887211bf071d1db40dac8
prerequisite-patch-id: 5e7015a662bed1cccc791f7daa37d9bbf5125580
prerequisite-patch-id: 6fb81054c3b3cb938db7b20c72b6839ffc3f8056
prerequisite-patch-id: 93398a12c316896fbf58280864a7f1656ac8d036
prerequisite-patch-id: 4f02bf90c833567c7e67fe8edfc3a762ff64097e
prerequisite-patch-id: 3147c530ddde6aa40387459e666139512e1b54eb
prerequisite-patch-id: 87b99baac10f8fd63c3f5a0cc82428ed47f9e722
prerequisite-patch-id: d12b10c0e635336d9d61a7183ec77d952c41e44d
prerequisite-patch-id: b00a5fd71d011fb0389afc3cf6346204e4876d91
prerequisite-patch-id: 118fcee41178cdee2dc720dbaf5ffe7b55c27421
prerequisite-patch-id: c531e83bba0ef2d1d819e694b89dcd16e38b7ebb
prerequisite-patch-id: e93fa81a8f042bb4589a230c7a8894f766dbad26
prerequisite-patch-id: 85ce10da290d5be5369f6c77a423b014c08e041e
prerequisite-patch-id: 96a0587f0222ae7e92cb81d560bbc6286a4e4e53
prerequisite-patch-id: e2d798469112acbd440368a9179356e646c986af
prerequisite-patch-id: e02961bcb591f312a9ed637f25604272ec157612
prerequisite-patch-id: 997606fb3b3c9f4eacef1711920ae7cbf931b4c7
prerequisite-patch-id: 6e3f5ad9d35f5431fc899db265665ab6f51be86a
prerequisite-patch-id: 56f8c7962b6747837eaf28df0f9e1135f17997b2
prerequisite-patch-id: fffb58523b885658dbc6e205ca46471446f9373f
prerequisite-patch-id: 2adfce2549f5c75292b548418d1d17d456cae3ae
prerequisite-patch-id: ef3f7a1a43b531c36a9df1379b5adf46a9777287
prerequisite-patch-id: fbace3e480529f8b2eb6f62b2cbe56764c5cad3f
prerequisite-patch-id: 78dc7193134a156354f900f4e4f4bb3108ad35ec
prerequisite-patch-id: 6ed682cc740094811903a8b264a58d6e40eb3f6f
prerequisite-patch-id: c053a8bfa9e7b728f5df8f836aea7dfa2c2e2764
prerequisite-patch-id: c2bdd76911123dfb7e8d2379f0b5ee0083584615
prerequisite-patch-id: 114f107535c02da3db007b60f89a5f08e8cb9e7b
prerequisite-patch-id: 20bdc76f1e7ced33345b0bdb6a05423d5da1768d
prerequisite-patch-id: 7d8c4a73a89f20742c1dbe418ad87e8c64a50748
prerequisite-patch-id: ae846ffdbea27fc4d4699dc0d09e068c6a7bbfdb
prerequisite-patch-id: b95c5adb0e1b40fb38e508f66fd468941374dac6
prerequisite-patch-id: ea1d677694363f8fb3fd75f39ec243b126ccb972
prerequisite-patch-id: 91df60fe9b09bddd8ffb962d6656dc702fc8a969
prerequisite-patch-id: 404623eb00b276840dd04d0e3c02da53bbcc1e13
prerequisite-patch-id: c491da903429f4e5a29925e8a3cfb5d4b72c5728
prerequisite-patch-id: a5a1656c5af1f20c85b3aabbfc10bb74e94438f0
prerequisite-patch-id: 3d0cb518e47b404d58c4c5d67bdb304c0e24ece6
prerequisite-patch-id: 051e263cafca7b9d6d21bb480ae9a46ab09c1421
prerequisite-patch-id: 57d39ad871b8463614c157d8d438e9a3544705b2
prerequisite-patch-id: b6c8b5ebcfe614b0394277cefe3907e16e59e739
prerequisite-patch-id: 55fef814862ef62c33349c4101a97c002c1ae249
prerequisite-patch-id: 826dab0c836c8833d8e14fa086561737dd100d39
prerequisite-patch-id: 0d5d371130ab806e88b9a9a01ee9573a2b1bf045
prerequisite-patch-id: c7a22c4ed9d181d04e91ced34218519825ad1624
prerequisite-patch-id: 8232f6c82f4e59dc1c4670ef50a1bed4d0eb8ca1
prerequisite-patch-id: b89fa3ed52c5722a78a92babba129b6abc86461c
prerequisite-patch-id: e32453c20d63498f2c5222311103c706a06613d6
prerequisite-patch-id: b4fc9650350489ddfbe1cb48431cfaff18dbade4
prerequisite-patch-id: 24eec58d2681e8f64bc5d13b55c538aa4c9c65a1
prerequisite-patch-id: be63d388bfc3f5724bab81003b369c1a340ad449
prerequisite-patch-id: 1d7e444e153faaa7873ba728774155485de3d0ba
prerequisite-patch-id: ab5f83a042eb097462e990ef93a366475c54a1ca
prerequisite-patch-id: 9d4091ed0037a0e8054c9250ccacf90c90d5619a
prerequisite-patch-id: 60a1936f623ceb0659c09fe6d9da41925e299b3c
prerequisite-patch-id: dde1995574b39b3a7ccf33d9edc6ead986a58c57
prerequisite-patch-id: bf180a9271bcc965aa2ac4cf586f9a6244641181
prerequisite-patch-id: 9683fcd5c9f8a33d2f3541c80e2710ad584a254b
prerequisite-patch-id: eee1ed54397e12eccea7f61e45c922b70d94e858
prerequisite-patch-id: 2cb532cb4769c0494b85a779f1797db2c08aafda
prerequisite-patch-id: fab49e14250f91ee1ff4f76a0ffe9396c0f983ce
prerequisite-patch-id: b6ee3db688395bf18fccacdc0ae016df34ff8580
prerequisite-patch-id: 5e77101b01cf13ee1270138da843388425902ef2
prerequisite-patch-id: e8daebeff379384a39e5de0d6218b0013131d200
prerequisite-patch-id: 0297f5c2dd64824a94d8c6705cee01a028fb0602
prerequisite-patch-id: b10eb608ee88c113c71fd532bffcb1a17c4e61cf
prerequisite-patch-id: 5a2ef3bb31e2f8a18a257b6d6d0a68aa74cbc588
prerequisite-patch-id: cc0c9b5125e94f1c7410bbd9eff8d0a2c422eb94
prerequisite-patch-id: 069577e142319636e3aaac5256f67a0b24327a43
prerequisite-patch-id: 18a276cb0d5c3c41e79c7161c7dd2203f1d3fefd
prerequisite-patch-id: 4c1ee02b20c59a877afa2c5829d12b2c55fc53cc
prerequisite-patch-id: aa3f0f6da0713c0d14bde1b3819e61774a02a0fc
prerequisite-patch-id: e41defc10133ec592c7043d6de01c799f5e332db
prerequisite-patch-id: f603aa36cd060848b38d2f1c04de598fcb8e8ba7
prerequisite-patch-id: 45aac55b805ae74f95e65668da06c0544fabe421
prerequisite-patch-id: 8b8dbb29737e36bec013a6b454c185226e4553dc
prerequisite-patch-id: b578d8d6569077ad63a57bc05eb6996368a7295d
prerequisite-patch-id: 85d161d5a66b6f8373e96243bce4e904e0ae476e
prerequisite-patch-id: a9a767ea2e36393187e5a167694986e4e74f353b
prerequisite-patch-id: 354c627d155b52bb7dcc085a12a574ce615ebdb4
prerequisite-patch-id: 45808ed9719d8f9ba8488225a35800baf12ec962
prerequisite-patch-id: dbfb23ae238fc200dcce187977ae28e614b59b1d
-- 
2.46.0