chore: switch to ‹tar› and have consistent paths

* Switch the archiving from the ‹zip› to ‹tar.gz› and ‹tar.bz2›
* Adjust the static files to have consistent paths

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2023-08-18 12:19:47 +02:00
parent 84b080e343
commit a868efaee6
Signed by: mfocko
GPG key ID: 7C47D46246790496
81 changed files with 35 additions and 33 deletions

5
.gitignore vendored
View file

@ -20,8 +20,9 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
# ignore generated zips
static/files/**/*.zip
# ignore generated archives
static/files/**/*.tar.gz
static/files/**/*.tar.bz2
# ignore generated SVGs
static/files/**/*.svg

View file

@ -14,7 +14,7 @@ last_update:
## Introduction
[Source code](pathname:///files/ib002/postcondition-ambiguity/test_sort.py) used later on.
[Source code](pathname:///files/ib002/algorithms-correctness/postcondition-ambiguity/test_sort.py) used later on.
## Implementation of select sort from the exercises

View file

@ -112,8 +112,8 @@ If the recursion had bigger depth and/or more elements, it would iterate through
There is an example of dynamic array:
- [interface (`dynlist.h`)](pathname:///files/ib002/extend/dynlist.h)
- [implementation (`dynlist.c`)](pathname:///files/ib002/extend/dynlist.c)
- [interface (`dynlist.h`)](pathname:///files/ib002/time-complexity/extend/dynlist.h)
- [implementation (`dynlist.c`)](pathname:///files/ib002/time-complexity/extend/dynlist.c)
For the sake of _Algorithms and Data Structures I_ we consider `APPEND` operation, i.e. adding the element to the end of the list, to have time complexity $\mathcal{O}(1)$ (**amortized**; which is out of the scope of IB002).

View file

@ -12,7 +12,7 @@ last_update:
date: 2022-11-29
---
- [Sources](pathname:///files/ib002/karel-1)
- [Sources](pathname:///files/ib002/recursion/karel-1.tar.gz)
## Introduction

View file

@ -695,7 +695,7 @@ successor and represents the way we can enhance the existing implementation.
:::info source
You can find source code referenced in the text
[here](pathname:///files/ib002/recursion/pyramid-slide-down/).
[here](pathname:///files/ib002/recursion/pyramid-slide-down.tar.gz).
:::

View file

@ -14,7 +14,7 @@ last_update:
## Introduction
- [Source code used later on.](pathname:///files/ib002/iterative-and-iterators/)
- [Source code used later on.](pathname:///files/ib002/graphs/iterative-and-iterators.tar.gz)
As we have talked on the seminar, iterative approach to implementing DFS is not very intuitive and is a very easy way how to create an incorrect implementation.

View file

@ -19,17 +19,17 @@ deploy-poincare: build-poincare
rsync -avzrlpptv --delete $(OUTPUT_DIR)/ poincare:~/public_html/blog/
# Build assets that are generated from the git, but not version-controlled
assets: regenerate-dots regenerate-zips
assets: regenerate-dots regenerate-archives
# Regenerates dotfiles that are rendered to SVG
regenerate-dots:
sh regenerate-dots.sh
# Regenerates ZIP files with static content, e.g. source files
regenerate-zips:
sh regenerate-zips.sh
# Regenerates archives with static content, e.g. source files
regenerate-archives:
sh regenerate-archives.sh
# Deploys
deploy: deploy-aisa deploy-poincare
.PHONY: dev deploy-aisa deploy-poincare assets regenerate-dots regenerate-zips
.PHONY: dev deploy-aisa deploy-poincare assets regenerate-dots regenerate-archives

View file

@ -22,7 +22,7 @@ or just by submitting an issue [here](https://gitlab.fi.muni.cz/xfocko/kb/-/issu
For this bonus you can get 3 K₡ and another 0.5 K₡ for the bonus part of it.
[Source](pathname:///files/pb071/bonuses/04/)
[Source](pathname:///files/pb071/bonuses/04.tar.gz)
## Introduction

View file

@ -7,7 +7,7 @@ description: |
For this bonus you can get at maximum 2.5 K₡.
[Source](pathname:///files/pb071/bonuses/05-06/)
[Source](pathname:///files/pb071/bonuses/05-06.tar.gz)
## Introduction

View file

@ -7,7 +7,7 @@ description: |
# 8th seminar bonus assignment
[Source](pathname:///files/pb071/bonuses/08/)
[Source](pathname:///files/pb071/bonuses/08.tar.gz)
## Introduction

View file

@ -5,7 +5,7 @@ description: |
Finding bugs in a hangman.
---
[Source](pathname:///files/pb071/bonuses/10/)
[Source](pathname:///files/pb071/bonuses/10.tar.gz)
## Introduction

17
regenerate-archives.sh Normal file
View file

@ -0,0 +1,17 @@
#!/bin/sh
# remove preexisting archives
find ./static/files -name '*.tar.gz' -exec rm {} \;
find ./static/files -name '*.tar.bz2' -exec rm {} \;
for relative_path in $(find ./static/files -name '.archive' -print); do
relative_path=$(dirname $relative_path)
base=$(basename $relative_path)
cd $relative_path/..
all_files=$(find $base/** ! -name '.archive' -print)
tar cvaf $base.tar.gz $all_files
tar cvaf $base.tar.bz2 $all_files
cd -
done;

View file

@ -1,16 +0,0 @@
#!/bin/sh
# remove preexisting ZIPs
find ./static/files -name '*.zip' -exec rm {} \;
for relative_path in $(find ./static/files -name '.zipit' -print); do
relative_path=$(dirname $relative_path)
base=$(basename $relative_path)
cd $relative_path/..
all_files=$(find $base/** ! -name '.zipit' -print)
zip -9 $base.zip $all_files
mv $base.zip $base/$base.zip
cd -
done;