nicolas / debian.moreutils (public) (License: GPL-2, GPL-2+, Expat, BSD-2-Clause, Public Domain) (since 2018-09-25) (hash sha1)
Debian packaging of joeyh's moreutils
List of commits:
Subject Hash Author Date (UTC)
sponge: Guarantee that output file is always updated atomically, by renaming a temp file into place. Closes: #592144 60b82b59a729d2a4322c3305d7207ce027831e23 Joey Hess 2010-09-13 19:55:34
Typo. Closes: #596032 e32af5bdb524059c98c6e158baa78db308609be0 Joey Hess 2010-09-08 06:09:43
releasing version 0.41 5d40038af260b233bf64fa8dab00a55d65cada8c Joey Hess 2010-09-02 20:49:37
sponge: Correct bad use of fread that caused a trailing quantity of soaked data to be silently discarded when a temp file was used and sponge output to stdout. Closes: #595220 a456619d189cef2933aefef86606ae4b29516c85 Joey Hess 2010-09-02 20:39:51
fix url 28242c4d201f281e0e72e674f13728aca8f422c7 Joey Hess 2010-07-12 19:05:00
Add missing AUTHOR section to docbook man pages. 40d283244f9ea5e83422b9c486d07171386890b0 Joey Hess 2010-07-12 19:01:32
ifdata.docbook: Mark interface as required in synopsis. Closes: #588397 8064766e05fa6d49c3a481ac634291b24818b973 Joey Hess 2010-07-08 18:40:30
clarify 174f95e703fff88307f203f2fa30ddebf27839f7 Joey Hess 2010-07-07 17:08:48
releasing version 0.40 5e413817d726a2879f56c94f498dcaa94f887813 Joey Hess 2010-07-06 23:42:05
update 9b22d8c29882a723df4db6f993e283ce37f0acc7 Joey Hess 2010-07-06 19:08:08
parallel: -i will now replace {} inside parameters, before the {} had to be a separate parameter. b5af8181d2bb7e08e08fcab7a0d5910acb7a8522 Joey Hess 2010-07-06 19:06:51
optimisations and fix memory leak b01a6aabcf738b3d86c0fce2164861f783ed37ca Joey Hess 2010-07-06 18:55:22
lckdo: Now deprecated, since util-linux's flock(1) can do the same thing. f597f10475a2e906b96e2856818632dbf66a61b5 Joey Hess 2010-06-18 17:07:10
use dpkg-mergechangelog 780448e12df9190486ef9ac0638aed8fa0270415 Joey Hess 2010-05-24 15:12:47
add note about 578517 717323107eb5583236d64cf0864247979e0c4ca1 Joey Hess 2010-04-28 15:47:55
zrun: Add support for .xz files. 6ec9f75d9c41ff60acf1e3362321e76b699706b1 Joey Hess 2010-02-23 20:58:54
fix load edge case b04468bb912d9635fe5f3965b15678add8046f58 Joey Hess 2010-02-23 20:48:44
allow -l 0 7ef2ddb70209ae8f7bd2941787e87fe168965715 Joey Hess 2010-02-23 20:47:16
parallel: Allow a decimal load value to be specified with -l 4665e4fdca863b8346ed2cc39304f2c763e183a9 Joey Hess 2010-02-23 20:44:08
parallel: Fix logic error in code handling -l that could make parallel return a bogus 255 exit code when all jobs succeeded. Closes: #569617 a1a2b5fe9f8e474c55308637caa3f4852f52b480 Joey Hess 2010-02-23 20:35:34
Commit 60b82b59a729d2a4322c3305d7207ce027831e23 - sponge: Guarantee that output file is always updated atomically, by renaming a temp file into place. Closes: #592144
Author: Joey Hess
Author date (UTC): 2010-09-13 19:55
Committer name: Joey Hess
Committer date (UTC): 2010-09-13 19:55
Parent(s): e32af5bdb524059c98c6e158baa78db308609be0
Signing key:
Tree: d0d581cbc08842a6486ff987d1424fe8d0f65277
File Lines added Lines deleted
debian/changelog 2 0
sponge.c 5 22
sponge.docbook 2 1
File debian/changelog changed (mode: 100644) (index 1d6c0e5..ae71b8c)
1 1 moreutils (0.42) UNRELEASED; urgency=low moreutils (0.42) UNRELEASED; urgency=low
2 2
3 3 * Typo. Closes: #596032 * Typo. Closes: #596032
4 * sponge: Guarantee that output file is always updated atomically,
5 by renaming a temp file into place. Closes: #592144
4 6
5 7 -- Joey Hess <joeyh@debian.org> Wed, 08 Sep 2010 02:09:29 -0400 -- Joey Hess <joeyh@debian.org> Wed, 08 Sep 2010 02:09:29 -0400
6 8
File sponge.c changed (mode: 100644) (index 242298d..ea343d0)
... ... int main (int argc, char **argv) {
262 262 FILE *outfile, *tmpfile = 0; FILE *outfile, *tmpfile = 0;
263 263 ssize_t i = 0; ssize_t i = 0;
264 264 size_t mem_available = default_sponge_size(); size_t mem_available = default_sponge_size();
265 struct stat statbuf;
265 266
266 267 if (argc > 2 || (argc == 2 && strcmp(argv[1], "-h") == 0)) { if (argc > 2 || (argc == 2 && strcmp(argv[1], "-h") == 0)) {
267 268 usage(); usage();
 
... ... int main (int argc, char **argv) {
269 270 if (argc == 2) { if (argc == 2) {
270 271 outname = argv[1]; outname = argv[1];
271 272 } }
272
273
274 tmpfile = open_tmpfile();
273 275 bufstart = buf = malloc(bufsize); bufstart = buf = malloc(bufsize);
274 276 if (!buf) { if (!buf) {
275 277 perror("failed to allocate memory"); perror("failed to allocate memory");
 
... ... int main (int argc, char **argv) {
279 281 bufused = bufused+i; bufused = bufused+i;
280 282 if (bufused == bufsize) { if (bufused == bufsize) {
281 283 if ((bufsize*2) >= mem_available) { if ((bufsize*2) >= mem_available) {
282 if (!tmpfile) {
283 tmpfile=open_tmpfile();
284 }
285 284 write_buff_tmp(bufstart, bufused, tmpfile); write_buff_tmp(bufstart, bufused, tmpfile);
286 285 bufused = 0; bufused = 0;
287 286 } }
 
... ... int main (int argc, char **argv) {
300 299 perror("failed to read from stdin"); perror("failed to read from stdin");
301 300 exit(1); exit(1);
302 301 } }
303 if (tmpfile) {
304 struct stat statbuf;
305 302
306 303 /* write whatever we have in memory to tmpfile */ /* write whatever we have in memory to tmpfile */
307 304 if (bufused) if (bufused)
 
... ... int main (int argc, char **argv) {
319 316 ! S_ISLNK(statbuf.st_mode) ! S_ISLNK(statbuf.st_mode)
320 317 ) || errno == ENOENT) && ) || errno == ENOENT) &&
321 318 rename(tmpname, outname) == 0) { rename(tmpname, outname) == 0) {
319 tmpname=NULL;
322 320 /* Fix renamed file mode to match either /* Fix renamed file mode to match either
323 321 * the old file mode, or the default file * the old file mode, or the default file
324 322 * mode for a newly created file. */ * mode for a newly created file. */
 
... ... int main (int argc, char **argv) {
345 343 exit(1); exit(1);
346 344 } }
347 345 copy_tmpfile(tmpfile, outfile, bufstart, bufsize); copy_tmpfile(tmpfile, outfile, bufstart, bufsize);
346 fclose(outfile);
348 347 } }
349 348 else { else {
350 349 copy_tmpfile(tmpfile, stdout, bufstart, bufsize); copy_tmpfile(tmpfile, stdout, bufstart, bufsize);
351 350 } }
352 }
353 else {
354 if (outname) {
355 outfile = fopen(outname, "w");
356 if (!outfile) {
357 perror("error opening output file");
358 exit(1);
359 }
360 }
361 else {
362 outfile = stdout;
363 }
364 if (bufused)
365 write_buff_out(bufstart, bufused, outfile);
366 fclose(outfile);
367 }
368 351
369 352 return 0; return 0;
370 353 } }
File sponge.docbook changed (mode: 100644) (index 24c432a..ab2c42d)
... ... USA
58 58 redirect, sponge soaks up all its input before redirect, sponge soaks up all its input before
59 59 opening the output file. This allows constricting opening the output file. This allows constricting
60 60 pipelines that read from and write to pipelines that read from and write to
61 the same file. </para>
61 the same file. It also creates the output file
62 atomically by renaming a temp file into place.</para>
62 63 <para>If no output file is specified, sponge outputs to <para>If no output file is specified, sponge outputs to
63 64 stdout.</para> stdout.</para>
64 65
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/nicolas/debian.moreutils

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/nicolas/debian.moreutils

Clone this repository using git:
git clone git://git.rocketgit.com/user/nicolas/debian.moreutils

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main