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 311359 Details for
Bug 453613
FEAT: md5sum check should have an override for attaching packages
[?]
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]
A New patch under rob's suggestion
bug453613.patch (text/plain), 5.43 KB, created by
eric_liu
on 2008-07-09 10:14:24 UTC
(
hide
)
Description:
A New patch under rob's suggestion
Filename:
MIME Type:
Creator:
eric_liu
Created:
2008-07-09 10:14:24 UTC
Size:
5.43 KB
patch
obsolete
>Index: hwcert/attachment.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/attachment.cgi,v >retrieving revision 1.13 >diff -u -r1.13 attachment.cgi >--- hwcert/attachment.cgi 19 Jun 2008 14:16:48 -0000 1.13 >+++ hwcert/attachment.cgi 9 Jul 2008 10:09:51 -0000 >@@ -917,14 +917,49 @@ > sub insert > { > my ($data) = @_; >+ >+ my $results_md5sum_override = $::FORM{'results_md5sum_override'}; >+ my $recordref; >+ my $results_certrpmid_override; >+ my $results_certid_override; >+ my $results_attachid_override; >+ my $results_bugid_override; >+ my $certrecords_query; >+ my $results_comments_override; > >- # Insert a new attachment into the database. >- >- # move duplicate checking here, it's already added to the db if we wait until processResultsRPM >- # this should be reworked and is perhaps the starting point for merging the post.cgi code > my $md5sum = GenMd5File($filename, $data); >+ > SendSQL2("SELECT filename FROM cert_rpms WHERE md5sum = " . SqlQuote($md5sum)); >- FetchOneColumn2() && ThrowUserError("duplicate_attachment"); >+ >+ if($results_md5sum_override){ >+ my $certrpms_query = "SELECT id, cert_id, attach_id FROM cert_rpms WHERE md5sum = " . SqlQuote($md5sum); >+ my $dbh_hwcert = Bugzilla->dbh2; >+ my $sth_hwcert = $dbh_hwcert->prepare($certrpms_query); >+ $sth_hwcert->execute(); >+ while ( $recordref = $sth_hwcert->fetchrow_arrayref()){ # one row one time >+ $results_certrpmid_override = $recordref -> [0]; >+ $results_certid_override = $recordref -> [1]; >+ $results_attachid_override = $recordref -> [2]; >+ $certrecords_query ="SELECT bug_id from cert_records WHERE id = " . SqlQuote($results_certid_override); >+ SendSQL2($certrecords_query); >+ $results_bugid_override = FetchOneColumn2(); >+ my $isprivact = $::FORM{'isprivate'} ? 1 : 0; >+ my $cap_over_bugid = $::FORM{'bugid'}; >+ $results_comments_override = "Notice: Certifaction Rpm Package here was depleted ," . >+ " Replaced by a new package (id=" . >+ $results_attachid_override . >+ ") in bug#" . >+ $cap_over_bugid . >+ "\n"; >+ AppendComment( $results_bugid_override, >+ $::COOKIE{"Bugzilla_login"}, >+ $results_comments_override, >+ $isprivact); >+ } >+ FetchOneColumn2(); >+ } elsif(!$results_md5sum_override){ >+ FetchOneColumn2() && ThrowUserError("duplicate_attachment"); >+ } > > # Escape characters in strings that will be used in SQL statements. > my $sqlfilename = SqlQuote($filename); >@@ -962,7 +997,7 @@ > # Support hwcert results package parsing when mimetype is right and checkbox "attachasresult" is checked. > if ( $contenttype =~ /redhat-package-manager|x-rpm|octet-stream|x-pn-realaudio/ && $attachasresult eq "true") > { >- $comment.= processResultsRpm($::FORM{'bugid'}, $filename, $attachid, $attachasresult, $data ); >+ $comment.= processResultsRpm($results_md5sum_override, $::FORM{'bugid'}, $filename, $attachid, $attachasresult, $data ); > } > > use Text::Wrap; >Index: hwcert/hwcert.pl >=================================================================== >RCS file: /cvs/qa/hwcert/hwcert.pl,v >retrieving revision 1.53 >diff -u -r1.53 hwcert.pl >--- hwcert/hwcert.pl 19 Jun 2008 14:18:57 -0000 1.53 >+++ hwcert/hwcert.pl 9 Jul 2008 10:09:52 -0000 >@@ -1003,6 +1003,7 @@ > > sub processResultsRpm > { >+ my $results_md5sum_override = shift @_; > my $bug_id = shift @_; > my $filename = shift @_; > my $attachid = shift @_; >@@ -1046,7 +1047,11 @@ > > # Verify we haven't already seen this package > SendSQL2("SELECT filename FROM cert_rpms WHERE md5sum = " . SqlQuote($md5sum)); >- FetchOneColumn2() && ThrowUserError("duplicate_attachment"); >+ if ($results_md5sum_override){ >+ FetchOneColumn2(); >+ }elsif(!$results_md5sum_override){ >+ FetchOneColumn2() && ThrowUserError("duplicate_attachment"); >+ } > > # Explode into scratch directory so we can get the system.conf and hardware.py information > my $scratchlocation = CreateScratch($md5sum, $rpmlocation); >Index: hwcert/template/en/default/bug/upload_packages.html.tmpl >=================================================================== >RCS file: /cvs/qa/hwcert/template/en/default/bug/upload_packages.html.tmpl,v >retrieving revision 1.3 >diff -u -r1.3 upload_packages.html.tmpl >--- hwcert/template/en/default/bug/upload_packages.html.tmpl 19 Jun 2008 14:20:58 -0000 1.3 >+++ hwcert/template/en/default/bug/upload_packages.html.tmpl 9 Jul 2008 10:09:52 -0000 >@@ -27,6 +27,14 @@ > document.getElementById("attachasresult_prompt").style.display = "inline"; > } > </script> >+ >+ <script> >+ function doConfirm(){ >+ window.confirm("Do you really want to override the already exist package") >+ } >+ </script> >+ >+ > <hr/> > > <h3>Upload Results Package or Specification Document</h3> >@@ -42,6 +50,13 @@ > <input type="hidden" name="contenttypemethod" value="autodetect"> > <em>Enter the path to the results package or spec file on your computer.</em><br/> > <input type="file" name="data" id="data" size="50" onchange="verify_filename()" > >+ [% IF UserInGroup('hwcert_edit') %] >+ <br> >+ <select name="results_md5sum_override"> >+ <option value="0" selected > Don't 'override the package </option> >+ <option value="1" onclick = "doConfirm()" > override the old package </option> >+ </select> >+ [% END %] > </td> > </tr> > <tr>
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 453613
:
311105
|
311359
|
311524
|
311916
|
312278
|
312754
|
312935