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)
another round of whitespace fixes c391b00d2837d1571ac1d361551378adf19ae83f Joey Hess 2008-04-11 19:50:47
remove debug 919ce1f7b6d80dfdc3c613f898215962985f9c66 Brock Noland 2008-04-11 19:22:39
sponge fixes 42c5c5a799502743307b392bf9e7c0205ef85ace Brock Noland 2008-04-11 18:16:09
better usage message 73327f97a62619cb8b1a0bc03e5e105839449f9a Joey Hess 2008-04-11 04:36:46
update changelog 79c6fe1242a4747c4adbcc9030d2cadc61c1028a Joey Hess 2008-04-11 04:35:24
convert to new format 2c8be0fef4c247de0e5511abdbda25e3611b9f8c Joey Hess 2008-04-11 04:32:31
first pass thru the code b2174f2df2410bf82fe646bcedd333ddbd7dbf66 Joey Hess 2008-04-11 03:49:31
make sponge use a temp file if the input is large 866dfb32b3ba7d0be153608b28dd9f461986251d Joey Hess 2008-04-11 03:28:15
sponge, ifne: Ensure that suspending/resuming doesn't result in partial writes of the data, by using fwrite() rather than write(). ddcbf562e3b6bb3a4441cc640c756127be4cf26b Joey Hess 2008-04-10 18:11:21
sponge: Ensure that suspending/resuming doesn't result in partial writes of the data, by using fwrite() rather than write(). 71349b5ae83878f4e59fc6517976998150856933 Joey Hess 2008-04-10 18:05:25
Add ifne, contributed by Javier Merino. 2fbf7a9636fae8012298901e98e63cc1b32745ee Joey Hess 2008-03-20 16:57:08
Moreutils: Added ifne 752a84ae61dd1c37dec9a1cb0d30e8c27db1994a Javier Merino 2008-03-20 12:03:26
releasing version 0.28 33a313d03913e33ca8b8803caeb70baa8486ce32 Joey Hess 2008-02-02 22:27:02
* Add example to man page about recursive modification of directories. Closes: #390099 a3627335c84246278d940b250c7d4c61df7595c3 Joey Hess 2008-02-02 22:24:39
* vidir: Applied patch from Stefan Fritsch (one part of #412176): - Check for control characters (especially newlines) in filenames and error out, since this can greatly confuse the editor or vidir. - If the source of a rename does not exist (and thus the rename will fail anyway), vidir should not move an existing target file to a tmpfile. - If a directory is renamed, vidir should take that into account when renaming files in this directory. - If a directory name is passed as name/ to vidir, vidir should not add second slash after the name. * vidir: Add support for unlinking directories. To recursivly delete a directory and its contents, pipe find to vidir, and delete the directory and its contents in the editor. Closes: #412176 bc053c5868a14bd166160ffd2b143dd47622aba5 Joey Hess 2008-02-02 22:18:59
* Moved to a git repository. 6c5feb7e384bcf7bae50ccfbefff2db9f03de35c Joey Hess 2008-02-02 22:03:34
releasing version 0.27 7d606d7c155c331eff7601476cbf7ba48e6dc49b joeyh 2008-02-02 21:44:09
* vidir: Check exit codes of close. Closes: #463739 8437ce241dda9004cd87b0d46ce6e7ff197fc927 joeyh 2008-02-02 21:42:22
releasing version 0.26 36f9ddc3d3d521a1568685d2882ea892fda51593 joeyh 2007-11-28 19:24:05
* isutf8: Correct inverted exit code when passed a file to check. Closes: #453306 a7b6e16281c45aa91395a8dcdaa623d6bce69bab joeyh 2007-11-28 19:19:39
Commit c391b00d2837d1571ac1d361551378adf19ae83f - another round of whitespace fixes
Author: Joey Hess
Author date (UTC): 2008-04-11 19:50
Committer name: Joey Hess
Committer date (UTC): 2008-04-11 19:50
Parent(s): 919ce1f7b6d80dfdc3c613f898215962985f9c66
Signer:
Signing key:
Signing status: N
Tree: ba31aa1d4bf8463fb0acfed1474abab79b737e95
File Lines added Lines deleted
sponge.c 55 54
File sponge.c changed (mode: 100644) (index fc592e6..a88fe0e)
... ... static void cs_leave (struct cs_status status) {
74 74 } }
75 75
76 76 static void cleanup() { static void cleanup() {
77 if(strcmp(tmpname, DEFAULT_TMP_NAME)) {
78 unlink(tmpname);
79 }
77 if (strcmp(tmpname, DEFAULT_TMP_NAME)) {
78 unlink(tmpname);
79 }
80 80 } }
81 81
82 82 static void onexit_cleanup (void) { static void onexit_cleanup (void) {
 
... ... static size_t default_sponge_size (void) {
133 133 /* Use no less than the minimum. */ /* Use no less than the minimum. */
134 134 return MAX (size, MIN_SPONGE_SIZE); return MAX (size, MIN_SPONGE_SIZE);
135 135 } }
136
136
137 137 void trapsignals (void) { void trapsignals (void) {
138 138 ssize_t i = 0; ssize_t i = 0;
139 139 static int const sig[] = { static int const sig[] = {
 
... ... void trapsignals (void) {
184 184 } }
185 185
186 186 static void write_buff_tmp(char* buff, size_t length, FILE *fd) { static void write_buff_tmp(char* buff, size_t length, FILE *fd) {
187 if (fwrite(buff, length, 1, fd) < 1) {
188 perror("error writing buffer to temporary file");
189 fclose(fd);
190 exit(1);
191 }
187 if (fwrite(buff, length, 1, fd) < 1) {
188 perror("error writing buffer to temporary file");
189 fclose(fd);
190 exit(1);
191 }
192 192 } }
193
193 194 static void write_buff_out(char* buff, size_t length, FILE *fd) { static void write_buff_out(char* buff, size_t length, FILE *fd) {
194 if (fwrite(buff, length, 1, fd) < 1) {
195 perror("error writing buffer to output file");
196 fclose(fd);
197 exit(1);
198 }
195 if (fwrite(buff, length, 1, fd) < 1) {
196 perror("error writing buffer to output file");
197 fclose(fd);
198 exit(1);
199 }
199 200 } }
201
200 202 static void copy_tmpfile(FILE *tmpfile, FILE *outfd) { static void copy_tmpfile(FILE *tmpfile, FILE *outfd) {
201 char buf[BUFF_SIZE];
202 if (fseek(tmpfile, 0, SEEK_SET)) {
203 perror("could to seek to start of temporary file");
204 fclose(tmpfile);
205 exit(1);
206 }
207 // XXX I'd catch signals or writes errors here, but I
208 // I don't think it matters as the file is overwritten
209 while(fread(buf, BUFF_SIZE, 1, tmpfile) == 1) {
210 write_buff_out(buf, BUFF_SIZE, outfd);
211 }
212 fclose(tmpfile);
213 fclose(outfd);
203 char buf[BUFF_SIZE];
204 if (fseek(tmpfile, 0, SEEK_SET)) {
205 perror("could to seek to start of temporary file");
206 fclose(tmpfile);
207 exit(1);
208 }
209 // XXX I'd catch signals or writes errors here, but I
210 // I don't think it matters as the file is overwritten
211 while(fread(buf, BUFF_SIZE, 1, tmpfile) == 1) {
212 write_buff_out(buf, BUFF_SIZE, outfd);
213 }
214 fclose(tmpfile);
215 fclose(outfd);
214 216 } }
215 217
216 218 int main (int argc, char **argv) { int main (int argc, char **argv) {
 
... ... int main (int argc, char **argv) {
234 236 if (bufused == bufsize) { if (bufused == bufsize) {
235 237 if ((bufsize*2) >= mem_available) { if ((bufsize*2) >= mem_available) {
236 238 if (!tmpfile) { if (!tmpfile) {
237 /*
238 umask(077); FIXME: Should we be setting umask, or using default?
239 */
239 /* umask(077); FIXME: Should we be setting umask, or using default? */
240 240 struct cs_status cs = cs_enter(); struct cs_status cs = cs_enter();
241 241 int tmpfd = mkstemp(tmpname); int tmpfd = mkstemp(tmpname);
242 242 atexit(onexit_cleanup); // solaris on_exit(onexit_cleanup, 0); atexit(onexit_cleanup); // solaris on_exit(onexit_cleanup, 0);
243 trapsignals();
243 trapsignals();
244 244 cs_leave(cs); cs_leave(cs);
245 245 if (tmpfd < 0) { if (tmpfd < 0) {
246 246 perror("mkstemp failed"); perror("mkstemp failed");
 
... ... int main (int argc, char **argv) {
248 248 } }
249 249 tmpfile = fdopen(tmpfd, "w+"); tmpfile = fdopen(tmpfd, "w+");
250 250 } }
251 write_buff_tmp(bufstart, bufused, tmpfile);
251 write_buff_tmp(bufstart, bufused, tmpfile);
252 252 bufused = 0; bufused = 0;
253 253 } }
254 254 else { else {
 
... ... int main (int argc, char **argv) {
270 270 outname = argv[1]; outname = argv[1];
271 271 } }
272 272 if (tmpfile) { if (tmpfile) {
273 /* write whatever we have in memory to tmpfile */
274 write_buff_tmp(bufstart, bufused, tmpfile);
275 struct stat statbuf;
273 /* write whatever we have in memory to tmpfile */
274 write_buff_tmp(bufstart, bufused, tmpfile);
275 struct stat statbuf;
276 276 if (outname && !stat(outname, &statbuf)) { if (outname && !stat(outname, &statbuf)) {
277 /* regular file */
278 if(S_ISREG(statbuf.st_mode) && !fclose(tmpfile)) {
279 if(rename(tmpname, outname)) {
280 perror("error renaming temporary file to output file");
281 exit(1);
282 }
283 }
284 else {
285 FILE *outfd = fopen(outname, "w");
286 if (outfd < 0) {
287 perror("error opening output file");
288 exit(1);
289 }
290 copy_tmpfile(tmpfile, outfd);
291 }
277 /* regular file */
278 if (S_ISREG(statbuf.st_mode) && !fclose(tmpfile)) {
279 if (rename(tmpname, outname)) {
280 perror("error renaming temporary file to output file");
281 exit(1);
282 }
283 }
284 else {
285 FILE *outfd = fopen(outname, "w");
286 if (outfd < 0) {
287 perror("error opening output file");
288 exit(1);
289 }
290 copy_tmpfile(tmpfile, outfd);
291 }
292 292 } }
293 293 else { else {
294 copy_tmpfile(tmpfile, stdout);
294 copy_tmpfile(tmpfile, stdout);
295 295 } }
296 296 } }
297 297 else { else {
298 FILE *outfd = stdout;
298 FILE *outfd = stdout;
299 299 if (outname) { if (outname) {
300 300 outfd = fopen(outname, "w"); outfd = fopen(outname, "w");
301 301 if (outfd < 0) { if (outfd < 0) {
 
... ... int main (int argc, char **argv) {
303 303 exit(1); exit(1);
304 304 } }
305 305 } }
306 write_buff_out(bufstart, bufused, outfd);
307 fclose(outfd);
306 write_buff_out(bufstart, bufused, outfd);
307 fclose(outfd);
308 308 } }
309
309 310 return 0; return 0;
310 311 } }
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