[Merge] ~patviafore/livecd-rootfs/+git/livecd-rootfs:use_ftpmaster_instead_of_archive_in_binary_hooks into livecd-rootfs:ubuntu/master

Pat Viafore patrick.viafore at canonical.com
Tue May 19 13:25:07 UTC 2020



Diff comments:

> diff --git a/debian/changelog b/debian/changelog
> index 88e725f..f4382e2 100644
> --- a/debian/changelog
> +++ b/debian/changelog
> @@ -1,3 +1,11 @@
> +livecd-rootfs (2.667) UNRELEASED; urgency=medium

I don't write the ultimate changelog that goes in, and I believe who uploads the package modifies this. This is the default a dch -i gives you.

> +
> +  * Replace archive.ubuntu.com and security.ubuntu.com with launchpad
> +    mirrors. This is only done inside a build context, and the original
> +    sources.list file is restored at the end of the build.
> +
> + -- Patrick Viafore <patrick.viafore at canonical.com>  Tue, 12 May 2020 11:49:11 -0500
> +
>  livecd-rootfs (2.666) groovy; urgency=medium
>  
>    [ Balint Reczey ]
> diff --git a/live-build/functions b/live-build/functions
> index e9fbb50..b58f63f 100644
> --- a/live-build/functions
> +++ b/live-build/functions
> @@ -87,6 +87,42 @@ mount_image() {
>      return 0
>  }
>  
> +use_lp_archives_in_sourceslist(){
> +    # Use the build environment apt mirror during the build,
> +    # for both archive and security.
> +    # live-build does this in the chroot (lb_chroot_archives)
> +    # but not for the binary hooks
> +    #
> +    # To restore the sourceslist back to the original, call
> +    # recover_sourceslist
> +
> +    mountpoint="${1}"
> +    MOUNTPOINT_BACKUP_SOURCES_LIST="sources.list.tmp"
> +    . config/bootstrap  # For the LB_MIRROR_* variables
> +    cp -a "${mountpoint}/etc/apt/sources.list" "${MOUNTPOINT_BACKUP_SOURCES_LIST}"
> +    sed -i "s#http://archive.ubuntu.com/ubuntu#${LB_PARENT_MIRROR_CHROOT}#g" \

I've tried in ubuntu-old-fashioned, and it just points to archive.ubuntu.com.

> +        "${mountpoint}/etc/apt/sources.list"
> +    sed -i "s#http://security.ubuntu.com/ubuntu#${LB_PARENT_MIRROR_CHROOT}#g" \
> +        "${mountpoint}/etc/apt/sources.list"
> +
> +    sha256sum "${mountpoint}/etc/apt/sources.list" > sources.list.sha
> +}
> +
> +recover_sourceslist(){
> +    # Remove the build environment apt mirror from the image
> +
> +    # Check that the sources.list has not changed.  If it has changed then the
> +    # binary hook has modified the file that will be discarded.  If the build
> +    # fails here the binary hook needs to alter sources.list.tmp and regenerate
> +    # sources.list.sha
> +
> +    mountpoint="${1}"
> +    sha256sum --check sources.list.sha
> +
> +    mv "${MOUNTPOINT_BACKUP_SOURCES_LIST}" "${mountpoint}/etc/apt/sources.list"
> +    unset MOUNTPOINT_BACKUP_SOURCES_LIST
> +}
> +
>  setup_mountpoint() {
>      local mountpoint="$1"
>  


-- 
https://code.launchpad.net/~patviafore/livecd-rootfs/+git/livecd-rootfs/+merge/383790
Your team Ubuntu Core Development Team is requested to review the proposed merge of ~patviafore/livecd-rootfs/+git/livecd-rootfs:use_ftpmaster_instead_of_archive_in_binary_hooks into livecd-rootfs:ubuntu/master.



More information about the Ubuntu-reviews mailing list