Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 144075 Details for
Bug 220286
Feature request: checkisomd5 "gauge" progress percentage lines
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to add "gauge" support to checkisomd5
isomd5sum-gauge.patch (text/plain), 3.80 KB, created by
Ryan Finnie
on 2006-12-20 06:50:20 UTC
(
hide
)
Description:
Patch to add "gauge" support to checkisomd5
Filename:
MIME Type:
Creator:
Ryan Finnie
Created:
2006-12-20 06:50:20 UTC
Size:
3.80 KB
patch
obsolete
>diff -ruN checkisomd5.c checkisomd5.c >--- checkisomd5.c 2003-07-07 20:00:53.000000000 -0700 >+++ checkisomd5.c 2006-12-19 22:03:44.000000000 -0800 >@@ -12,17 +12,21 @@ > int main(int argc, char **argv) { > int i; > int rc; >+ int flags; > int verbose; >+ int gauge; > int md5only; > int filearg; > > if (argc < 2) { >- printf("Usage: checkisomd5 [--md5sumonly] [--verbose] <isofilename>|<blockdevice>\n\n"); >+ printf("Usage: checkisomd5 [--md5sumonly] [--verbose] [--gauge] <isofilename>|<blockdevice>\n\n"); > exit(1); > } > > md5only = 0; >+ flags = 1; /* mediaCheckFile defaults to verbose, not quiet, so prepopulate the "quiet" bit */ > verbose = 0; >+ gauge = 1; > filearg = 1; > for (i=1; i < argc; i++) { > if (strcmp(argv[i], "--md5sumonly") == 0) { >@@ -30,7 +34,12 @@ > filearg++; > } else if (strcmp(argv[i], "--verbose") == 0) { > filearg++; >+ flags ^= 1; > verbose = 1; >+ } else if (strcmp(argv[i], "--gauge") == 0) { >+ filearg++; >+ flags ^= 2; >+ gauge = 1; > } else > break; > } >@@ -41,7 +50,7 @@ > if (md5only) > exit(0); > >- rc = mediaCheckFile(argv[filearg], !verbose); >+ rc = mediaCheckFile(argv[filearg], flags); > > /* 1 means it passed, 0 means it failed, -1 means we couldnt find chksum */ > if (rc == 1) >diff -ruN libcheckisomd5.c libcheckisomd5.c >--- libcheckisomd5.c 2005-08-10 08:21:31.000000000 -0700 >+++ libcheckisomd5.c 2006-12-19 22:00:17.000000000 -0800 >@@ -158,7 +158,7 @@ > /* returns -1 if no checksum encoded in media, 0 if no match, 1 if match */ > /* mediasum is the sum encoded in media, computedsum is one we compute */ > /* both strings must be pre-allocated at least 33 chars in length */ >-static int checkmd5sum(int isofd, char *mediasum, char *computedsum, int quiet) { >+static int checkmd5sum(int isofd, char *mediasum, char *computedsum, int flags) { > int nread; > int i, j; > int appdata_start_offset, appdata_end_offset; >@@ -178,6 +178,13 @@ > char thisfragsum[FRAGMENT_SUM_LENGTH]; > long long fragmentcount = 0; > MD5_CTX md5ctx, fragmd5ctx; >+ int quiet; >+ int gauge; >+ int gaugeat = -1; >+ int gaugeval; >+ >+ quiet = (((flags & 1) == 1) ? 1 : 0); /* bit 1: quiet */ >+ gauge = (((flags & 2) == 2) ? 1 : 0); /* bit 2: gauge */ > > if ((pvd_offset = parsepvd(isofd, mediasum, &skipsectors, &isosize, &supported, fragmentsums, &fragmentcount)) < 0) > return -1; >@@ -273,6 +280,14 @@ > printf("\b\b\b\b\b\b%05.1f%%", (100.0*offset)/(isosize-skipsectors*2048.0)); > fflush(stdout); > } >+ if (gauge) { >+ gaugeval = (100.0*offset)/(isosize-skipsectors*2048.0); >+ if (gaugeval != gaugeat) { >+ printf("%d\n", gaugeval); >+ fflush(stdout); >+ gaugeat = gaugeval; >+ } >+ } > } > > if (!quiet) { >@@ -318,7 +333,7 @@ > } > #endif > >-static int doMediaCheck(int isofd, char *mediasum, char *computedsum, long long *isosize, int *supported, int quiet) { >+static int doMediaCheck(int isofd, char *mediasum, char *computedsum, long long *isosize, int *supported, int flags) { > int rc; > int skipsectors; > long long fragmentcount = 0; >@@ -332,18 +347,21 @@ > return -1; > } > >- rc = checkmd5sum(isofd, mediasum, computedsum, quiet); >+ rc = checkmd5sum(isofd, mediasum, computedsum, flags); > > return rc; > } > >-int mediaCheckFile(char *file, int quiet) { >+int mediaCheckFile(char *file, int flags) { > int isofd; > int rc; > char *result; > char mediasum[33], computedsum[33]; > long long isosize; > int supported; >+ int quiet; >+ >+ quiet = (((flags & 1) == 1) ? 1 : 0); /* bit 1: quiet */ > > isofd = open(file, O_RDONLY); > >@@ -352,7 +370,7 @@ > return -1; > } > >- rc = doMediaCheck(isofd, mediasum, computedsum, &isosize, &supported, quiet); >+ rc = doMediaCheck(isofd, mediasum, computedsum, &isosize, &supported, flags); > > close(isofd); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 220286
: 144075