Skip to content

Commit

Permalink
Refactor rename script and add patch
Browse files Browse the repository at this point in the history
  • Loading branch information
bartvdbraak committed Dec 4, 2024
1 parent b9a7301 commit 75e8e03
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 2 deletions.
31 changes: 31 additions & 0 deletions patches/2024-12-04_15-29-10_95838ed3f6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 95838ed3f6769a44357a3a503c57c9e3e2110227 Mon Sep 17 00:00:00 2001
From: Bart van der Braak <[email protected]>
Date: Wed, 4 Dec 2024 15:29:10 +0100
Subject: [PATCH] BLENDER: Add Python for external renderering

To be used for RestructuredText rendering using Sphinx to HTML.

See: https://projects.blender.org/infrastructure/gitea-custom/src/branch/main/sphinx#deployment
---
Dockerfile.rootless | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/Dockerfile.rootless b/Dockerfile.rootless
index 736cea5d05..5d298d94c4 100644
--- a/Dockerfile.rootless
+++ b/Dockerfile.rootless
@@ -54,6 +54,11 @@ RUN apk --no-cache add \
gnupg \
&& rm -rf /var/cache/apk/*

+# External renderers
+RUN apk --no-cache add \
+ python3-dev \
+ && rm -rf /var/cache/apk/*
+
RUN addgroup \
-S -g 1000 \
git && \
--
2.45.2

7 changes: 5 additions & 2 deletions patches/rename_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

# Iterate through all `.patch` files in the current directory
for file in *.patch; do
# Extract the commit ID from the first line (starts with "From")
commit_id=$(grep -m 1 "^From " "$file" | awk '{print $2}' | cut -c 1-10)

# Extract the full timestamp from the "Date" line
commit_timestamp=$(grep -m 1 "^Date:" "$file" | sed -E 's/Date: [A-Za-z]+, (.*)/\1/')

# Convert the extracted timestamp to ISO 8601 format (YYYY-MM-DD_HH-MM-SS)
iso_timestamp=$(date -d "$commit_timestamp" +"%Y-%m-%d_%H-%M-%S")

# Prepend the formatted timestamp to the filename
new_name="${iso_timestamp}_${file}"
# Prepend the formatted timestamp and commit ID to the filename
new_name="${iso_timestamp}_${commit_id}.patch"

# Rename the file
mv "$file" "$new_name"
Expand Down

0 comments on commit 75e8e03

Please sign in to comment.