From 9adc9f7a6e104fdd8bcfc2e91891bec39ede9be1 Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Tue, 21 May 2024 15:17:21 +0530 Subject: use read -r --- blocks/Dockerfile | 11 ++++------- blocks/Dockerfile.patch | 8 ++++---- blocks/eda-frontend/Dockerfile | 7 ------- blocks/eda-frontend/README.md | 34 ---------------------------------- blocks/install.sh | 23 +++++++++++------------ blocks/xcos2xml/portcount.sh | 2 +- 6 files changed, 20 insertions(+), 65 deletions(-) delete mode 100644 blocks/eda-frontend/Dockerfile delete mode 100644 blocks/eda-frontend/README.md diff --git a/blocks/Dockerfile b/blocks/Dockerfile index 6aaecf6a..87f33108 100644 --- a/blocks/Dockerfile +++ b/blocks/Dockerfile @@ -19,7 +19,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update -qq && \ apt-get install -qq --no-install-recommends gcc g++ libgfortran5 make nginx openjdk-8-jre python3 redis sqlite3 tzdata && \ apt-get clean -qq && \ - rm -f /var/lib/apt/lists/*_* + rm -rf /var/lib/apt/lists/* # Set timezone info RUN ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime && \ @@ -91,12 +91,9 @@ RUN find . -mindepth 1 -type d -empty -print0 | xargs -0 rmdir -p 2> /dev/null | # Cleanup RUN find /usr/local/share/scilab -depth -type d \( -name demos -o -name examples -o -name tests \) -print0 | \ xargs -0 rm -rf -RUN ls /usr/local/share/locale | grep _ | grep -v en_US | \ - while read -r d; do \ - find . -type d -name "$d" -print0 | xargs -r0 rm -rf; \ - done +RUN find /usr/local/share/locale -mindepth 1 -maxdepth 1 -type d -name \*_\* ! -name en_US -print0 | xargs -r0 rm -rf RUN apt-get clean -qq -RUN rm -f /var/lib/apt/lists/*_* +RUN rm -rf /var/lib/apt/lists/* RUN rm -f /etc/{passwd,shadow,group,gshadow}- # Comparison @@ -126,7 +123,7 @@ RUN ./install.sh # Cleanup RUN apt-get autoremove -qq --purge gawk python3-pip python3-venv wget xz-utils RUN apt-get clean -qq -RUN rm -f /var/lib/apt/lists/*_* +RUN rm -rf /var/lib/apt/lists/* RUN rm -rf ${HOME}/.cache RUN rm -rf ${HOME}/.npm diff --git a/blocks/Dockerfile.patch b/blocks/Dockerfile.patch index b933c455..3b775536 100644 --- a/blocks/Dockerfile.patch +++ b/blocks/Dockerfile.patch @@ -1,6 +1,6 @@ ---- blocks/Dockerfile 2024-03-22 13:29:04.368574427 +0530 -+++ blocks/Dockerfile.1 2024-03-22 20:47:14.630043479 +0530 -@@ -121,7 +121,7 @@ +--- blocks/Dockerfile 2024-05-21 17:16:25.937563973 +0530 ++++ blocks/Dockerfile.1 2024-05-21 17:17:14.925514110 +0530 +@@ -118,7 +118,7 @@ COPY . . # Configure venv and sqlite3 @@ -9,7 +9,7 @@ # Cleanup RUN apt-get autoremove -qq --purge gawk python3-pip python3-venv wget xz-utils -@@ -172,4 +172,4 @@ +@@ -169,4 +169,4 @@ WORKDIR ${XCOS_DIR} diff --git a/blocks/eda-frontend/Dockerfile b/blocks/eda-frontend/Dockerfile deleted file mode 100644 index 0a49e4d5..00000000 --- a/blocks/eda-frontend/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM node:10-alpine3.11 - -RUN mkdir /code -WORKDIR /code - -COPY package.json /code/package.json -COPY package-lock.json /code/package-lock.json diff --git a/blocks/eda-frontend/README.md b/blocks/eda-frontend/README.md deleted file mode 100644 index 838922d5..00000000 --- a/blocks/eda-frontend/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# EDA Frontend - -### React application for EDA frontend - -
- -## Prerequisites - -#### Install Node JS -Refer to https://nodejs.org/en/ to install nodejs - -
- -## Cloning and Running the Application in local - -Clone the project into local - -#### Install all the npm packages. -Go into the project folder and type the following command to install all npm packages and dependencies - -```bash -npm install -``` - -In order to run the application Type the following command - -```bash -npm start -``` -Runs the application in the development mode.
-Open **[localhost:3000](http://localhost:3000)** to view it in the browser. - -The page will reload if you make edits.
-You will also see any lint errors in the console. diff --git a/blocks/install.sh b/blocks/install.sh index c2937ee9..f9f67d74 100755 --- a/blocks/install.sh +++ b/blocks/install.sh @@ -2,18 +2,6 @@ set -e -cd eda-frontend -if test "$1" = 'prod'; then - npm install -g serve -fi -npm install --silent -if test "$1" = 'prod'; then - npm run build - rm -rf node_modules public src -fi -echo 'WDS_SOCKET_PORT=8000' > .env.local - -cd .. python3 -m venv env . env/bin/activate pip install -q -U pip setuptools wheel @@ -55,3 +43,14 @@ sed -i -e '/^\s*location \/ {/,/^\s*}/c\ proxy_buffering off;\ proxy_cache off;\ }' /etc/nginx/sites-enabled/default + +cd eda-frontend +if test "$1" = 'prod'; then + npm install -g serve +fi +npm install --silent +if test "$1" = 'prod'; then + npm run build + rm -rf node_modules public src +fi +echo 'WDS_SOCKET_PORT=8000' > .env.local diff --git a/blocks/xcos2xml/portcount.sh b/blocks/xcos2xml/portcount.sh index 5b647a09..1003c877 100755 --- a/blocks/xcos2xml/portcount.sh +++ b/blocks/xcos2xml/portcount.sh @@ -2,7 +2,7 @@ sqlite3 xcosblocks.sqlite3 < xcos2xml/portcount.sql > portcount.csv -while read line; do +while read -r line; do IFS=',' read -r block_name explicitInputPorts implicitInputPorts explicitOutputPorts implicitOutputPorts controlPorts commandPorts dummy <<< "$line" file=xcos2xml/blocks/$block_name.xsl if ! test -f $file; then -- cgit