From d72643c030ebbc255ae92389e3265030b5d8c087 Mon Sep 17 00:00:00 2001 From: Basher52 <> Date: Tue, 27 May 2025 21:35:05 +0200 Subject: [PATCH 1/9] Fixes the first two lines in the sha256sum --- assets/pkg/aur/lidm-bin/PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/pkg/aur/lidm-bin/PKGBUILD b/assets/pkg/aur/lidm-bin/PKGBUILD index 448649e..ff8c706 100644 --- a/assets/pkg/aur/lidm-bin/PKGBUILD +++ b/assets/pkg/aur/lidm-bin/PKGBUILD @@ -16,8 +16,8 @@ source=( "lidm.1::https://raw.githubusercontent.com/javalsai/lidm/v$pkgver/assets/man/lidm.1" "lidm-config.5::https://raw.githubusercontent.com/javalsai/lidm/v$pkgver/assets/man/lidm-config.5" ) -sha256sums=('4969018d527613729336abd51e37283ce77d7c7a2233434642804b88e550e622' - '27db9b0cd2da80c0c60dcb13dfad0f9d65e7dddbb7b344b859803b9ac3943cd7' +sha256sums=('65b42f4f7acd970b167fe84d1fa75450b54e01a6f0edddb9d8dd487058a20850' + '68662430a6d262b35cc54d9f0e164ed935b7f7f4497a87cc94946c558bbe8a91' 'a6807a55ff72ec5a5678583156b3efd0d367f0bcb79854094132771f0cb86bce' '3adaae60f79dff1cef2b2aba7dcea04196cd49816759ad36afb9f7331ac9c3e4') From 82e92df95c1b8d6f36b9a53bd56bec83d5b345d1 Mon Sep 17 00:00:00 2001 From: javalsai Date: Fri, 6 Jun 2025 17:05:14 +0200 Subject: [PATCH 2/9] fix(aur): v0.2.1 checksums on the srcfile (again x2) --- assets/pkg/aur/lidm-bin/.SRCINFO | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/pkg/aur/lidm-bin/.SRCINFO b/assets/pkg/aur/lidm-bin/.SRCINFO index 997b90b..8dbd9cd 100644 --- a/assets/pkg/aur/lidm-bin/.SRCINFO +++ b/assets/pkg/aur/lidm-bin/.SRCINFO @@ -12,8 +12,8 @@ pkgbase = lidm-bin source = default-theme.ini::https://raw.githubusercontent.com/javalsai/lidm/v0.2.1/themes/default.ini source = lidm.1::https://raw.githubusercontent.com/javalsai/lidm/v0.2.1/assets/man/lidm.1 source = lidm-config.5::https://raw.githubusercontent.com/javalsai/lidm/v0.2.1/assets/man/lidm-config.5 - sha256sums = 4969018d527613729336abd51e37283ce77d7c7a2233434642804b88e550e622 - sha256sums = 27db9b0cd2da80c0c60dcb13dfad0f9d65e7dddbb7b344b859803b9ac3943cd7 + sha256sums = 65b42f4f7acd970b167fe84d1fa75450b54e01a6f0edddb9d8dd487058a20850 + sha256sums = 68662430a6d262b35cc54d9f0e164ed935b7f7f4497a87cc94946c558bbe8a91 sha256sums = a6807a55ff72ec5a5678583156b3efd0d367f0bcb79854094132771f0cb86bce sha256sums = 3adaae60f79dff1cef2b2aba7dcea04196cd49816759ad36afb9f7331ac9c3e4 From dc6424979e876257861c9ad972b6a5bef4923628 Mon Sep 17 00:00:00 2001 From: javalsai Date: Fri, 6 Jun 2025 18:12:45 +0200 Subject: [PATCH 3/9] fix: address mem issues --- src/config.c | 33 +++++++++++++++++++-------------- src/sessions.c | 21 +++++++++++++++++++-- src/util.c | 15 +++++++-------- 3 files changed, 45 insertions(+), 24 deletions(-) diff --git a/src/config.c b/src/config.c index 930be75..9488a23 100644 --- a/src/config.c +++ b/src/config.c @@ -4,6 +4,14 @@ #include "config.h" #include "util.h" +// Alr so ima explain the bitfield returned by `cb` a bit +// 4 bits: +// 0b0001: break out of parsing (returning true) +// 0b0010: free the value +// 0b0100: free the key +// 0b1000: break out of parsing (returning false) +// +// This would return true if everything goes fine, false otherwise (malloc error, broke parsing, etc) bool line_parser(FILE *fd, ssize_t *blksize, u_char (*cb)(char *key, char *value)) { size_t opt_size = 4096; @@ -41,19 +49,20 @@ bool line_parser(FILE *fd, ssize_t *blksize, if (ret & 0b1000) { free(buf); return false; - } - if (ret & 0b0001) { - free(buf); + } + if (ret & 0b0001) { + free(buf); break; - } + } } - free(buf); + free(buf); } return true; } struct config *__config; +// Yanderedev code (wanna fix this with a table or smth) u_char config_line_handler(char *k, char *v) { if (strcmp(k, "colors.bg") == 0) __config->theme.colors.bg = v; @@ -98,16 +107,13 @@ u_char config_line_handler(char *k, char *v) { else if (strcmp(k, "functions.poweroff") == 0) { __config->functions.poweroff = find_keyname(v); return 0b0110; - } - else if (strcmp(k, "functions.reboot") == 0) { + } else if (strcmp(k, "functions.reboot") == 0) { __config->functions.reboot = find_keyname(v); return 0b0110; - } - else if (strcmp(k, "functions.refresh") == 0) { + } else if (strcmp(k, "functions.refresh") == 0) { __config->functions.refresh = find_keyname(v); return 0b0110; - } - else if (strcmp(k, "strings.f_poweroff") == 0) + } else if (strcmp(k, "strings.f_poweroff") == 0) __config->strings.f_poweroff = v; else if (strcmp(k, "strings.f_reboot") == 0) __config->strings.f_reboot = v; @@ -126,15 +132,14 @@ u_char config_line_handler(char *k, char *v) { else if (strcmp(k, "behavior.include_defshell") == 0) { __config->behavior.include_defshell = strcmp(v, "true") == 0; return 0b0110; - } - else if (strcmp(k, "behavior.source") == 0) + } else if (strcmp(k, "behavior.source") == 0) vec_push(&__config->behavior.source, v); else if (strcmp(k, "behavior.user_source") == 0) vec_push(&__config->behavior.user_source, v); else return 0b1111; - return 0b100; + return 0b0100; } struct config *parse_config(char *path) { diff --git a/src/sessions.c b/src/sessions.c index 554e460..d415d9c 100644 --- a/src/sessions.c +++ b/src/sessions.c @@ -54,6 +54,7 @@ static int fn(const char *fpath, const struct stat *sb, int typeflag) { char *exec_buf = NULL; char *tryexec_buf = NULL; // This should be made a specific function + // Emm, if anything goes wrong just free the inner loop and `break;` fd and the rest is handled after while (true) { char *buf = malloc(sb->st_blksize); ssize_t read_size = getline(&buf, &alloc_size, fd); @@ -64,7 +65,19 @@ static int fn(const char *fpath, const struct stat *sb, int typeflag) { uint read; char *key = malloc(read_size + sizeof(char)); + if(key == NULL) { + free(buf); + // TODO: more sophisticated error handling?? + break; + } char *value = malloc(read_size + sizeof(char)); + if(value == NULL) { + free(buf); + free(key); + // TODO: more sophisticated error handling?? + break; + } + value[0] = '\0'; // I'm not sure if sscanf would null this string out if ((read = sscanf(buf, "%[^=]=%[^\n]\n", key, value)) != 0) { if (strcmp(key, "Name") == 0) { found &= 0b001; @@ -78,13 +91,17 @@ static int fn(const char *fpath, const struct stat *sb, int typeflag) { } else { free(value); } - } + } else { + free(value); + } free(key); - free(buf); + free(buf); if (found == 0b111) break; } /*printf("\nend parsing...\n");*/ + // Generic handling of exit + fclose(fd); // just add this to the list diff --git a/src/util.c b/src/util.c index 9a58b66..e2a95d2 100644 --- a/src/util.c +++ b/src/util.c @@ -68,7 +68,6 @@ static int selret_magic() { return select(1, &set, NULL, NULL, &timeout); } - // Vector shii struct Vector vec_new() { struct Vector vec; @@ -76,7 +75,7 @@ struct Vector vec_new() { return vec; } -int vec_push(struct Vector* vec, void* item) { +int vec_push(struct Vector *vec, void *item) { if (vec->length >= vec->alloc_len) { uint32_t new_size = vec->alloc_len + vec->alloc_size; void **new_location = realloc(vec->pages, vec->alloc_size); @@ -93,33 +92,33 @@ int vec_push(struct Vector* vec, void* item) { return 0; } -void vec_free(struct Vector* vec) { - while(vec->length > 0) +void vec_free(struct Vector *vec) { + while (vec->length > 0) free(vec->pages[--vec->length]); vec_clear(vec); } -void vec_clear(struct Vector* vec) { +void vec_clear(struct Vector *vec) { free(vec->pages); vec_reset(vec); } -void vec_reset(struct Vector* vec) { +void vec_reset(struct Vector *vec) { vec->length = 0; vec->alloc_len = 0; vec->alloc_size = 4096; // 4KiB page size? vec->pages = NULL; } -void* vec_pop(struct Vector* vec) { +void *vec_pop(struct Vector *vec) { if (vec->length == 0) return NULL; return vec->pages[--vec->length]; } -void* vec_get(struct Vector* vec, size_t index) { +void *vec_get(struct Vector *vec, size_t index) { if (index >= vec->length) return NULL; From 04a102a7bb2da6282995e1b63c34b20c06665a87 Mon Sep 17 00:00:00 2001 From: javalsai Date: Fri, 6 Jun 2025 19:39:44 +0200 Subject: [PATCH 4/9] perf: better and efficient vec impl --- include/util.h | 22 ++++++++++++---------- src/util.c | 48 ++++++++++++++++++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 24 deletions(-) diff --git a/include/util.h b/include/util.h index 96b1a5a..a868865 100644 --- a/include/util.h +++ b/include/util.h @@ -14,18 +14,20 @@ void read_press(u_char *, char *); void strcln(char **dest, const char *source); struct Vector { - uint32_t length; - uint32_t alloc_len; - uint16_t alloc_size; - void** pages; + uint32_t length; + uint32_t capacity; + void **pages; }; struct Vector vec_new(); -int vec_push(struct Vector*, void* item); -void vec_free(struct Vector*); -void vec_clear(struct Vector*); -void vec_reset(struct Vector*); -void* vec_pop(struct Vector*); // won't free it, nor shrink vec list space -void* vec_get(struct Vector*, size_t index); +int vec_resize(struct Vector *, size_t size); +int vec_reserve(struct Vector *, size_t size); +int vec_reserve_exact(struct Vector *, size_t size); +int vec_push(struct Vector *, void *item); +void vec_free(struct Vector *); +void vec_clear(struct Vector *); +void vec_reset(struct Vector *); +void *vec_pop(struct Vector *); // won't free it, nor shrink vec list space +void *vec_get(struct Vector *, size_t index); #endif diff --git a/src/util.c b/src/util.c index e2a95d2..d5138c7 100644 --- a/src/util.c +++ b/src/util.c @@ -75,20 +75,41 @@ struct Vector vec_new() { return vec; } -int vec_push(struct Vector *vec, void *item) { - if (vec->length >= vec->alloc_len) { - uint32_t new_size = vec->alloc_len + vec->alloc_size; - void **new_location = realloc(vec->pages, vec->alloc_size); - if (new_location != NULL) { - vec->alloc_size = new_size; - vec->pages = new_location; - } else { - return -1; - } +int vec_resize(struct Vector *vec, size_t size) { + void **new_location = realloc(vec->pages, size * sizeof(void*)); + if (new_location != NULL) { + if (vec->length > size) + vec->length = size; + vec->capacity = size; + vec->pages = new_location; + } else { + return -1; } + return 0; +} - vec->pages[vec->length] = item; - vec->length++; +int vec_reserve(struct Vector *vec, size_t size) { + uint32_t new_capacity = vec->capacity; + while (vec->length + size > new_capacity) { + new_capacity = new_capacity + (new_capacity >> 1) + 1; // cap * 1.5 + 1; 0 1 2 4 7 11... + } + return vec_resize(vec, new_capacity); +} + +int vec_reserve_exact(struct Vector *vec, size_t size) { + uint32_t needed_capacity = vec->length + size; + if (vec->capacity < needed_capacity) { + return vec_resize(vec, needed_capacity); + } else { + return 0; + } +} + +int vec_push(struct Vector *vec, void *item) { + int res_ret = vec_reserve(vec, 1); + if(res_ret != 0) return res_ret; + + vec->pages[vec->length++] = item; return 0; } @@ -106,8 +127,7 @@ void vec_clear(struct Vector *vec) { void vec_reset(struct Vector *vec) { vec->length = 0; - vec->alloc_len = 0; - vec->alloc_size = 4096; // 4KiB page size? + vec->capacity = 0; vec->pages = NULL; } From b22ae6b2cc601b0531248fd2b73017e95901483d Mon Sep 17 00:00:00 2001 From: javalsai Date: Fri, 6 Jun 2025 19:39:55 +0200 Subject: [PATCH 5/9] fix: memory leaks --- src/sessions.c | 1 + src/ui.c | 7 +++++-- src/users.c | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/sessions.c b/src/sessions.c index d415d9c..b55f1f7 100644 --- a/src/sessions.c +++ b/src/sessions.c @@ -125,6 +125,7 @@ static int fn(const char *fpath, const struct stat *sb, int typeflag) { // This code is designed to be run purely single threaded struct Vector get_avaliable_sessions() { struct Vector sessions = vec_new(); + vec_reserve(&sessions, 8); cb_sessions = &sessions; for (size_t i = 0; i < (sizeof(sources) / sizeof(sources[0])); i++) { diff --git a/src/ui.c b/src/ui.c index f711554..830c349 100644 --- a/src/ui.c +++ b/src/ui.c @@ -322,6 +322,7 @@ void ffield_type(char *text) { print_ffield(); } +static char* unknown_str = "unknown"; int load(struct Vector *users, struct Vector *sessions) { /// SETUP gusers = users; @@ -331,9 +332,9 @@ int load(struct Vector *users, struct Vector *sessions) { char *hostname = malloc(16); if (gethostname(hostname, 16) != 0) { free(hostname); - hostname = "unknown"; + hostname = unknown_str; } else { - hostname = realloc(hostname, strlen(hostname) + 1); + hostname[15] = '\0'; } of_session = ofield_new(sessions->length + behavior.include_defshell); @@ -350,12 +351,14 @@ int load(struct Vector *users, struct Vector *sessions) { printf("\x1b[%d;%dH\x1b[%sm%s\x1b[%sm", boxstart.y + 2, boxstart.x + 12 - (uint)strlen(hostname), theme.colors.e_hostname, hostname, theme.colors.fg); + if(hostname != unknown_str) free(hostname); // put date char *fmtd_time = fmt_time(); printf("\x1b[%d;%dH\x1b[%sm%s\x1b[%sm", boxstart.y + 2, boxstart.x + boxw - 3 - (uint)strlen(fmtd_time), theme.colors.e_date, fmtd_time, theme.colors.fg); + free(fmtd_time); print_field(SESSION); print_field(USER); diff --git a/src/users.c b/src/users.c index 67049a8..7cc3a7c 100644 --- a/src/users.c +++ b/src/users.c @@ -23,6 +23,7 @@ static struct user __new_user(struct passwd *p) { // This code is designed to be run purely single threaded struct Vector get_human_users() { struct Vector users = vec_new(); + vec_reserve(&users, 4); struct passwd *pwd; while ((pwd = getpwent()) != NULL) { From abad5159637968d9cec87f4210c8fd79d4b491cc Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 6 Jun 2025 17:48:47 +0000 Subject: [PATCH 6/9] Update AUR pkgs to v0.2.2 --- assets/pkg/aur/lidm-bin/.SRCINFO | 14 +++++++------- assets/pkg/aur/lidm-bin/PKGBUILD | 6 +++--- assets/pkg/aur/lidm-git/PKGBUILD | 2 +- assets/pkg/aur/lidm/.SRCINFO | 6 +++--- assets/pkg/aur/lidm/PKGBUILD | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/assets/pkg/aur/lidm-bin/.SRCINFO b/assets/pkg/aur/lidm-bin/.SRCINFO index 8dbd9cd..9499001 100644 --- a/assets/pkg/aur/lidm-bin/.SRCINFO +++ b/assets/pkg/aur/lidm-bin/.SRCINFO @@ -1,18 +1,18 @@ pkgbase = lidm-bin pkgdesc = A fully colorful customizable TUI display manager made in C. (release binary) - pkgver = 0.2.1 - pkgrel = 2 + pkgver = 0.2.2 + pkgrel = 1 url = https://github.com/javalsai/lidm arch = x86_64 license = GPL depends = pam provides = lidm conflicts = lidm - source = lidm::https://github.com/javalsai/lidm/releases/download/v0.2.1/lidm-amd64 - source = default-theme.ini::https://raw.githubusercontent.com/javalsai/lidm/v0.2.1/themes/default.ini - source = lidm.1::https://raw.githubusercontent.com/javalsai/lidm/v0.2.1/assets/man/lidm.1 - source = lidm-config.5::https://raw.githubusercontent.com/javalsai/lidm/v0.2.1/assets/man/lidm-config.5 - sha256sums = 65b42f4f7acd970b167fe84d1fa75450b54e01a6f0edddb9d8dd487058a20850 + source = lidm::https://github.com/javalsai/lidm/releases/download/v0.2.2/lidm-amd64 + source = default-theme.ini::https://raw.githubusercontent.com/javalsai/lidm/v0.2.2/themes/default.ini + source = lidm.1::https://raw.githubusercontent.com/javalsai/lidm/v0.2.2/assets/man/lidm.1 + source = lidm-config.5::https://raw.githubusercontent.com/javalsai/lidm/v0.2.2/assets/man/lidm-config.5 + sha256sums = be2307be9bef7b3ef294fb0e8178040e2d8ccff6b8efb7546514da8b0f69c179 sha256sums = 68662430a6d262b35cc54d9f0e164ed935b7f7f4497a87cc94946c558bbe8a91 sha256sums = a6807a55ff72ec5a5678583156b3efd0d367f0bcb79854094132771f0cb86bce sha256sums = 3adaae60f79dff1cef2b2aba7dcea04196cd49816759ad36afb9f7331ac9c3e4 diff --git a/assets/pkg/aur/lidm-bin/PKGBUILD b/assets/pkg/aur/lidm-bin/PKGBUILD index ff8c706..f0733f0 100644 --- a/assets/pkg/aur/lidm-bin/PKGBUILD +++ b/assets/pkg/aur/lidm-bin/PKGBUILD @@ -1,8 +1,8 @@ # shellcheck disable=SC2034,SC2148,SC2128,SC2154,SC2164 # Maintainer: javalsai pkgname=lidm-bin -pkgver=0.2.1 -pkgrel=2 +pkgver=0.2.2 +pkgrel=1 depends=('pam') pkgdesc="A fully colorful customizable TUI display manager made in C. (release binary)" arch=('x86_64') @@ -16,7 +16,7 @@ source=( "lidm.1::https://raw.githubusercontent.com/javalsai/lidm/v$pkgver/assets/man/lidm.1" "lidm-config.5::https://raw.githubusercontent.com/javalsai/lidm/v$pkgver/assets/man/lidm-config.5" ) -sha256sums=('65b42f4f7acd970b167fe84d1fa75450b54e01a6f0edddb9d8dd487058a20850' +sha256sums=('be2307be9bef7b3ef294fb0e8178040e2d8ccff6b8efb7546514da8b0f69c179' '68662430a6d262b35cc54d9f0e164ed935b7f7f4497a87cc94946c558bbe8a91' 'a6807a55ff72ec5a5678583156b3efd0d367f0bcb79854094132771f0cb86bce' '3adaae60f79dff1cef2b2aba7dcea04196cd49816759ad36afb9f7331ac9c3e4') diff --git a/assets/pkg/aur/lidm-git/PKGBUILD b/assets/pkg/aur/lidm-git/PKGBUILD index 18fd78f..c01112e 100644 --- a/assets/pkg/aur/lidm-git/PKGBUILD +++ b/assets/pkg/aur/lidm-git/PKGBUILD @@ -1,7 +1,7 @@ # shellcheck disable=SC2034,SC2148,SC2128,SC2154,SC2164 # Maintainer: javalsai pkgname=lidm-git -pkgver=0.2.1.r0.ge2014f4 +pkgver=0.2.2.r0.gb22ae6b pkgrel=1 depends=('pam') makedepends=('git' 'make' 'gcc') diff --git a/assets/pkg/aur/lidm/.SRCINFO b/assets/pkg/aur/lidm/.SRCINFO index cce4623..ec7a48b 100644 --- a/assets/pkg/aur/lidm/.SRCINFO +++ b/assets/pkg/aur/lidm/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = lidm pkgdesc = A fully colorful customizable TUI display manager made in C. (build latest tag) - pkgver = 0.2.1 + pkgver = 0.2.2 pkgrel = 1 url = https://github.com/javalsai/lidm arch = any @@ -8,7 +8,7 @@ pkgbase = lidm makedepends = git makedepends = gcc depends = pam - source = tarball.tar.gz::https://github.com/javalsai/lidm/archive/refs/tags/v0.2.1.tar.gz - sha256sums = 56aaf8025fac16f5deef3058274635198fc3bf3f7eadc1de5c6539614f03d84b + source = tarball.tar.gz::https://github.com/javalsai/lidm/archive/refs/tags/v0.2.2.tar.gz + sha256sums = 25523abc3ce6f2f261bff0cc52663607fe114692d6d3736f27fd843cae3f3a27 pkgname = lidm diff --git a/assets/pkg/aur/lidm/PKGBUILD b/assets/pkg/aur/lidm/PKGBUILD index 8e86d85..0eed7e1 100644 --- a/assets/pkg/aur/lidm/PKGBUILD +++ b/assets/pkg/aur/lidm/PKGBUILD @@ -1,7 +1,7 @@ # shellcheck disable=SC2034,SC2148,SC2128,SC2154,SC2164 # Maintainer: javalsai pkgname=lidm -pkgver=0.2.1 +pkgver=0.2.2 pkgrel=1 depends=('pam') makedepends=('git' 'gcc') @@ -10,7 +10,7 @@ arch=('any') url="https://github.com/javalsai/lidm" license=('GPL') source=("tarball.tar.gz::https://github.com/javalsai/lidm/archive/refs/tags/v$pkgver.tar.gz") -sha256sums=('56aaf8025fac16f5deef3058274635198fc3bf3f7eadc1de5c6539614f03d84b') +sha256sums=('25523abc3ce6f2f261bff0cc52663607fe114692d6d3736f27fd843cae3f3a27') build() { tar -xzf "tarball.tar.gz" From ec00e5169600c4a0f9a02b933ef7cb72ed68e66e Mon Sep 17 00:00:00 2001 From: javalsai Date: Fri, 6 Jun 2025 20:02:09 +0200 Subject: [PATCH 7/9] fix: workflow runs on PRs --- .github/workflows/push.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index db871fd..78c3c1e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,7 +1,9 @@ name: Push Checks on: - push + push: + pull_request: + - opened jobs: check-and-build: From 2f370ab9965ace1d6cb647f5e52aca47987c44e4 Mon Sep 17 00:00:00 2001 From: javalsai Date: Fri, 6 Jun 2025 20:13:19 +0200 Subject: [PATCH 8/9] fix: workflow runs on PRs (again) --- .github/workflows/push.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 78c3c1e..3ea5dfc 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -3,7 +3,8 @@ name: Push Checks on: push: pull_request: - - opened + types: + - opened jobs: check-and-build: From 93f007691e4483ed781817e4db60ce25fccbe237 Mon Sep 17 00:00:00 2001 From: javalsai Date: Fri, 6 Jun 2025 20:27:01 +0200 Subject: [PATCH 9/9] fix(aur): package testing script --- assets/pkg/aur/test-makepkg.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/pkg/aur/test-makepkg.sh b/assets/pkg/aur/test-makepkg.sh index 302985c..3f79352 100755 --- a/assets/pkg/aur/test-makepkg.sh +++ b/assets/pkg/aur/test-makepkg.sh @@ -5,8 +5,14 @@ MYSELF=$(realpath "$0") MYDIR=$(dirname "$MYSELF") for pkg in "$MYDIR"/*/; do - cd "$pkg" printf "\x1b[1mEntering '%s'\x1b[0m\n" "$pkg" + cd "$pkg" + + # shellcheck disable=SC1091 + source "PKGBUILD" + for source in "${source[@]}"; do + awk -F'::' '{print $1}' <<<"$source" | xargs rm -rf + done rm -rf ./*.{gz,zst} src pkg makepkg -f .