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 311105 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]
patch of bug 453613
override.patch (text/plain), 10.96 KB, created by
eric_liu
on 2008-07-06 22:06:24 UTC
(
hide
)
Description:
patch of bug 453613
Filename:
MIME Type:
Creator:
eric_liu
Created:
2008-07-06 22:06:24 UTC
Size:
10.96 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 6 Jul 2008 21:26:54 -0000 >@@ -918,13 +918,62 @@ > { > my ($data) = @_; > >+ # This is a flag of override option on UI >+ my $override = $::FORM{'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); >+ # Add override option logic control; >+ # Here is the pseudo-code >+ # >+ # if $override { >+ # delete the same package; >+ # do FetchOneColumn2(); >+ # add the Notify to tell the old one is depleted; >+ # } else { >+ # do everything as what we do now; >+ # } >+ # >+ # OK , let,s bring it to fruition now ;) >+ # >+ # FetchOneColumn2() && ThrowUserError("duplicate_attachment"); >+ # >+ # Notice: Don't Delete the old conflict one, because we will use it in function processResultsRpm() later >+ >+ # Retrieval the cert_id of exsited confilct package >+ my $certid_sql = "SELECT cert_id from cert_rpms where md5sum = " . SqlQuote($md5sum) ; >+ SendSQL2( $certid_sql ); >+ my $dupkg_certid = FetchOneColumn2(); >+ >+ # Retrieval the bug_id of exsited confilct package >+ my $bugid_sql = "SELECT bug_id from cert_records where id = " . SqlQuote($dupkg_certid) ; >+ SendSQL2( $bugid_sql ); >+ my $dupkg_bugid = FetchOneColumn2(); >+ >+ # We get the conflict infomation through the uniqueness of md5sum string > SendSQL2("SELECT filename FROM cert_rpms WHERE md5sum = " . SqlQuote($md5sum)); >- FetchOneColumn2() && ThrowUserError("duplicate_attachment"); >+ >+ if($override){ >+ # The hwcert-editor want to override the conflict exsisted package >+ print STDERR "run to before FetchOneColumn2 !!!"; >+ my $new_bugid = $::FORM{'bugid'}; >+ my $isprivact = $::FORM{'isprivate'} ? 1 : 0; >+ >+ FetchOneColumn2(); >+ >+ # We should also add a notify comments to bug where the old packages stay. >+ my $comment2 = "Notice: Certifaction Rpm Package here was depleted !"; >+ AppendComment($dupkg_bugid, >+ $::COOKIE{"Bugzilla_login"}, >+ $comment2, >+ $isprivact); >+ }elsif(!$override){ >+ FetchOneColumn2() && ThrowUserError("duplicate_attachment"); >+ } >+ > > # Escape characters in strings that will be used in SQL statements. > my $sqlfilename = SqlQuote($filename); >@@ -962,7 +1011,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($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 6 Jul 2008 21:26:55 -0000 >@@ -1003,6 +1003,8 @@ > > sub processResultsRpm > { >+ # This is a flag of override option on UI >+ my $override = shift @_; > my $bug_id = shift @_; > my $filename = shift @_; > my $attachid = shift @_; >@@ -1046,7 +1048,46 @@ > > # Verify we haven't already seen this package > SendSQL2("SELECT filename FROM cert_rpms WHERE md5sum = " . SqlQuote($md5sum)); >- FetchOneColumn2() && ThrowUserError("duplicate_attachment"); >+ # Add override option logic control; >+ # Here is the pseudo-code >+ # >+ # if $override { >+ # delete the same package; >+ # do FetchOneColumn2(); >+ # } else { >+ # do everything as what we do now; >+ # } >+ # >+ # OK , let,s bring it to fruition now ;) >+ # >+ # FetchOneColumn2() && ThrowUserError("duplicate_attachment"); >+ # >+ # Notice: Don't add comments here, because the attachment has already processed that notify comments >+ >+ if ($override){ >+ >+ # Retrieval the cert_id of exsited confilct package >+ my $certid_sql = "SELECT cert_id FROM cert_rpms where md5sum = " . SqlQuote($md5sum) ; >+ SendSQL2( $certid_sql ); >+ my $dupkg_certid = FetchOneColumn2(); >+ >+ FetchOneColumn2(); >+ >+ # Remove the old package's md5sum record from cert_rpms >+ my $dupid_sql="SELECT id from cert_rpms where cert_id = " . SqlQuote($dupkg_certid) ; >+ SendSQL2($dupid_sql); >+ my $dupid = FetchOneColumn2(); >+ >+ my $deldup_sql="DELETE FROM cert_rpms where id = " . SqlQuote($dupid) ; >+ SendSQL2($deldup_sql); >+ >+ my $newid_sql="SELECT id FROM cert_rpms WHERE md5sum = " . SqlQuote($md5sum) ; >+ SendSQL2($newid_sql); >+ my $newid = FetchOneColumn2(); >+ >+ }elsif(!$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/post.cgi >=================================================================== >RCS file: /cvs/qa/hwcert/post.cgi,v >retrieving revision 1.57 >diff -u -r1.57 post.cgi >--- hwcert/post.cgi 19 Jun 2008 14:19:54 -0000 1.57 >+++ hwcert/post.cgi 6 Jul 2008 21:26:55 -0000 >@@ -148,9 +148,69 @@ > # Create a temporary file and get md5sum from it > $md5sum = GenMd5File($filename, $data); > >- # Reject duplicate packages >- SendSQL2("SELECT filename FROM cert_rpms WHERE md5sum = " . SqlQuote($md5sum)); >- FetchOneColumn2() && ThrowUserError("duplicate_attachment"); >+ # This is a flag of override option on UI >+ my $override = $cgi->param('override'); >+ >+ # Add override option logic control; >+ # Here is the pseudo-code >+ # >+ # if $override { >+ # delete the same package; >+ # do FetchOneColumn2(); >+ # add the Notify to tell the old one is depleted; >+ # } else { >+ # do everything as what we do now; >+ # } >+ # >+ # OK , let,s bring it to fruition now ;) >+ # >+ # FetchOneColumn2() && ThrowUserError("duplicate_attachment"); >+ >+ # Retrieval the cert_id of exsited confilct package >+ my $certid_sql = "SELECT cert_id from cert_rpms where md5sum = " . SqlQuote($md5sum) ; >+ SendSQL2( $certid_sql ); >+ my $dupkg_certid = FetchOneColumn2(); >+ >+ # Retrieval the bug_id of exsited confilct package >+ my $bugid_sql = "SELECT bug_id from cert_records where id = " . SqlQuote($dupkg_certid) ; >+ SendSQL2( $bugid_sql ); >+ my $dupkg_bugid = FetchOneColumn2(); >+ >+ # We get the conflict infomation through the uniqueness of md5sum string >+ SendSQL2("SELECT filename FROM cert_rpms WHERE md5sum = " . SqlQuote($md5sum)); >+ >+ # No dup_package ,we will override nothing, even through the override options is checked >+ $override = 0 if (!$dupkg_certid); >+ >+ if($override){ >+ # The hwcert-editor want to override the conflict exsisted package >+ print STDERR "run to before FetchOneColumn2 !!!"; >+ my $new_bugid = $::FORM{'bugid'}; >+ my $isprivact = $::FORM{'isprivate'} ? 1 : 0; >+ >+ FetchOneColumn2(); >+ >+ # We should also add a notify comments to bug where the old packages stay. >+ my $comment2 = "Notice: Certifaction Rpm Package here was depleted !"; >+ AppendComment($dupkg_bugid, >+ $::COOKIE{"Bugzilla_login"}, >+ $comment2, >+ $isprivact); >+ >+ # Remove the old package's md5sum record from cert_rpms >+ my $dupid_sql="SELECT id FROM cert_rpms where cert_id = " . SqlQuote($dupkg_certid) ; >+ SendSQL2($dupid_sql); >+ my $dupid = FetchOneColumn2(); >+ >+ my $deldup_sql="DELETE FROM cert_rpms where id = " . SqlQuote($dupid) ; >+ SendSQL2($deldup_sql); >+ >+ my $newid_sql="SELECT id FROM cert_rpms WHERE md5sum = " . SqlQuote($md5sum) ; >+ SendSQL2($newid_sql); >+ my $newid = FetchOneColumn2(); >+ }elsif(!$override){ >+ FetchOneColumn2() && ThrowUserError("duplicate_attachment"); >+ } > > # Move file to final resting place > $rpmlocation = CreateRpm($md5sum, $filename, $data); >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 6 Jul 2008 21:26:56 -0000 >@@ -27,6 +27,11 @@ > 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 +47,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()" > >+ <br/> >+ [% IF UserInGroup('hwcert_edit') %] >+ <select name="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> >Index: hwcert/template/en/default/bug/create/create.html.tmpl >=================================================================== >RCS file: /cvs/qa/hwcert/template/en/default/bug/create/create.html.tmpl,v >retrieving revision 1.13 >diff -u -r1.13 create.html.tmpl >--- hwcert/template/en/default/bug/create/create.html.tmpl 23 Jul 2007 17:04:22 -0000 1.13 >+++ hwcert/template/en/default/bug/create/create.html.tmpl 6 Jul 2008 21:26:56 -0000 >@@ -28,6 +28,12 @@ > %] > [% USE Bugzilla %] > >+<script> >+ function doConfirm(){ >+ window.confirm("Do you really want to override the already exist package") >+ } >+</script> >+ > <form method="post" action="post.cgi" enctype="multipart/form-data"> > <input type="hidden" name="product" value="[% product FILTER html %]"> > >@@ -172,6 +178,13 @@ > <em>Enter the path to the certification package on your computer.<br/> > This file can be found in /redhatready or /var/hts on your machine being certified.</em><br> > <input type="file" name="data" size="50"> >+ <br> >+ [% IF UserInGroup('hwcert_edit') %] >+ <select name="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