Skip to content

Commit c642885

Browse files
committed
mirror-nixos-branch: Update the Git repo last
1 parent 2f7994e commit c642885

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

mirror-nixos-branch.pl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,6 @@ sub fetch {
8080
die "channel would go back in time from $curRelease to $releaseName, bailing out\n" if $d == 1;
8181
}
8282

83-
# Update the nixpkgs-channels repo.
84-
open(my $lockfile, ">>", "$channelsDir/.htaccess.lock");
85-
flock($lockfile, LOCK_EX) or die "cannot acquire channels lock\n";
86-
87-
system("git remote update origin >&2") == 0 or die;
88-
system("git push channels $rev:refs/heads/$channelName >&2") == 0 or die;
89-
90-
flock($lockfile, LOCK_UN) or die "cannot release channels lock\n";
91-
9283
if ($bucket->head_key("$releasePrefix")) {
9384
print STDERR "release already exists\n";
9485
} else {
@@ -213,6 +204,7 @@ sub fetch {
213204
}
214205

215206
# Prevent concurrent writes to the channels directory.
207+
open(my $lockfile, ">>", "$channelsDir/.htaccess.lock");
216208
flock($lockfile, LOCK_EX) or die "cannot acquire channels lock\n";
217209

218210
# Update the channel.
@@ -230,3 +222,9 @@ sub fetch {
230222

231223
system("cat $channelsDir/.htaccess-nix* > $channelsDir/.htaccess.tmp") == 0 or die;
232224
rename("$channelsDir/.htaccess.tmp", "$channelsDir/.htaccess") or die;
225+
226+
# Update the nixpkgs-channels repo.
227+
system("git remote update origin >&2") == 0 or die;
228+
system("git push channels $rev:refs/heads/$channelName >&2") == 0 or die;
229+
230+
flock($lockfile, LOCK_UN) or die "cannot release channels lock\n";

0 commit comments

Comments
 (0)