Skip to content

updates Node, SQLite #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ RUN gem install --no-document \
# https://www.sqlite.org/howtocompile.html#compiling_the_command_line_interface
COPY shell.c.patch /tmp
RUN cd /tmp && \
curl --remote-name https://www.sqlite.org/2023/sqlite-amalgamation-3440000.zip && \
unzip sqlite-amalgamation-3440000.zip && \
rm --force sqlite-amalgamation-3440000.zip && \
cd sqlite-amalgamation-3440000 && \
curl --remote-name https://www.sqlite.org/2023/sqlite-amalgamation-3440200.zip && \
unzip sqlite-amalgamation-3440200.zip && \
rm --force sqlite-amalgamation-3440200.zip && \
cd sqlite-amalgamation-3440200 && \
patch shell.c < /tmp/shell.c.patch && \
gcc -D HAVE_READLINE -D SQLITE_DEFAULT_FOREIGN_KEYS=1 -D SQLITE_OMIT_DYNAPROMPT=1 shell.c sqlite3.c -lpthread -ldl -lm -lreadline -lncurses -o /usr/local/bin/sqlite3 && \
cd .. && \
rm --force --recursive sqlite-amalgamation-3440000 && \
rm --force --recursive sqlite-amalgamation-3440200 && \
rm --force /tmp/shell.c.patch


Expand All @@ -94,7 +94,7 @@ RUN cd /tmp && \
# https://github.com/tj/n#installation
RUN curl --location https://github.com/raw/tj/n/master/bin/n --output /usr/local/bin/n && \
chmod a+x /usr/local/bin/n && \
n 21.2.0
n 21.5.0


# Install GitHub CLI
Expand Down Expand Up @@ -198,14 +198,16 @@ RUN curl https://packagecloud.io/install/repositories/cs50/repo/script.deb.sh |

# Install Node.js packages
RUN npm install --global \
http-server
http-server@14.1.1 `# Fixate for patch`


# Patch index.js in http-server
COPY index.js.patch /tmp
COPY http-server.patch index.js.patch /tmp
RUN cd /usr/local/lib/node_modules/http-server/lib/core/show-dir && \
patch index.js < /tmp/index.js.patch && \
rm --force /tmp/index.js.patch
cd /usr/local/lib/node_modules/http-server/bin && \
patch http-server < /tmp/http-server.patch && \
rm --force /tmp/http-server.patch /tmp/index.js.patch


# Copy files to image
Expand Down
5 changes: 5 additions & 0 deletions http-server.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# diff /usr/local/lib/node_modules/http-server/bin/http-server http-server > http-server.patch
208c208
< logger.info([chalk.yellow('\nhttp-server version: '), chalk.cyan(require('../package.json').version)].join(''));
---
> //logger.info([chalk.yellow('\nhttp-server version: '), chalk.cyan(require('../package.json').version)].join(''));
1 change: 1 addition & 0 deletions index.js.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# diff /usr/local/lib/node_modules/http-server/lib/core/show-dir/index.js index.js > index.js.patch
129,131c129
< html += `<br><address>Node.js ${
< process.version
Expand Down
30 changes: 7 additions & 23 deletions shell.c.patch
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
# diff shell.c shell_modified.c > shell.c.patch
28631,28641c28631,28641
< printf(
< "SQLite version %s %.19s%s\n" /*extra-version-info*/
< "Enter \".help\" for usage hints.\n",
< sqlite3_libversion(), sqlite3_sourceid(), zCharset
< );
< if( warnInmemoryDb ){
< printf("Connected to a ");
< printBold("transient in-memory database");
< printf(".\nUse \".open FILENAME\" to reopen on a "
< "persistent database.\n");
< }
29321,29323c29321,29323
< oputf("SQLite version %s %.19s%s\n" /*extra-version-info*/
< "Enter \".help\" for usage hints.\n",
< sqlite3_libversion(), sqlite3_sourceid(), SHELL_CIO_CHAR_SET);
---
> // printf(
> // "SQLite version %s %.19s%s\n" /*extra-version-info*/
> // "Enter \".help\" for usage hints.\n",
> // sqlite3_libversion(), sqlite3_sourceid(), zCharset
> // );
> // if( warnInmemoryDb ){
> // printf("Connected to a ");
> // printBold("transient in-memory database");
> // printf(".\nUse \".open FILENAME\" to reopen on a "
> // "persistent database.\n");
> // }
> //oputf("SQLite version %s %.19s%s\n" /*extra-version-info*/
> // "Enter \".help\" for usage hints.\n",
> // sqlite3_libversion(), sqlite3_sourceid(), SHELL_CIO_CHAR_SET);