Skip to content

Commit f450695

Browse files
committed
Make more consistent some translated strings related to compression
This commit changes some of the bbstreamer files and pg_dump to use the same style as a few other places (like common/compression.c), where the name of the compression method is not part of the string, but an argument of it. This reduces a bit the translation work with less string patterns. Discussion: https://postgr.es/m/Y5/5tdK+4n3clvtU@paquier.xyz
1 parent 22e3b55 commit f450695

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/bin/pg_basebackup/bbstreamer_gzip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ bbstreamer_gzip_writer_new(char *pathname, FILE *file,
113113

114114
return &streamer->base;
115115
#else
116-
pg_fatal("this build does not support gzip compression");
116+
pg_fatal("this build does not support compression with %s", "gzip");
117117
return NULL; /* keep compiler quiet */
118118
#endif
119119
}
@@ -246,7 +246,7 @@ bbstreamer_gzip_decompressor_new(bbstreamer *next)
246246

247247
return &streamer->base;
248248
#else
249-
pg_fatal("this build does not support gzip compression");
249+
pg_fatal("this build does not support compression with %s", "gzip");
250250
return NULL; /* keep compiler quiet */
251251
#endif
252252
}

src/bin/pg_basebackup/bbstreamer_lz4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ bbstreamer_lz4_compressor_new(bbstreamer *next, pg_compress_specification *compr
9797

9898
return &streamer->base;
9999
#else
100-
pg_fatal("this build does not support lz4 compression");
100+
pg_fatal("this build does not support compression with %s", "LZ4");
101101
return NULL; /* keep compiler quiet */
102102
#endif
103103
}
@@ -295,7 +295,7 @@ bbstreamer_lz4_decompressor_new(bbstreamer *next)
295295

296296
return &streamer->base;
297297
#else
298-
pg_fatal("this build does not support lz4 compression");
298+
pg_fatal("this build does not support compression with %s", "LZ4");
299299
return NULL; /* keep compiler quiet */
300300
#endif
301301
}

src/bin/pg_basebackup/bbstreamer_zstd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ bbstreamer_zstd_compressor_new(bbstreamer *next, pg_compress_specification *comp
113113

114114
return &streamer->base;
115115
#else
116-
pg_fatal("this build does not support zstd compression");
116+
pg_fatal("this build does not support compression with %s", "ZSTD");
117117
return NULL; /* keep compiler quiet */
118118
#endif
119119
}
@@ -268,7 +268,7 @@ bbstreamer_zstd_decompressor_new(bbstreamer *next)
268268

269269
return &streamer->base;
270270
#else
271-
pg_fatal("this build does not support zstd compression");
271+
pg_fatal("this build does not support compression with %s", "ZSTD");
272272
return NULL; /* keep compiler quiet */
273273
#endif
274274
}

src/bin/pg_dump/compress_io.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ AllocateCompressor(const pg_compress_specification compression_spec,
101101

102102
#ifndef HAVE_LIBZ
103103
if (compression_spec.algorithm == PG_COMPRESSION_GZIP)
104-
pg_fatal("not built with zlib support");
104+
pg_fatal("this build does not support compression with %s", "gzip");
105105
#endif
106106

107107
cs = (CompressorState *) pg_malloc0(sizeof(CompressorState));
@@ -135,7 +135,7 @@ ReadDataFromArchive(ArchiveHandle *AH,
135135
#ifdef HAVE_LIBZ
136136
ReadDataFromArchiveZlib(AH, readF);
137137
#else
138-
pg_fatal("not built with zlib support");
138+
pg_fatal("this build does not support compression with %s", "gzip");
139139
#endif
140140
}
141141
}
@@ -153,7 +153,7 @@ WriteDataToArchive(ArchiveHandle *AH, CompressorState *cs,
153153
#ifdef HAVE_LIBZ
154154
WriteDataToArchiveZlib(AH, cs, data, dLen);
155155
#else
156-
pg_fatal("not built with zlib support");
156+
pg_fatal("this build does not support compression with %s", "gzip");
157157
#endif
158158
break;
159159
case PG_COMPRESSION_NONE:
@@ -482,7 +482,7 @@ cfopen_write(const char *path, const char *mode,
482482
fp = cfopen(fname, mode, compression_spec);
483483
free_keep_errno(fname);
484484
#else
485-
pg_fatal("not built with zlib support");
485+
pg_fatal("this build does not support compression with %s", "gzip");
486486
fp = NULL; /* keep compiler quiet */
487487
#endif
488488
}
@@ -526,7 +526,7 @@ cfopen(const char *path, const char *mode,
526526
fp = NULL;
527527
}
528528
#else
529-
pg_fatal("not built with zlib support");
529+
pg_fatal("this build does not support compression with %s", "gzip");
530530
#endif
531531
}
532532
else

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy