Skip to content

Instantly share code, notes, and snippets.

@samueldr
Created January 31, 2019 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueldr/a4578caf7cda38a9ba8c331acfe3c45c to your computer and use it in GitHub Desktop.
Save samueldr/a4578caf7cda38a9ba8c331acfe3c45c to your computer and use it in GitHub Desktop.
diff --git a/mirror-nixos-branch.pl b/mirror-nixos-branch.pl
index d1986f4..84e4c12 100755
--- a/mirror-nixos-branch.pl
+++ b/mirror-nixos-branch.pl
@@ -33,18 +33,19 @@ my $bucketName = "nix-releases";
$ENV{'GIT_DIR'} = "/home/hydra-mirror/nixpkgs-channels";
-# S3 setup.
-my $aws_access_key_id = $ENV{'AWS_ACCESS_KEY_ID'} or die;
-my $aws_secret_access_key = $ENV{'AWS_SECRET_ACCESS_KEY'} or die;
-
-my $s3 = Net::Amazon::S3->new(
- { aws_access_key_id => $aws_access_key_id,
- aws_secret_access_key => $aws_secret_access_key,
- retry => 1,
- host => "s3-eu-west-1.amazonaws.com",
- });
-
-my $bucket = $s3->bucket($bucketName) or die;
+## S3 setup.
+#my $aws_access_key_id = $ENV{'AWS_ACCESS_KEY_ID'} or die;
+#my $aws_secret_access_key = $ENV{'AWS_SECRET_ACCESS_KEY'} or die;
+#
+#my $s3 = Net::Amazon::S3->new(
+# { aws_access_key_id => $aws_access_key_id,
+# aws_secret_access_key => $aws_secret_access_key,
+# retry => 1,
+# host => "s3-eu-west-1.amazonaws.com",
+# });
+#
+#my $bucket = $s3->bucket($bucketName) or die;
+my $bucket;
sub fetch {
@@ -80,7 +81,7 @@ chomp $d;
die "channel would go back in time from $curRelease to $releaseName, bailing out\n" if $d == 1;
exit if $d == 0;
-if ($bucket->head_key("$releasePrefix")) {
+if (0) {
print STDERR "release already exists\n";
} else {
my $tmpDir = "$TMPDIR/release-$channelName/$releaseName";
@@ -200,7 +201,7 @@ if ($bucket->head_key("$releasePrefix")) {
{ content_type => "text/html" })
or die $bucket->err . ": " . $bucket->errstr;
- File::Path::remove_tree($tmpDir);
+ #File::Path::remove_tree($tmpDir);
}
# Prevent concurrent writes to the channels directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment