Simone Pelosi has proposed merging ~pelpsi/launchpad-buildd:delete-apt-cache-before-craft-tools into launchpad-buildd:master.
Commit message: Delete apt cache before the fetch-service set up The fetch-service needs to be aware of all the contents of the Ubuntu archives in order to validate the requests for installations of packages that the application makes. The way that we have implemented this now means deleting Apt's cache and call apt update right after the set-up so that all of Apt's requests go through the fetch-service. https://warthogs.atlassian.net/browse/LP-1822 Requested reviews: Launchpad code reviewers (launchpad-reviewers) For more details, see: https://code.launchpad.net/~pelpsi/launchpad-buildd/+git/launchpad-buildd/+merge/472976 -- Your team Launchpad code reviewers is requested to review the proposed merge of ~pelpsi/launchpad-buildd:delete-apt-cache-before-craft-tools into launchpad-buildd:master.
diff --git a/debian/changelog b/debian/changelog index d30ede4..6702e8f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +launchpad-buildd (243) UNRELEASED; urgency=medium + + * Delete apt cache before fetch-service set up. + + -- Simone Pelosi <simone.pel...@canonical.com> Tue, 10 Sep 2024 16:38:55 +0200 + launchpad-buildd (242) focal; urgency=medium [ Quentin Debhi ] diff --git a/lpbuildd/target/build_snap.py b/lpbuildd/target/build_snap.py index 18af73a..b92127b 100644 --- a/lpbuildd/target/build_snap.py +++ b/lpbuildd/target/build_snap.py @@ -226,8 +226,15 @@ class BuildSnap( # jugmac00 reached out both to William and Claudio to figure out self.install_svn_servers() if self.args.use_fetch_service: + # Deleting apt cache /var/lib/apt/lists before + # installing the fetch service + self.backend.run( + ["rm", "-rf", "/var/lib/apt/lists/*"] + ) self.install_mitm_certificate() self.install_snapd_proxy(proxy_url=self.args.proxy_url) + # Call apt update to refresh the apt cache + self.backend.run(["apt-get", "-y", "update"]) self.restart_snapd() def repo(self): diff --git a/lpbuildd/target/tests/test_build_snap.py b/lpbuildd/target/tests/test_build_snap.py index de830a0..3a7bc6c 100644 --- a/lpbuildd/target/tests/test_build_snap.py +++ b/lpbuildd/target/tests/test_build_snap.py @@ -227,6 +227,7 @@ class TestBuildSnap(TestCase): "install", "python3", "socat", "git", "snapcraft" ), RanCommand(["mkdir", "-p", "/root/.subversion"]), + RanCommand(["rm", "-rf", "/var/lib/apt/lists/*"]), RanCommand(["update-ca-certificates"]), RanCommand( [ @@ -244,6 +245,7 @@ class TestBuildSnap(TestCase): "proxy.https=http://proxy.example:3128/", ] ), + RanAptGet("update"), RanCommand( [ "systemctl", @@ -310,6 +312,7 @@ class TestBuildSnap(TestCase): "install", "python3", "socat", "git", "snapcraft" ), RanCommand(["mkdir", "-p", "/root/.subversion"]), + RanCommand(["rm", "-rf", "/var/lib/apt/lists/*"]), RanCommand(["update-ca-certificates"]), RanCommand( [ @@ -327,6 +330,7 @@ class TestBuildSnap(TestCase): "proxy.https=http://proxy.example:3128/", ] ), + RanAptGet("update"), RanCommand( [ "systemctl",
_______________________________________________ Mailing list: https://launchpad.net/~launchpad-reviewers Post to : launchpad-reviewers@lists.launchpad.net Unsubscribe : https://launchpad.net/~launchpad-reviewers More help : https://help.launchpad.net/ListHelp