aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2024-07-07 22:54:50 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2024-07-07 22:56:53 +0300
commitb1d2d2a6391ca48ac477b585d69905431176ba17 (patch)
treea73674c731a26eb86e873f0f805d1d430f461b39
parent43d153c00bb067276d3cda141ad62de27cb4971d (diff)
downloadrevela-0.1.4.tar.gz
revela-0.1.4.zip
fix: prerm_imagedir()v0.1.4
Fix re-rendering adjacent images' pages to the ones that are deleted.
-rw-r--r--.gitignore1
-rw-r--r--compile_commands.json554
-rw-r--r--src/components.c1
-rw-r--r--src/fs.c2
-rw-r--r--src/site.c12
5 files changed, 7 insertions, 563 deletions
diff --git a/.gitignore b/.gitignore
index b0b5a06..dc40d3e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
.cache
obj/
build/
+compile_commands.json
diff --git a/compile_commands.json b/compile_commands.json
deleted file mode 100644
index c0049ee..0000000
--- a/compile_commands.json
+++ /dev/null
@@ -1,554 +0,0 @@
-[
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/src/config.o",
- "src/config.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "src/config.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/src/revela.o",
- "src/revela.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "src/revela.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-std=c99",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L",
- "-iquoteinclude",
- "-iquoteunja/src",
- "-iquoteunja",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/unja/src/hashmap.o",
- "unja/src/hashmap.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick"
- ],
- "file": "unja/src/hashmap.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-std=c99",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L",
- "-iquoteinclude",
- "-iquoteunja/src",
- "-iquoteunja",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/unja/src/template.o",
- "unja/src/template.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick"
- ],
- "file": "unja/src/template.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-std=c99",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L",
- "-iquoteinclude",
- "-iquoteunja/src",
- "-iquoteunja",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/unja/src/vector.o",
- "unja/src/vector.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick"
- ],
- "file": "unja/src/vector.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-std=c99",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L",
- "-iquoteinclude",
- "-iquoteunja/src",
- "-iquoteunja",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/unja/vendor/mpc.o",
- "unja/vendor/mpc.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick"
- ],
- "file": "unja/vendor/mpc.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/parcini/src/parcini.o",
- "parcini/src/parcini.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "parcini/src/parcini.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/src/fs.o",
- "src/fs.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "src/fs.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/src/log.o",
- "src/log.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "src/log.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/src/bstree.o",
- "src/bstree.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "src/bstree.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/src/site.o",
- "src/site.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "src/site.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/src/components.o",
- "src/components.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "src/components.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/roscha/src/parser.o",
- "roscha/src/parser.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "roscha/src/parser.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/roscha/src/token.o",
- "roscha/src/token.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "roscha/src/token.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/roscha/src/roscha.o",
- "roscha/src/roscha.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "roscha/src/roscha.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/roscha/src/vector.o",
- "roscha/src/vector.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "roscha/src/vector.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/roscha/src/hmap.o",
- "roscha/src/hmap.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "roscha/src/hmap.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/roscha/src/slice.o",
- "roscha/src/slice.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "roscha/src/slice.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/roscha/src/ast.o",
- "roscha/src/ast.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "roscha/src/ast.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/roscha/src/lexer.o",
- "roscha/src/lexer.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "roscha/src/lexer.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/roscha/sds/sds.o",
- "roscha/sds/sds.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "roscha/sds/sds.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/src/render.o",
- "src/render.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "src/render.c"
- },
- {
- "directory": "/home/yaroslav/repos/personal/revela",
- "arguments": [
- "cc",
- "-c",
- "-iquoteinclude",
- "-iquoteroscha",
- "-iquoteroscha/include",
- "-iquoteparcini/include",
- "-o",
- "build/release/obj/roscha/src/object.o",
- "roscha/src/object.c",
- "-lexif",
- "-I/usr/include/GraphicsMagick",
- "-lGraphicsMagickWand",
- "-lGraphicsMagick",
- "-std=c11",
- "-O2",
- "-Wall",
- "-D_XOPEN_SOURCE=500",
- "-D_POSIX_C_SOURCE=200809L"
- ],
- "file": "roscha/src/object.c"
- }
-]
diff --git a/src/components.c b/src/components.c
index 08ab556..abd1303 100644
--- a/src/components.c
+++ b/src/components.c
@@ -10,7 +10,6 @@
#include "fs.h"
#include "log.h"
#include "site.h"
-#include "roscha.h"
#define MAXTIME \
((unsigned long long)1 << ((sizeof(time_t) * CHAR_BIT) - 1)) - 1
diff --git a/src/fs.c b/src/fs.c
index d1bcff0..b9f43f7 100644
--- a/src/fs.c
+++ b/src/fs.c
@@ -1,14 +1,12 @@
#include "fs.h"
#include "log.h"
-#include "config.h"
#include "vector.h"
#include "slice.h"
#include <fcntl.h>
#include <stdio.h>
-#include <ctype.h>
#include <unistd.h>
#include <stdint.h>
#include <stdlib.h>
diff --git a/src/site.c b/src/site.c
index 59cd669..83852f2 100644
--- a/src/site.c
+++ b/src/site.c
@@ -36,14 +36,14 @@ prerm_imagedir(const char *path, void *data)
return false;
}
if (S_ISDIR(st.st_mode)) {
- struct image *prev, *next = NULL;
+ struct image *prev = NULL, *next = NULL, *cur;
size_t i;
- vector_foreach (album->images, i, prev) {
- if (prev->tstamp > st.st_mtim.tv_sec) {
- prev = next;
+ vector_foreach (album->images, i, cur) {
+ if (cur->tstamp > st.st_mtim.tv_sec) {
+ next = cur;
break;
}
- next = prev;
+ prev = cur;
}
if (prev) {
if (!prev->modified) {
@@ -53,7 +53,7 @@ prerm_imagedir(const char *path, void *data)
}
}
}
- if (next != prev) {
+ if (next) {
if (!next->modified) {
joinpathb(htmlpath, next->dst, index_html);
if (!render_make_image(&album->site->render, htmlpath, next)) {