From 233e9ca92f6dd8dd60970674c7da79cfb72cca16 Mon Sep 17 00:00:00 2001 From: Stephan Barth Date: Thu, 18 Apr 2024 01:29:05 +0200 Subject: [PATCH 1/2] chore(gitlab-ci): Add debug print to container sanitation. --- .gitlab-ci/sanitize-docker.pl | 53 +++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci/sanitize-docker.pl b/.gitlab-ci/sanitize-docker.pl index 7ab0194e2..51704aebe 100755 --- a/.gitlab-ci/sanitize-docker.pl +++ b/.gitlab-ci/sanitize-docker.pl @@ -5,17 +5,32 @@ use warnings; use Data::Dumper; +print "Sanitize script for node removal from container.\n"; + +system("pwd"); +{ + my @l = (".",".."); + for(1..8) { + push @l, (("../" x $_)."..") + } + for(@l) { + my $cmd = "ls -ld $_"; + print "running: $cmd\n"; + system $cmd; + } +} + my $tmpdir = "tmp-sanitize"; die "Has already run, abort" if -e $tmpdir; mkdir $tmpdir; -chmod(0755, $tmpdir); +chmodWrap(0755, $tmpdir); chdir($tmpdir); system("ln -s ../uniworx.tar.gz ."); system("tar xzvf uniworx.tar.gz"); -chmod(0755, '.'); # tar can change the rights of '.' if it contains an entry for '.' with other rights +chmodWrap(0755, '.'); # tar can change the rights of '.' if it contains an entry for '.' with other rights my %truerights = (); storeRightsMake7("."); @@ -26,6 +41,25 @@ storeRightsMake7("."); #print "=== Reset rights:\n"; #system("ls -l *"); +sub chmodWrap { + my ($mode, $fn) = @_; + my $tries = 0; + die "file '$fn' does not exist; cannot change its permissions to $mode" unless -e $fn; + RIGHTS: { + chmod($mode, $fn); + my $ismode = (stat($fn))[2]; + my $fm = $ismode % 512; + if($fm != $mode) { + if($tries++ > 20) { + die "Problem with file permissions, abort" + } + warn sprintf "File rights were meant to be set, but were not updated properly for file '%s', is %03o but was set to %03o; try again in 1 second"; + sleep 1; + redo RIGHTS; + } + } +} + # sub storeRightsMake7 { my ($pwd) = @_; @@ -39,7 +73,7 @@ sub storeRightsMake7 { my $fm = $mode % 512; #my $fmo = sprintf("%03o",$fm); $truerights{$fullname} = $fm; - chmod(($fm | 0700), $fullname); + chmodWrap(($fm | 0700), $fullname); storeRightsMake7($fullname) if -d $fullname; } } @@ -55,7 +89,7 @@ sub resetRights { #perl -le 'my $dh = undef;opendir($dh, ".");while(my $fn = readdir($dh)) { my $mode = (stat($fn))[2];my $fm = $mode % 512;my $fmo=sprintf("%03o",$fm);print "$fn -> $fmo" }' my $fullname = "$pwd/$fn"; printf(" set rights of '$fullname' back to %03o\n", $truerights{$fullname}); - chmod($truerights{$fullname}, $fullname); + chmodWrap($truerights{$fullname}, $fullname); resetRights($fullname) if -d $fullname; } } @@ -72,6 +106,12 @@ sub renameWithRights { #my $rights = $truerights{$from}; #delete $truerights{$from}; rename($from, $to) or die "Could not rename '$from' to '$to', because $!"; + my $waittimer = 20; + while(-e $from || not(-e $to) and $waittimer-- > 0) { + sleep 1 + } + die "rename file from '$from' to '$to', but it is still there" if -e $from; + die "rename file from '$from' to '$to', but there is no file under the new name" unless -e $to; #$truerights{$to} = $rights } @@ -176,7 +216,8 @@ sub replaceInFile { } my $wh = undef; open($wh, '>', $filename) or die "Could not write $filename, because: $!"; - print $wh $content + print $wh $content; + close $wh; } my %replacer = ( @@ -214,7 +255,7 @@ cautionWaiter(); resetRights("."); - +system("find"); unlink("uniworx.tar.gz"); From 3080ab995a71e7fa4f383d738843d73e6e4338c8 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Fri, 19 Apr 2024 00:32:24 +0200 Subject: [PATCH 2/2] chore(release): 28.0.10 --- CHANGELOG.md | 2 ++ nix/docker/version.json | 2 +- package-lock.json | 2 +- package.json | 2 +- package.yaml | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79694bdea..37ae6a2ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [28.0.10](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/t28.0.9...t28.0.10) (2024-04-18) + ## [28.0.9](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/t28.0.8...t28.0.9) (2024-04-08) ## [28.0.8](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/t28.0.0...t28.0.8) (2024-04-06) diff --git a/nix/docker/version.json b/nix/docker/version.json index 417b7b5a3..7779d4edd 100644 --- a/nix/docker/version.json +++ b/nix/docker/version.json @@ -1,3 +1,3 @@ { - "version": "28.0.9" + "version": "28.0.10" } diff --git a/package-lock.json b/package-lock.json index 959d6e780..77aae60b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "uni2work", - "version": "28.0.9", + "version": "28.0.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 39030d8b6..6449c8223 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uni2work", - "version": "28.0.9", + "version": "28.0.10", "description": "", "keywords": [], "author": "", diff --git a/package.yaml b/package.yaml index 8e0aeec32..a99e2e6ba 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: uniworx -version: 28.0.9 +version: 28.0.10 dependencies: - base - yesod