raspberry-pi-cross-compilers icon indicating copy to clipboard operation
raspberry-pi-cross-compilers copied to clipboard

rm *.tar.* makes the builder to stop

Open sleeperss opened this issue 2 years ago • 1 comments

Hi,

In the builderscript there is multiple rm *.tar.* that doesn't remove anything (for example if we reach an if statement that use git instead of a tarball as in lines 184-195).

But without the -f option it leads the script to stop.

Solution : add the -f argument to each rm lines.

Patch :

--- r	2022-04-29 22:38:04.415101400 +0200
+++ rr	2022-04-29 22:38:12.395101400 +0200
@@ -164,10 +164,10 @@
       sed -i contrib/download_prerequisites -e '/base_url=/s/ftp/http/'
    fi
    contrib/download_prerequisites
-   rm -f ./*.tar.*
+   rm ./*.tar.*
    if [ "$GCCBASE_VERSION" = "6.3.0" ]; then sed -i "1474s/.*/      || xloc.file[0] == '\\\0' || xloc.file[0] == '\\\xff'/" ./gcc/ubsan.c; fi #apply patch
    cd "$DOWNLOADDIR" || exit
-   rm -f ./*.tar.*
+   rm ./*.tar.*
 fi
 if [ ! -d "binutils-$BINUTILS_VERSION" ]; then
    if [ ! -f "binutils-$BINUTILS_VERSION.tar.bz2" ]; then
@@ -177,7 +177,7 @@
    cd binutils-$BINUTILS_VERSION || exit
    mkdir -p build
    cd "$DOWNLOADDIR" || exit
-   rm -f ./*.tar.*
+   rm ./*.tar.*
 fi
 if [ ! -d "glibc-$GLIBC_VERSION" ]; then
    # Download patched Glibc 2.31 if GCC 10 series are being built
@@ -192,7 +192,7 @@
    cd glibc-$GLIBC_VERSION || exit
    mkdir -p build
    cd "$DOWNLOADDIR" || exit
-   rm -f ./*.tar.*
+   rm ./*.tar.*
 fi
 if [ ! -d "gdb-$GDB_VERSION" ]; then
    if [ ! -f "gdb-$GDB_VERSION.tar.xz" ]; then
@@ -202,7 +202,7 @@
    cd gdb-$GDB_VERSION || exit
    mkdir -p build
    cd "$DOWNLOADDIR" || exit
-   rm -f ./*.tar.*
+   rm ./*.tar.*
 fi
 if [ ! -d "gcc-$GCC_VERSION" ]; then
    # Download patched GCC 10 series for bullseye
@@ -218,9 +218,9 @@
    mkdir -p build
    sed -i contrib/download_prerequisites -e '/base_url=/s/ftp/http/'
    contrib/download_prerequisites
-   rm -f ./*.tar.*
+   rm ./*.tar.*
    cd "$DOWNLOADDIR" || exit
-   rm -f ./*.tar.*
+   rm ./*.tar.*
 fi
 
 echo "Setting up paths..."

sleeperss avatar Apr 29 '22 20:04 sleeperss

@sleeperss Again thanks for this suggestion. Any related PR will always be welcomed. 😃

abhiTronix avatar Apr 30 '22 05:04 abhiTronix