← Back to team overview

sts-sponsors team mailing list archive

[Merge] ~alexsander-souza/maas:lp2008275_to_3_3 into maas:3.3

 

Alexsander de Souza has proposed merging ~alexsander-souza/maas:lp2008275_to_3_3 into maas:3.3.

Commit message:
Fix Perl environment on snap
    
- Get Perl version dynamically
- Copy Perl modules to snap tree
    
fixes LP#2008275
    
(cherry picked from commit 44b74341479ed26fd57960cf7d77a6c33045801d)


Requested reviews:
  MAAS Maintainers (maas-maintainers)
Related bugs:
  Bug #2008275 in MAAS: "Intel AMT support is broken in MAAS 3.3.0"
  https://bugs.launchpad.net/maas/+bug/2008275

For more details, see:
https://code.launchpad.net/~alexsander-souza/maas/+git/maas/+merge/438393
-- 
Your team MAAS Committers is subscribed to branch maas:3.3.
diff --git a/snap/local/tree/bin/run-rackd b/snap/local/tree/bin/run-rackd
index 9de909b..30f8c18 100755
--- a/snap/local/tree/bin/run-rackd
+++ b/snap/local/tree/bin/run-rackd
@@ -30,6 +30,7 @@ export MAAS_HTTP_CONFIG_DIR="$SNAP_DATA/http"
 
 # Set up perl so that amttool can run.
 export PERL5LIB
-PERL5LIB="$SNAP/usr/share/perl5:$SNAP/usr/share/perl/5.30:$SNAP/usr/lib/$(uname -m)-linux-gnu/perl/5.30"
+PERLVER=$(perl -MConfig -e 'printf("%d.%d", $Config{"PERL_REVISION"}, $Config{PERL_VERSION});')
+PERL5LIB="$SNAP/usr/share/perl5:$SNAP/usr/share/perl/${PERLVER}:$SNAP/usr/lib/$(uname -m)-linux-gnu/perl/${PERLVER}"
 
 exec "$SNAP/bin/rackd"
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index f323146..adfa189 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -196,6 +196,8 @@ parts:
       - usr/share/keyrings
       - usr/share/maas
       - usr/share/nginx
+      - usr/share/perl
+      - usr/share/perl5
       - usr/share/squid*
       - var/lib/ieee-data
     override-build: |

Follow ups