[PATCH] targets: Don't delete pyc/pyo files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] targets: Don't delete pyc/pyo files

Matt Turner-5
These files are actually owned by their packages now, and removing them
can break subsequent builds.

See https://archives.gentoo.org/gentoo-releng-autobuilds/message/a115781f8e7fb4bd5adfb94a7f2e63b4

Signed-off-by: Matt Turner <[hidden email]>
---
I'm minimally concerned about the potential for increasing the size of
the ISO. I'll report back with numbers.

 targets/livecd-stage1/controller.sh | 4 ----
 targets/livecd-stage2/controller.sh | 2 --
 targets/stage1/preclean-chroot.sh   | 2 --
 3 files changed, 8 deletions(-)

diff --git a/targets/livecd-stage1/controller.sh b/targets/livecd-stage1/controller.sh
index ced2634e..c4572ff9 100755
--- a/targets/livecd-stage1/controller.sh
+++ b/targets/livecd-stage1/controller.sh
@@ -13,9 +13,5 @@ case $1 in
  ${clst_shdir}/${clst_target}/chroot.sh
  echo "${clst_packages}" > ${clst_chroot_path}/tmp/packages.txt
  ;;
-
- clean)
- find ${clst_chroot_path}/usr/lib -iname "*.pyc" -exec rm -f {} \;
- ;;
 esac
 exit $?
diff --git a/targets/livecd-stage2/controller.sh b/targets/livecd-stage2/controller.sh
index 8ee46d7c..0701a26b 100755
--- a/targets/livecd-stage2/controller.sh
+++ b/targets/livecd-stage2/controller.sh
@@ -85,8 +85,6 @@ case $1 in
  then
  # Clean out man, info and doc files
  rm -rf ${clst_chroot_path}/usr/share/{man,doc,info}/*
- # Zap all .pyc and .pyo files
- find ${clst_chroot_path}/usr/lib* -iname "*.py[co]" -exec rm -f {} \;
  fi
  rm -f ${clst_chroot_path}/tmp/packages.txt
  ;;
diff --git a/targets/stage1/preclean-chroot.sh b/targets/stage1/preclean-chroot.sh
index ea9056e8..2dc761e9 100755
--- a/targets/stage1/preclean-chroot.sh
+++ b/targets/stage1/preclean-chroot.sh
@@ -22,8 +22,6 @@ fi
 
 # Clean out man, info and doc files
 rm -rf "${ROOT}"/usr/share/{man,doc,info}/*
-# Zap all .pyc and .pyo files
-find "${ROOT}"/ -iname "*.py[co]" -exec rm -f {} \;
 
 # unset ROOT for safety (even though cleanup_stages doesn't use it)
 unset ROOT
--
2.26.2


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] targets: Don't delete pyc/pyo files

Matt Turner-5
On Sat, May 16, 2020 at 4:29 PM Matt Turner <[hidden email]> wrote:

>
> These files are actually owned by their packages now, and removing them
> can break subsequent builds.
>
> See https://archives.gentoo.org/gentoo-releng-autobuilds/message/a115781f8e7fb4bd5adfb94a7f2e63b4
>
> Signed-off-by: Matt Turner <[hidden email]>
> ---
> I'm minimally concerned about the potential for increasing the size of
> the ISO. I'll report back with numbers.
>
>  targets/livecd-stage1/controller.sh | 4 ----
>  targets/livecd-stage2/controller.sh | 2 --
>  targets/stage1/preclean-chroot.sh   | 2 --
>  3 files changed, 8 deletions(-)
>
> diff --git a/targets/livecd-stage1/controller.sh b/targets/livecd-stage1/controller.sh
> index ced2634e..c4572ff9 100755
> --- a/targets/livecd-stage1/controller.sh
> +++ b/targets/livecd-stage1/controller.sh
> @@ -13,9 +13,5 @@ case $1 in
>                         ${clst_shdir}/${clst_target}/chroot.sh
>                 echo "${clst_packages}" > ${clst_chroot_path}/tmp/packages.txt
>                 ;;
> -
> -       clean)
> -               find ${clst_chroot_path}/usr/lib -iname "*.pyc" -exec rm -f {} \;
> -               ;;
>  esac
>  exit $?
> diff --git a/targets/livecd-stage2/controller.sh b/targets/livecd-stage2/controller.sh
> index 8ee46d7c..0701a26b 100755
> --- a/targets/livecd-stage2/controller.sh
> +++ b/targets/livecd-stage2/controller.sh
> @@ -85,8 +85,6 @@ case $1 in
>                 then
>                         # Clean out man, info and doc files
>                         rm -rf ${clst_chroot_path}/usr/share/{man,doc,info}/*
> -                       # Zap all .pyc and .pyo files
> -                       find ${clst_chroot_path}/usr/lib* -iname "*.py[co]" -exec rm -f {} \;

I think we may want to keep this intact for livecd-stage2. The ISO
sizes goes from 286M to 305M.

What do other people think?

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] targets: Don't delete pyc/pyo files

Brian Dolbec-3
On Sat, 16 May 2020 17:38:19 -0700
Matt Turner <[hidden email]> wrote:

> On Sat, May 16, 2020 at 4:29 PM Matt Turner <[hidden email]>
> wrote:
> >
> > These files are actually owned by their packages now, and removing
> > them can break subsequent builds.
> >
> > See
> > https://archives.gentoo.org/gentoo-releng-autobuilds/message/a115781f8e7fb4bd5adfb94a7f2e63b4
> >
> > Signed-off-by: Matt Turner <[hidden email]>
> > ---
> > I'm minimally concerned about the potential for increasing the size
> > of the ISO. I'll report back with numbers.
> >
> >  targets/livecd-stage1/controller.sh | 4 ----
> >  targets/livecd-stage2/controller.sh | 2 --
> >  targets/stage1/preclean-chroot.sh   | 2 --
> >  3 files changed, 8 deletions(-)
> >
> > diff --git a/targets/livecd-stage1/controller.sh
> > b/targets/livecd-stage1/controller.sh index ced2634e..c4572ff9
> > 100755 --- a/targets/livecd-stage1/controller.sh
> > +++ b/targets/livecd-stage1/controller.sh
> > @@ -13,9 +13,5 @@ case $1 in
> >                         ${clst_shdir}/${clst_target}/chroot.sh
> >                 echo "${clst_packages}" >
> > ${clst_chroot_path}/tmp/packages.txt ;;
> > -
> > -       clean)
> > -               find ${clst_chroot_path}/usr/lib -iname "*.pyc"
> > -exec rm -f {} \;
> > -               ;;
> >  esac
> >  exit $?
> > diff --git a/targets/livecd-stage2/controller.sh
> > b/targets/livecd-stage2/controller.sh index 8ee46d7c..0701a26b
> > 100755 --- a/targets/livecd-stage2/controller.sh
> > +++ b/targets/livecd-stage2/controller.sh
> > @@ -85,8 +85,6 @@ case $1 in
> >                 then
> >                         # Clean out man, info and doc files
> >                         rm -rf
> > ${clst_chroot_path}/usr/share/{man,doc,info}/*
> > -                       # Zap all .pyc and .pyo files
> > -                       find ${clst_chroot_path}/usr/lib* -iname
> > "*.py[co]" -exec rm -f {} \;  
>
> I think we may want to keep this intact for livecd-stage2. The ISO
> sizes goes from 286M to 305M.
>
> What do other people think?
>

Does anyone actually burn CD's anymore?  Rarely I think.  I stopped
putting in a CD/DVD drive in systems years ago.  If I did need to, I
have several on older machines I can use along with a bunch of unused
blanks.

USB sticks are so cheap and much easier to use with a lot more space to
even be able to emerge addtional pkgs on that the livedvd image enables.

You can get a 5pak of 16gb drives for $20.   5pak of 8GB are $15 or
less...

I wouldn't worry about a few extra bytes to download.