Merge lp:~manchicken/kubuntu-debug-installer/kubuntu-debug-installer into lp:kubuntu-debug-installer
- kubuntu-debug-installer
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~manchicken/kubuntu-debug-installer/kubuntu-debug-installer |
Merge into: | lp:kubuntu-debug-installer |
Diff against target: |
649 lines (+485/-17) 8 files modified
src/CMakeLists.txt (+2/-0) src/DebugFinder.cpp (+211/-7) src/DebugFinder.h (+37/-5) src/DebugInstaller.cpp (+11/-5) src/LSBRelease.cpp (+66/-0) src/LSBRelease.h (+43/-0) src/QAptDecorator.cpp (+81/-0) src/QAptDecorator.h (+34/-0) |
To merge this branch: | bzr merge lp:~manchicken/kubuntu-debug-installer/kubuntu-debug-installer |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Harald Sitter | Needs Fixing | ||
Jonathan Thomas | Pending | ||
Review via email: mp+177273@code.launchpad.net |
This proposal supersedes a proposal from 2013-07-23.
This proposal has been superseded by a proposal from 2013-08-04.
Commit message
Description of the change
This includes the reloadCache() call that JT recommended. Includes all of the fixes from Harold.
Philip Muškovac (yofel) wrote : Posted in a previous version of this proposal | # |
Michael D. Stemle, Jr. (manchicken) wrote : Posted in a previous version of this proposal | # |
I've added that base repository now, please re-review.
Jonathan Thomas (echidnaman) wrote : Posted in a previous version of this proposal | # |
One comment, when the cache update transaction finishes, you'll need to call m_backend->reload() to ensure the new package is available. (Build a new cache based on the new source info) Strange things can happen if you don't.
Looks good otherwise. Sorry for the delay in reviewing; real life has been a bit crazy lately...
Harald Sitter (apachelogger) wrote : Posted in a previous version of this proposal | # |
Do you want a codestyle review as well? Because I am really good at that :P
Also, Jonathan, what is up with the decorator. It looks like libqapt got shot in the head and now its brainz are spread all over debug-installer's code :O
Michael D. Stemle, Jr. (manchicken) wrote : Posted in a previous version of this proposal | # |
On Jul 23, 2013 2:53 AM, "Harald Sitter" <email address hidden> wrote:
>
> Do you want a codestyle review as well? Because I am really good at that
:P
I'll accept style criticism as long as there's a "why" which isn't
arbitrary :-)
>
> Also, Jonathan, what is up with the decorator. It looks like libqapt got
shot in the head and now its brainz are spread all over debug-installer's
code :O
QApt doesn't have error strings, I put that decorator there to give me some
(credit to JT, I did just sin and paste it mostly verbatim).
> --
>
https:/
> You are the owner of
lp:~manchicken/kubuntu-debug-installer/kubuntu-debug-installer.
Harald Sitter (apachelogger) wrote : Posted in a previous version of this proposal | # |
Yeah I don't think that decorator thing makes sense at all, but that's a library thing and libqapts fault really. Why would every application using qapt have to carry a verbatim code copy with strings around?
As for style... here comes the style PITA police :P
Please note that we use 4 space indent in the source code. Also please review your added includes, just from looking at the diff it seems like they are not actually all necessary.
> m_txn = NULL;
By convention we use 0 in Qt software. No clue what a txn is, perhaps a more descriptive name would be good.
> QString headerText = i18n("<b>Adding debug symbol sources</b>");
please have a look at i18nc [1] and in particular you'd want to get rid of the <b> and use <title> for example [2]. this applies to the entire diff.
also, why not simply merge the i18nc() into the next line
m_progress.
and on that note I would make m_progress a pointer to get it out of the header for compile time's sake and to reduce overall startup workload
> hcRepoList
same as with m_txn, no clue what hc stands for....
> QString(
constructing using QString:
> int sourceCount = sourceList.
I reckon this value is const, yet the code doesn't say so.
> foreach (QApt::SourceEntry repo, hcRepoList)
Not sure whether that is possible, but generally speaking that should be const QApt::SourceEntry &repo to avoid pointless copying.
By convention this should be foreach (...) { ... i.e. opening angle braces on the same line [3]
> m_srcUpdated
variable name again, I guess this should be something like m_srcsListUpdated
> this->find();
convention again, no this unless necessary.
> int m_srcCount;
unused it seems
> add_definitions
I don't think we'd want a set debug area (seems unnecessary and is only advised for libs/plugins), at any rate we'd not want a static debug area but register one dynamically [4]
> headerText = i18n("<
like above and indeed it seems like not using headertext to begin with would be a good idea
[1] http://
[2] http://
[3] https:/
[4] http://
Michael D. Stemle, Jr. (manchicken) wrote : Posted in a previous version of this proposal | # |
Doh. I'll be making many of the changes you mentioned. I'll make them
Saturday. Do we have the ability to test now so we can see if it works like
we want it to? I want to get as much lined up for my hackathon Saturday as
I can.
On Jul 24, 2013 4:33 PM, "Harald Sitter" <email address hidden> wrote:
> Yeah I don't think that decorator thing makes sense at all, but that's a
> library thing and libqapts fault really. Why would every application using
> qapt have to carry a verbatim code copy with strings around?
>
> As for style... here comes the style PITA police :P
>
> Please note that we use 4 space indent in the source code. Also please
> review your added includes, just from looking at the diff it seems like
> they are not actually all necessary.
>
> > m_txn = NULL;
>
> By convention we use 0 in Qt software. No clue what a txn is, perhaps a
> more descriptive name would be good.
>
> > QString headerText = i18n("<b>Adding debug symbol sources</b>");
>
> please have a look at i18nc [1] and in particular you'd want to get rid of
> the <b> and use <title> for example [2]. this applies to the entire diff.
>
> also, why not simply merge the i18nc() into the next line
> m_progress.
>
> and on that note I would make m_progress a pointer to get it out of the
> header for compile time's sake and to reduce overall startup workload
>
> > hcRepoList
>
> same as with m_txn, no clue what hc stands for....
>
> > QString(
>
> constructing using QString:
>
> > int sourceCount = sourceList.
>
> I reckon this value is const, yet the code doesn't say so.
>
> > foreach (QApt::SourceEntry repo, hcRepoList)
>
> Not sure whether that is possible, but generally speaking that should be
> const QApt::SourceEntry &repo to avoid pointless copying.
>
> By convention this should be foreach (...) { ... i.e. opening angle
> braces on the same line [3]
>
> > m_srcUpdated
>
> variable name again, I guess this should be something like
> m_srcsListUpdated
>
> > this->find();
>
> convention again, no this unless necessary.
>
> > int m_srcCount;
>
> unused it seems
>
> > add_definitions
>
> I don't think we'd want a set debug area (seems unnecessary and is only
> advised for libs/plugins), at any rate we'd not want a static debug area
> but register one dynamically [4]
>
> > headerText = i18n("<
> like above and indeed it seems like not using headertext to begin with
> would be a good idea
>
> [1]
> http://
> [2]
> http://
> [3] https:/
> [4]
> http://
> --
>
> https:/
> You are the owner of
> lp:~manchicken/kubuntu-debug-installer/kubuntu-debug-installer.
>
Harald Sitter (apachelogger) wrote : Posted in a previous version of this proposal | # |
mh I'll do some QA (been doing that all morning anyway :S)
fwiw, I think I changed some stuff in my LSBRelease, also you may want to use the q_asserts :P
Harald Sitter (apachelogger) wrote : Posted in a previous version of this proposal | # |
krazy2 Analysis
Checkers Run = 39
Files Processed = 37
Total Issues = 13 ...as of July 25 2013 15:07:17 CEST
== messages: For File Type messages ==
1. Check for appending to rc.cpp [rcappend]... Ok!
== cmake: For File Type cmake ==
1. Check for an acceptable copyright [copyright]... Ok!
2. Check that file ends with a newline [endswithnewlin
3. Check for an acceptable license [license]... Ok!
4. Check for spelling errors [spelling]... Ok!
== c++: For File Type c++ ==
1. Check for TRUE and FALSE macros [captruefalse]... Ok!
2. Check for methods that return 'const' refs in public classes [constref]... Ok!
3. Check for an acceptable copyright [copyright]... Ok!
4. Check for cpp macros and usage [cpp]... Ok!
5. Check for code that should be considered crashy. [crashy]... Ok!
6. Check single-char QString operations for efficiency [doublequote_
7. Check for unwanted doxygen tags in major versions [doxytags]... Ok!
8. Check public classes with private members or d-pointer issues [dpointer]... Ok!
9. Check for QString compares to "" [emptystrcompar
10. Check that file ends with a newline [endswithnewlin
Files that do not end with a newline character can cause problems.
Please add a newline character to the end of the file.
11. Check for C++ ctors that should be declared 'explicit' [explicit]... Ok!
12. Check for foreach loop issues [foreach]... 1 issue found
When not using POD types (int, double, pointer, ...) you should use
const & for your foreach variables. There are two reasons for this:
1) Prevents you from the mistake of writing foreach loops that
modify the list, that is 'foreach(Foo f, list) f.a = f.b = f.c =
0;' compiles but does not modify the contents of list 2) Saves a
copy constructor call for each of the list elements
13. Check validity of i18n calls [i18ncheckarg]... 9 issues found
Make the translators' job easier and detect problems in the usage
of the i18n() calls. When the fix is not clear, check the Techbase
article at
<http://
azy> for more information.
14. Check for invalid icon names [iconnames]... Ok!
15. Check for proper include directives [includes]... 1 issue found
Use <..> to include installed headers; cpp file should include
their own headers first (but below config.h); other rules apply,
see
<http://
Michael D. Stemle, Jr. (manchicken) wrote : Posted in a previous version of this proposal | # |
Maybe we should package the LSB stuff into its own thing so we can link to
it.
On Jul 25, 2013 8:07 AM, "Harald Sitter" <email address hidden> wrote:
> mh I'll do some QA (been doing that all morning anyway :S)
>
> fwiw, I think I changed some stuff in my LSBRelease, also you may want to
> use the q_asserts :P
>
>
> --
>
> https:/
> You are the owner of
> lp:~manchicken/kubuntu-debug-installer/kubuntu-debug-installer.
>
Harald Sitter (apachelogger) wrote : Posted in a previous version of this proposal | # |
please have a look at the cmake macro macro_ensure_
Harald Sitter (apachelogger) wrote : Posted in a previous version of this proposal | # |
clang-analyzer is happy
Michael D. Stemle, Jr. (manchicken) wrote : Posted in a previous version of this proposal | # |
That may be tricky until JT gets libqapt ready, yeah?
On Jul 25, 2013 8:21 AM, "Harald Sitter" <email address hidden> wrote:
> please have a look at the cmake macro macro_ensure_
> appropriate version of libqapt is installed [1]
>
> [1]
> https:/
> --
>
> https:/
> You are the owner of
> lp:~manchicken/kubuntu-debug-installer/kubuntu-debug-installer.
>
Harald Sitter (apachelogger) wrote : Posted in a previous version of this proposal | # |
smoke results:
- clicked cancel while it was 'updating software softwares' -> cancels only that so it continues looking for debug packages
- adds ddebs entires regardless of whether they are there already
- repeatedly going from 0 to 100 % progress while saying "Updating software sources" is confusing
- debug output needs serious reduction as right now it is flooding .xsession-errors with a bazillion percent values when in debug mode
- canceling the authenticate for the software source changes makes the dailog re-appear, canceling again makes it appear again etc.etc. (in short: there is no way to get rid of it other than actually providing credentials)
- entries to ddebs.list are added 4 times, i.e. after one run I get 4 saucy, 4 saucy-updates, 4 saucy-security etc.etc.
- the update software sources dialog should probably reuse the existing one instead of creating a new one, as it is right now a user will get up to 4 cascaded windows (drkonqi < dbginstallerdialog < debugfinder < software sources)
- when the installer ask whether the new dbg packages should be installed and one cancels the application doesn't actually exit() or anything (also not when actually looking for the packages - may actually be entirely un-exitable)
- conseqeuently to above (presumably) the ddebs.list file is not removed on exit etc.
- entries to ddebs.list are added regardless of whether they are already there, i.e. every run another 4x4 entires will be added to the file
- not sure this is related to the chnanges but worrying regardless....when looking for rekonq and qt the finder will only offer to install libqt4-dbg (no clue why it goes for that, but IIRC we may have special handling that makes that happen), removing the qt bits form the file list will make it recommend rekonq-dbgsym as well
testing cmd:
kubuntu-
Harald Sitter (apachelogger) wrote : Posted in a previous version of this proposal | # |
About the LSB thing... /etc/lsb-release is not backed by a spec or anything and long-term will be replaced by /etc/os-release which is backed by a spec so I should hope that we get a KDElibs way to get os-release data. So, I am not sure it is worth the effort TBH.
Harald Sitter (apachelogger) wrote : Posted in a previous version of this proposal | # |
QA done :P
Harald Sitter (apachelogger) wrote : Posted in a previous version of this proposal | # |
> That may be tricky until JT gets libqapt ready, yeah?
Yes. No. Maybe. :P
It seems to me libqapt 2.0.65 has the sourceslist API so I guess that would be the required version right now.
I just did the analysis, how/whether the issue can be resolved or whether they were even caused by the diff at hand, I did not look at ;)
Michael D. Stemle, Jr. (manchicken) wrote : Posted in a previous version of this proposal | # |
OK. My hackathon is Saturday the 27th at 12:30 for four hours (in
Champaign, IL USA if anyone wants to join), I should be able to get
something done.
On Jul 25, 2013 8:54 AM, "Harald Sitter" <email address hidden> wrote:
> > That may be tricky until JT gets libqapt ready, yeah?
>
> Yes. No. Maybe. :P
>
> It seems to me libqapt 2.0.65 has the sourceslist API so I guess that
> would be the required version right now.
>
> I just did the analysis, how/whether the issue can be resolved or whether
> they were even caused by the diff at hand, I did not look at ;)
> --
>
> https:/
> You are the owner of
> lp:~manchicken/kubuntu-debug-installer/kubuntu-debug-installer.
>
Harald Sitter (apachelogger) wrote : | # |
much better. I reran the entire test set but there are still some issues, in particular the krazy and smoke issues are blocking for me...
------------------ style ------------------
- indention in DebugFinder changes still has lines with 0 spaces, 2 spaces, tabs, 4 spaces. should all be 4 spaces
- also please note that our style guides says for/foreach/
- numerous lines with indention but nothing after the indention
> m_aptTxn = 0;
better, but not perfect (http://
> QString(
constructing using QString:
new:
> QApt::SourceEnt
if it is hardcoded, then it probably should be static and only be built/filled once.
> #include <KProgressDialog>
in DebugFinder.h this can now be a forward decl
> connect(m_progress, SIGNAL(
I personally like to line break after the signal to make it easier to spot which objects are being wired here...
connect(m_progress, SIGNAL(
m_aptTxn, SLOT(cancel()));
------------------ smoke ------------------
(see previous smoke results
- Authentication still can not be cancelled
- ddebs entries are still added ad infinitum
- debug output still too excessive with percent values being debugged :P
- ddebs.list is still not removed at exit() if it was initially created by debug-installer
new:
- Crash when cancelling adding of sources and package lookup (http://
------------------ clang-analyzer ------------------
still happy xD
------------------ krazy2 ------------------
still issues:
krazy2 Analysis
Checkers Run = 39
Files Processed = 13
Total Issues = 9 ...as of July 30 2013 13:25:14 CEST
== messages: For File Type messages ==
1. Check for appending to rc.cpp [rcappend]... Ok!
== cmake: For File Type cmake ==
1. Check for an acceptable copyright [copyright]... Ok!
2. Check that file ends with a newline [endswithnewlin
3. Check for an acceptable license [license]... Ok!
4. Check for spelling errors [spelling]... Ok!
== c++: For File Type c++ ==
1. Check for TRUE and FALSE macros [captruefalse]... Ok!
2. Check for methods that return 'const' refs in public classes [constref]... Ok!
3. Check for an acceptable copyright [copyright]... Ok!
4. Check for cpp macros and usage [cpp]... Ok!
5. Check for code that should be considered crashy. [crashy]... Ok!
6. Check single-char QString operations for efficiency [doublequote_
7. Check for unwanted doxygen tags in major versions [doxytags]... Ok!
8. Check public classes with private members or d-pointer issues [dpointer]... Ok!
9. Check for QString compares to "" [emptystrcompar
10. Check that file ends with a newline [endswithnewlin
Files that do not end with a newline character can cause problems.
Please add a newline character to the end of the file.
11. Check for ...
Michael D. Stemle, Jr. (manchicken) wrote : | # |
In trying to get the entries removed, it looks like libqapt doesn't fully remove entries if you put them into a sources.list file... at least not the way I'm doing it. My next submission will include code to remove those sources lines, let me know if - upon testing - the file still doesn't go away. Right now I'm seeing that libqapt is expanding the sources list directory as ".", which I think may be more related to how my environment is set up.
- 108. By Michael D. Stemle, Jr. <email address hidden>
-
Made a number of changes per Harald's list: https:/
/code.launchpad .net/~manchicke n/kubuntu- debug-installer /kubuntu- debug-installer /+merge/ 177273/ comments/ 399863
Unmerged revisions
- 108. By Michael D. Stemle, Jr. <email address hidden>
-
Made a number of changes per Harald's list: https:/
/code.launchpad .net/~manchicke n/kubuntu- debug-installer /kubuntu- debug-installer /+merge/ 177273/ comments/ 399863 - 107. By Michael D. Stemle, Jr. <email address hidden>
-
Fixed some code indentation.
- 106. By Michael D. Stemle, Jr. <email address hidden>
-
Fixed some text formatting.
- 105. By Michael D. Stemle, Jr. <email address hidden>
-
Made a series of changes requested by Harold.
- 104. By Michael D. Stemle, Jr. <email address hidden>
-
Made change per JT's recommendation.
- 103. By Michael D. Stemle, Jr. <email address hidden>
-
Added the base repo.
- 102. By Michael D. Stemle, Jr. <email address hidden>
-
Fixed a small bug when debug packages weren't found.
- 101. By Michael D. Stemle, Jr. <email address hidden>
-
Added the changes for sources.list and refreshing cache: https:/
/wiki.ubuntu. com/DebuggingPr ogramCrash# Debug_Symbol_ Packages - 100. By Michael D. Stemle, Jr. <email address hidden>
-
I now have the sources add working.
- 99. By Michael D. Stemle, Jr. <email address hidden>
-
Adding LSB stuff from Herald Sitter (THANKS!) and adding some code to set up repos.
Preview Diff
1 | === modified file 'src/CMakeLists.txt' | |||
2 | --- src/CMakeLists.txt 2010-09-16 14:19:01 +0000 | |||
3 | +++ src/CMakeLists.txt 2013-08-04 08:01:27 +0000 | |||
4 | @@ -2,6 +2,8 @@ | |||
5 | 2 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) | 2 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
6 | 3 | 3 | ||
7 | 4 | set(installdbgsymbols_SRCS | 4 | set(installdbgsymbols_SRCS |
8 | 5 | QAptDecorator.cpp | ||
9 | 6 | LSBRelease.cpp | ||
10 | 5 | DebugFinder.cpp | 7 | DebugFinder.cpp |
11 | 6 | DebugInstaller.cpp | 8 | DebugInstaller.cpp |
12 | 7 | main.cpp | 9 | main.cpp |
13 | 8 | 10 | ||
14 | === modified file 'src/DebugFinder.cpp' | |||
15 | --- src/DebugFinder.cpp 2012-10-30 15:16:47 +0000 | |||
16 | +++ src/DebugFinder.cpp 2013-08-04 08:01:27 +0000 | |||
17 | @@ -2,6 +2,7 @@ | |||
18 | 2 | Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com> | 2 | Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com> |
19 | 3 | Copyright © 2010 Felix Geyer <debfx@fobos.de> | 3 | Copyright © 2010 Felix Geyer <debfx@fobos.de> |
20 | 4 | Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org> | 4 | Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org> |
21 | 5 | Copyright © 2013 Michael D. Stemle, Jr. <themanchicken@gmail.com> | ||
22 | 5 | 6 | ||
23 | 6 | This program is free software; you can redistribute it and/or | 7 | This program is free software; you can redistribute it and/or |
24 | 7 | modify it under the terms of the GNU General Public License as | 8 | modify it under the terms of the GNU General Public License as |
25 | @@ -21,17 +22,45 @@ | |||
26 | 21 | */ | 22 | */ |
27 | 22 | 23 | ||
28 | 23 | #include "DebugFinder.h" | 24 | #include "DebugFinder.h" |
32 | 24 | 25 | #include "LSBRelease.h" | |
33 | 25 | #include <QtCore/QStringList> | 26 | #include "QAptDecorator.h" |
31 | 26 | #include <QtCore/QThread> | ||
34 | 27 | 27 | ||
35 | 28 | #include <LibQApt/Backend> | 28 | #include <LibQApt/Backend> |
36 | 29 | #include <LibQApt/SourceEntry> | ||
37 | 30 | #include <LibQApt/SourcesList> | ||
38 | 31 | #include <LibQApt/Transaction> | ||
39 | 32 | #include <iostream> | ||
40 | 33 | |||
41 | 34 | #include <KDebug> | ||
42 | 35 | #include <KLocalizedString> | ||
43 | 36 | #include <KProgressDialog> | ||
44 | 37 | #include <KMessageBox> | ||
45 | 38 | #include <qfile.h> | ||
46 | 29 | 39 | ||
47 | 30 | DebugFinder::DebugFinder(QObject *parent) : | 40 | DebugFinder::DebugFinder(QObject *parent) : |
48 | 31 | QObject(parent), | 41 | QObject(parent), |
49 | 32 | m_backend(new QApt::Backend(this)), | 42 | m_backend(new QApt::Backend(this)), |
51 | 33 | m_stop(false) | 43 | m_progress(new KProgressDialog()), |
52 | 44 | m_ddebsSources(new QApt::SourceEntryList()), | ||
53 | 45 | m_sourcesList(new QApt::SourcesList(this)), | ||
54 | 46 | m_stop(false), | ||
55 | 47 | m_sourcesChangedSinceChecked(false) | ||
56 | 34 | { | 48 | { |
57 | 49 | kDebug() << "INIT!!!!!\n"; | ||
58 | 50 | m_aptTransaction = 0; | ||
59 | 51 | m_progress->progressBar()->setMaximum(100); | ||
60 | 52 | QString repoFile(QString::fromLatin1(DDEB_REPO_FILE)); | ||
61 | 53 | |||
62 | 54 | // Construct our list hard-coded sources... | ||
63 | 55 | if (m_ddebsSources->count() == 0) { | ||
64 | 56 | LSBRelease lsb; | ||
65 | 57 | QString codename = lsb.codename(); | ||
66 | 58 | m_ddebsSources->append(QApt::SourceEntry(QString::fromLatin1(REPO_ARG_BASE).arg(codename), repoFile)); | ||
67 | 59 | m_ddebsSources->append(QApt::SourceEntry(QString::fromLatin1(REPO_ARG_UPDATES).arg(codename), repoFile)); | ||
68 | 60 | m_ddebsSources->append(QApt::SourceEntry(QString::fromLatin1(REPO_ARG_SECURITY).arg(codename), repoFile)); | ||
69 | 61 | m_ddebsSources->append(QApt::SourceEntry(QString::fromLatin1(REPO_ARG_PROPOSED).arg(codename), repoFile)); | ||
70 | 62 | } | ||
71 | 63 | |||
72 | 35 | m_backend->init(); | 64 | m_backend->init(); |
73 | 36 | } | 65 | } |
74 | 37 | 66 | ||
75 | @@ -69,17 +98,18 @@ | |||
76 | 69 | return 0; | 98 | return 0; |
77 | 70 | } | 99 | } |
78 | 71 | 100 | ||
80 | 72 | void DebugFinder::find(const QString &file) | 101 | void DebugFinder::find() |
81 | 73 | { | 102 | { |
82 | 74 | if (m_stop) { | 103 | if (m_stop) { |
83 | 75 | return; | 104 | return; |
84 | 76 | } | 105 | } |
85 | 77 | 106 | ||
87 | 78 | QApt::Package *package = m_backend->packageForFile(file); | 107 | QApt::Package *package = m_backend->packageForFile(m_file); |
88 | 79 | 108 | ||
89 | 80 | QApt::Package *dbgPkg = getDbgPkg(package); | 109 | QApt::Package *dbgPkg = getDbgPkg(package); |
90 | 81 | if (!dbgPkg) { | 110 | if (!dbgPkg) { |
92 | 82 | emit foundNoDbgPkg(file); | 111 | kDebug() << "No debug package found for: " << m_file; |
93 | 112 | emit foundNoDbgPkg(m_file); | ||
94 | 83 | } else if (dbgPkg->isInstalled()) { | 113 | } else if (dbgPkg->isInstalled()) { |
95 | 84 | emit alreadyInstalled(); | 114 | emit alreadyInstalled(); |
96 | 85 | } else { | 115 | } else { |
97 | @@ -90,4 +120,178 @@ | |||
98 | 90 | void DebugFinder::stop() | 120 | void DebugFinder::stop() |
99 | 91 | { | 121 | { |
100 | 92 | m_stop = true; | 122 | m_stop = true; |
101 | 123 | removeDdebs(); | ||
102 | 124 | } | ||
103 | 125 | |||
104 | 126 | void DebugFinder::startFinding(const QString &file) | ||
105 | 127 | { | ||
106 | 128 | m_progress->setLabelText(i18nc("@title", "Adding debug symbol sources")); | ||
107 | 129 | m_file = file; | ||
108 | 130 | connect(this, SIGNAL(aptCacheUpdateFinished()), | ||
109 | 131 | this, SLOT(onAptCacheUpdateFinished())); | ||
110 | 132 | |||
111 | 133 | if (hasDdebs()) { | ||
112 | 134 | // We already have debs... | ||
113 | 135 | kDebug() << "SKIPPING DDEBS!"; | ||
114 | 136 | emit aptCacheUpdateFinished(); | ||
115 | 137 | } else { | ||
116 | 138 | installDdebs(); | ||
117 | 139 | } | ||
118 | 140 | |||
119 | 141 | kDebug() << "Done with startFinding()!"; | ||
120 | 142 | } | ||
121 | 143 | |||
122 | 144 | // The update is finished! | ||
123 | 145 | void DebugFinder::onAptCacheUpdateFinished() | ||
124 | 146 | { | ||
125 | 147 | kDebug() << "Done with updateCache(), reloading cache..."; | ||
126 | 148 | m_backend->reloadCache(); | ||
127 | 149 | |||
128 | 150 | kDebug() << "I'm done."; | ||
129 | 151 | m_progress->progressBar()->setValue(100); | ||
130 | 152 | |||
131 | 153 | find(); | ||
132 | 154 | |||
133 | 155 | return; | ||
134 | 156 | } | ||
135 | 157 | |||
136 | 158 | void DebugFinder::onTxnStatusChanged(QApt::TransactionStatus status) | ||
137 | 159 | { | ||
138 | 160 | kDebug() << "cache widget: transaction status changed" << status; | ||
139 | 161 | |||
140 | 162 | if (!m_aptTransaction) { | ||
141 | 163 | kDebug() << "No valid transaction."; | ||
142 | 164 | return; | ||
143 | 165 | } | ||
144 | 166 | |||
145 | 167 | switch (status) { | ||
146 | 168 | case QApt::DownloadingStatus: | ||
147 | 169 | if (m_aptTransaction->role() == QApt::UpdateCacheRole) { | ||
148 | 170 | m_progress->setLabelText(i18nc("@title", "Updating software sources")); | ||
149 | 171 | } else { | ||
150 | 172 | m_progress->setLabelText(i18nc("@title", "Downloading Packages")); | ||
151 | 173 | } | ||
152 | 174 | |||
153 | 175 | break; | ||
154 | 176 | |||
155 | 177 | case QApt::FinishedStatus: | ||
156 | 178 | m_progress->setLabelText(i18nc("@title", "Finished.")); | ||
157 | 179 | break; | ||
158 | 180 | |||
159 | 181 | default: | ||
160 | 182 | break; | ||
161 | 183 | } | ||
162 | 184 | } | ||
163 | 185 | |||
164 | 186 | void DebugFinder::onAptError(QApt::ErrorCode errcode) | ||
165 | 187 | { | ||
166 | 188 | QString errmsg = QAptDecorator::errorText(errcode, m_aptTransaction); | ||
167 | 189 | kDebug() << "Got an error: " << errmsg; | ||
168 | 190 | |||
169 | 191 | KMessageBox::error( | ||
170 | 192 | NULL, | ||
171 | 193 | i18nc("@info Error message", "Error updating sources" | ||
172 | 194 | " after configuring debug sources"), | ||
173 | 195 | i18nc("@title Error dialog", "Failed updating sources") | ||
174 | 196 | ); | ||
175 | 197 | } | ||
176 | 198 | |||
177 | 199 | void DebugFinder::onProgressChanged(int progress) | ||
178 | 200 | { | ||
179 | 201 | int presentProgress = progress; | ||
180 | 202 | |||
181 | 203 | if (progress >= 100) { | ||
182 | 204 | presentProgress = 0; | ||
183 | 205 | } | ||
184 | 206 | m_progress->progressBar()->setValue(presentProgress); | ||
185 | 207 | } | ||
186 | 208 | |||
187 | 209 | bool DebugFinder::hasDdebs() | ||
188 | 210 | { | ||
189 | 211 | static int ddeb_count = 0; | ||
190 | 212 | |||
191 | 213 | if (!m_sourcesChangedSinceChecked && (ddeb_count == m_ddebsSources->count())) { | ||
192 | 214 | kDebug() << "m_sourcesChangedSinceChecked == " << m_sourcesChangedSinceChecked << " and m_ddebsSources->count() == " << m_ddebsSources->count() << " and ddeb_count == " << ddeb_count; | ||
193 | 215 | return true; | ||
194 | 216 | } | ||
195 | 217 | |||
196 | 218 | const QApt::SourceEntryList &existingEntries = m_sourcesList->entries(); | ||
197 | 219 | |||
198 | 220 | foreach (const QApt::SourceEntry &repo, *m_ddebsSources) { | ||
199 | 221 | if (existingEntries.contains(repo)) { | ||
200 | 222 | kDebug() << "LOOP, CONTAINS!"; | ||
201 | 223 | ddeb_count += 1; | ||
202 | 224 | } | ||
203 | 225 | else { kDebug() << "LOOP, DOESNT CONTAIN!"; } | ||
204 | 226 | } | ||
205 | 227 | kDebug() << "(2) m_sourcesChangedSinceChecked == " << m_sourcesChangedSinceChecked << " and m_ddebsSources->count() == " << m_ddebsSources->count() << " and ddeb_count == " << ddeb_count; | ||
206 | 228 | |||
207 | 229 | m_sourcesChangedSinceChecked = false; | ||
208 | 230 | |||
209 | 231 | return (ddeb_count == m_ddebsSources->count()); | ||
210 | 232 | } | ||
211 | 233 | |||
212 | 234 | void DebugFinder::updateAptCache() | ||
213 | 235 | { | ||
214 | 236 | m_progress->progressBar()->setValue(0); | ||
215 | 237 | m_aptTransaction = m_backend->updateCache(); | ||
216 | 238 | |||
217 | 239 | m_aptTransaction->setLocale(QLatin1String(setlocale(LC_MESSAGES, 0))); | ||
218 | 240 | |||
219 | 241 | connect(m_progress, SIGNAL(cancelClicked()), | ||
220 | 242 | m_aptTransaction, SLOT(cancel())); | ||
221 | 243 | connect(m_aptTransaction, SIGNAL(errorOccurred(QApt::ErrorCode)), | ||
222 | 244 | this, SLOT(onAptError(QApt::ErrorCode))); | ||
223 | 245 | connect(m_aptTransaction, SIGNAL(statusChanged(QApt::TransactionStatus)), | ||
224 | 246 | this, SLOT(onTxnStatusChanged(QApt::TransactionStatus))); | ||
225 | 247 | connect(m_aptTransaction, SIGNAL(progressChanged(int)), | ||
226 | 248 | this, SLOT(onProgressChanged(int))); | ||
227 | 249 | connect(m_aptTransaction, SIGNAL(finished(QApt::ExitStatus)), | ||
228 | 250 | this, SLOT(onAptCacheUpdateFinished())); | ||
229 | 251 | |||
230 | 252 | m_aptTransaction->run(); | ||
231 | 253 | kDebug() << "FinishedStatus: " << QApt::FinishedStatus; | ||
232 | 254 | } | ||
233 | 255 | |||
234 | 256 | void DebugFinder::installDdebs() | ||
235 | 257 | { | ||
236 | 258 | // If it's already there, don't do it! | ||
237 | 259 | if (hasDdebs()) { | ||
238 | 260 | return; | ||
239 | 261 | } | ||
240 | 262 | |||
241 | 263 | foreach (const QApt::SourceEntry &repo, *m_ddebsSources) { | ||
242 | 264 | m_sourcesList->addEntry(repo); // This method has a dup check | ||
243 | 265 | } | ||
244 | 266 | |||
245 | 267 | m_sourcesList->save(); | ||
246 | 268 | m_sourcesChangedSinceChecked = true; | ||
247 | 269 | |||
248 | 270 | kDebug() << "Entries saved, updating backend cache..."; | ||
249 | 271 | updateAptCache(); | ||
250 | 272 | |||
251 | 273 | return; | ||
252 | 274 | } | ||
253 | 275 | |||
254 | 276 | void DebugFinder::removeDdebs() | ||
255 | 277 | { | ||
256 | 278 | m_progress->setLabelText(i18nc("@title", "Cleaning up sources")); | ||
257 | 279 | // If it's NOT already there, don't do it! | ||
258 | 280 | if (!hasDdebs()) { | ||
259 | 281 | return; | ||
260 | 282 | } | ||
261 | 283 | kDebug() << "Has DDEBS! Cleaning!"; | ||
262 | 284 | |||
263 | 285 | foreach (const QApt::SourceEntry &repo, *m_ddebsSources) { | ||
264 | 286 | kDebug() << "Removing " << repo.toString(); | ||
265 | 287 | m_sourcesList->removeEntry(repo); | ||
266 | 288 | } | ||
267 | 289 | |||
268 | 290 | m_sourcesList->save(); | ||
269 | 291 | m_sourcesChangedSinceChecked = true; | ||
270 | 292 | |||
271 | 293 | kDebug() << "Entries saved, updating backend cache..."; | ||
272 | 294 | updateAptCache(); | ||
273 | 295 | |||
274 | 296 | return; | ||
275 | 93 | } | 297 | } |
276 | 94 | 298 | ||
277 | === modified file 'src/DebugFinder.h' | |||
278 | --- src/DebugFinder.h 2012-10-30 15:16:47 +0000 | |||
279 | +++ src/DebugFinder.h 2013-08-04 08:01:27 +0000 | |||
280 | @@ -1,6 +1,7 @@ | |||
281 | 1 | /* | 1 | /* |
282 | 2 | Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com> | 2 | Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com> |
283 | 3 | Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org> | 3 | Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org> |
284 | 4 | Copyright © 2013 Michael D. Stemle, Jr. <themanchicken@gmail.com> | ||
285 | 4 | 5 | ||
286 | 5 | This program is free software; you can redistribute it and/or | 6 | This program is free software; you can redistribute it and/or |
287 | 6 | modify it under the terms of the GNU General Public License as | 7 | modify it under the terms of the GNU General Public License as |
288 | @@ -22,13 +23,26 @@ | |||
289 | 22 | #ifndef DEBUGFINDER_H | 23 | #ifndef DEBUGFINDER_H |
290 | 23 | #define DEBUGFINDER_H | 24 | #define DEBUGFINDER_H |
291 | 24 | 25 | ||
292 | 26 | #include <LibQApt/Globals> | ||
293 | 27 | |||
294 | 25 | #include <QtCore/QObject> | 28 | #include <QtCore/QObject> |
295 | 26 | #include <QtCore/QStringList> | 29 | #include <QtCore/QStringList> |
296 | 27 | 30 | ||
297 | 31 | #define REPO_ARG_BASE "deb http://ddebs.ubuntu.com %1 main restricted universe multiverse" | ||
298 | 32 | #define REPO_ARG_UPDATES "deb http://ddebs.ubuntu.com %1-updates main restricted universe multiverse" | ||
299 | 33 | #define REPO_ARG_SECURITY "deb http://ddebs.ubuntu.com %1-security main restricted universe multiverse" | ||
300 | 34 | #define REPO_ARG_PROPOSED "deb http://ddebs.ubuntu.com %1-proposed main restricted universe multiverse" | ||
301 | 35 | #define DDEB_REPO_FILE "/etc/apt/sources.list.d/ddebs.list" | ||
302 | 36 | |||
303 | 37 | class KProgressDialog; | ||
304 | 38 | |||
305 | 28 | namespace QApt { | 39 | namespace QApt { |
306 | 29 | class Backend; | 40 | class Backend; |
307 | 30 | class Package; | 41 | class Package; |
309 | 31 | } | 42 | class SourceEntry; |
310 | 43 | class SourcesList; | ||
311 | 44 | class Transaction; | ||
312 | 45 | }; | ||
313 | 32 | 46 | ||
314 | 33 | class DebugFinder : public QObject | 47 | class DebugFinder : public QObject |
315 | 34 | { | 48 | { |
316 | @@ -36,20 +50,38 @@ | |||
317 | 36 | public: | 50 | public: |
318 | 37 | explicit DebugFinder(QObject *parent = 0); | 51 | explicit DebugFinder(QObject *parent = 0); |
319 | 38 | 52 | ||
320 | 53 | void performUpdate(); | ||
321 | 54 | |||
322 | 39 | public slots: | 55 | public slots: |
324 | 40 | void find(const QString &file); | 56 | void startFinding(const QString &file); |
325 | 57 | void find(); | ||
326 | 41 | void stop(); | 58 | void stop(); |
328 | 42 | 59 | void onTxnStatusChanged(QApt::TransactionStatus status); | |
329 | 60 | void onAptError(QApt::ErrorCode errcode); | ||
330 | 61 | void onAptCacheUpdateFinished(); | ||
331 | 62 | void onProgressChanged(int progress); | ||
332 | 63 | bool hasDdebs(); | ||
333 | 64 | void installDdebs(); | ||
334 | 65 | void removeDdebs(); | ||
335 | 66 | void updateAptCache(); | ||
336 | 67 | |||
337 | 43 | signals: | 68 | signals: |
338 | 44 | void foundDbgPkg(const QString &dbgpkg); | 69 | void foundDbgPkg(const QString &dbgpkg); |
340 | 45 | void foundNoDbgPkg(const QString &file); | 70 | void foundNoDbgPkg(const QString &dbgpkg); |
341 | 46 | void alreadyInstalled(); | 71 | void alreadyInstalled(); |
342 | 72 | void aptCacheUpdateFinished(); | ||
343 | 47 | 73 | ||
344 | 48 | private: | 74 | private: |
345 | 49 | QApt::Package *getDbgPkg(QApt::Package *package); | 75 | QApt::Package *getDbgPkg(QApt::Package *package); |
346 | 76 | |||
347 | 50 | QApt::Backend *m_backend; | 77 | QApt::Backend *m_backend; |
349 | 51 | 78 | QApt::Transaction *m_aptTransaction; | |
350 | 79 | KProgressDialog *m_progress; | ||
351 | 80 | QList<QApt::SourceEntry> *m_ddebsSources; | ||
352 | 81 | QApt::SourcesList *m_sourcesList; | ||
353 | 82 | QString m_file; | ||
354 | 52 | bool m_stop; | 83 | bool m_stop; |
355 | 84 | bool m_sourcesChangedSinceChecked; | ||
356 | 53 | }; | 85 | }; |
357 | 54 | 86 | ||
358 | 55 | #endif // DEBUGFINDER_H | 87 | #endif // DEBUGFINDER_H |
359 | 56 | 88 | ||
360 | === modified file 'src/DebugInstaller.cpp' | |||
361 | --- src/DebugInstaller.cpp 2011-09-26 13:35:14 +0000 | |||
362 | +++ src/DebugInstaller.cpp 2013-08-04 08:01:27 +0000 | |||
363 | @@ -1,6 +1,7 @@ | |||
364 | 1 | /* | 1 | /* |
365 | 2 | Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com> | 2 | Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com> |
366 | 3 | Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org> | 3 | Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org> |
367 | 4 | Copyright © 2013 Michael D. Stemle, Jr. <themanchicken@gmail.com> | ||
368 | 4 | 5 | ||
369 | 5 | This program is free software; you can redistribute it and/or | 6 | This program is free software; you can redistribute it and/or |
370 | 6 | modify it under the terms of the GNU General Public License as | 7 | modify it under the terms of the GNU General Public License as |
371 | @@ -68,6 +69,8 @@ | |||
372 | 68 | if (install.exitCode() != 0) { | 69 | if (install.exitCode() != 0) { |
373 | 69 | EXIT(ERR_RANDOM_ERR); | 70 | EXIT(ERR_RANDOM_ERR); |
374 | 70 | } | 71 | } |
375 | 72 | |||
376 | 73 | m_finder->removeDdebs(); | ||
377 | 71 | 74 | ||
378 | 72 | close(); | 75 | close(); |
379 | 73 | } | 76 | } |
380 | @@ -163,17 +166,20 @@ | |||
381 | 163 | progressBar()->setMaximum(m_args.count()); | 166 | progressBar()->setMaximum(m_args.count()); |
382 | 164 | incrementProgress(); | 167 | incrementProgress(); |
383 | 165 | 168 | ||
388 | 166 | m_finder = new DebugFinder; | 169 | m_finder = new DebugFinder(this); |
389 | 167 | connect(m_finder, SIGNAL(foundDbgPkg(QString)), this, SLOT(foundDbgPkg(QString))); | 170 | connect(m_finder, SIGNAL(foundDbgPkg(QString)), |
390 | 168 | connect(m_finder, SIGNAL(foundNoDbgPkg(QString)), this, SLOT(foundNoDbgPkg(QString))); | 171 | this, SLOT(foundDbgPkg(QString))); |
391 | 169 | connect(m_finder, SIGNAL(alreadyInstalled()), this, SLOT(alreadyInstalled())); | 172 | connect(m_finder, SIGNAL(foundNoDbgPkg(QString)), |
392 | 173 | this, SLOT(foundNoDbgPkg(QString))); | ||
393 | 174 | connect(m_finder, SIGNAL(alreadyInstalled()), | ||
394 | 175 | this, SLOT(alreadyInstalled())); | ||
395 | 170 | 176 | ||
396 | 171 | m_finderThread = new QThread(this); | 177 | m_finderThread = new QThread(this); |
397 | 172 | m_finder->moveToThread(m_finderThread); | 178 | m_finder->moveToThread(m_finderThread); |
398 | 173 | m_finderThread->start(); | 179 | m_finderThread->start(); |
399 | 174 | 180 | ||
400 | 175 | foreach (const QString &file, m_args) { | 181 | foreach (const QString &file, m_args) { |
402 | 176 | QMetaObject::invokeMethod(m_finder, "find", Qt::QueuedConnection, | 182 | QMetaObject::invokeMethod(m_finder, "startFinding", Qt::QueuedConnection, |
403 | 177 | Q_ARG(QString, file)); | 183 | Q_ARG(QString, file)); |
404 | 178 | } | 184 | } |
405 | 179 | } | 185 | } |
406 | 180 | 186 | ||
407 | === added file 'src/LSBRelease.cpp' | |||
408 | --- src/LSBRelease.cpp 1970-01-01 00:00:00 +0000 | |||
409 | +++ src/LSBRelease.cpp 2013-08-04 08:01:27 +0000 | |||
410 | @@ -0,0 +1,66 @@ | |||
411 | 1 | /* | ||
412 | 2 | Copyright (C) 2012 Harald Sitter <apachelogger@ubuntu.com> | ||
413 | 3 | |||
414 | 4 | This program is free software; you can redistribute it and/or | ||
415 | 5 | modify it under the terms of the GNU General Public License as | ||
416 | 6 | published by the Free Software Foundation; either version 2 of | ||
417 | 7 | the License or (at your option) version 3 or any later version | ||
418 | 8 | accepted by the membership of KDE e.V. (or its successor approved | ||
419 | 9 | by the membership of KDE e.V.), which shall act as a proxy | ||
420 | 10 | defined in Section 14 of version 3 of the license. | ||
421 | 11 | |||
422 | 12 | This program is distributed in the hope that it will be useful, | ||
423 | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
424 | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
425 | 15 | GNU General Public License for more details. | ||
426 | 16 | |||
427 | 17 | You should have received a copy of the GNU General Public License | ||
428 | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
429 | 19 | */ | ||
430 | 20 | |||
431 | 21 | #include "LSBRelease.h" | ||
432 | 22 | |||
433 | 23 | #include <QtCore/QFile> | ||
434 | 24 | |||
435 | 25 | #include <KDebug> | ||
436 | 26 | #include <KLocalizedString> | ||
437 | 27 | |||
438 | 28 | LSBRelease::LSBRelease() | ||
439 | 29 | { | ||
440 | 30 | QFile file("/etc/lsb-release"); | ||
441 | 31 | if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { | ||
442 | 32 | kDebug() << "Could not open /etc/lsb-release, aborting LSB"; | ||
443 | 33 | QString unknown = i18nc("@label", "Unknown Release"); | ||
444 | 34 | m_id = unknown; | ||
445 | 35 | m_release = unknown; | ||
446 | 36 | m_codename = unknown; | ||
447 | 37 | m_description = unknown; | ||
448 | 38 | return; | ||
449 | 39 | } | ||
450 | 40 | |||
451 | 41 | // List of valid column identifiers | ||
452 | 42 | QString line; | ||
453 | 43 | QStringList comps; | ||
454 | 44 | while (!file.atEnd()) { | ||
455 | 45 | line = file.readLine(); | ||
456 | 46 | comps = line.split(QChar('=')); | ||
457 | 47 | Q_ASSERT(comps.size() == 2); | ||
458 | 48 | QString key = comps.at(0); | ||
459 | 49 | QString value = comps.at(1).trimmed(); | ||
460 | 50 | if (key == QLatin1String("DISTRIB_ID")) | ||
461 | 51 | m_id = value; | ||
462 | 52 | else if (key == QLatin1String("DISTRIB_RELEASE")) | ||
463 | 53 | m_release = value; | ||
464 | 54 | else if (key == QLatin1String("DISTRIB_CODENAME")) | ||
465 | 55 | m_codename = value; | ||
466 | 56 | else if (key == QLatin1String("DISTRIB_DESCRIPTION")) | ||
467 | 57 | m_description = value; | ||
468 | 58 | else | ||
469 | 59 | Q_ASSERT(false); // Should not happen! | ||
470 | 60 | } | ||
471 | 61 | |||
472 | 62 | if (m_id.isEmpty() || m_release.isEmpty()) { | ||
473 | 63 | Q_ASSERT(false); // meh. | ||
474 | 64 | } | ||
475 | 65 | } | ||
476 | 66 | |||
477 | 0 | 67 | ||
478 | === added file 'src/LSBRelease.h' | |||
479 | --- src/LSBRelease.h 1970-01-01 00:00:00 +0000 | |||
480 | +++ src/LSBRelease.h 2013-08-04 08:01:27 +0000 | |||
481 | @@ -0,0 +1,43 @@ | |||
482 | 1 | /* | ||
483 | 2 | Copyright (C) 2012 Harald Sitter <apachelogger@ubuntu.com> | ||
484 | 3 | |||
485 | 4 | This program is free software; you can redistribute it and/or | ||
486 | 5 | modify it under the terms of the GNU General Public License as | ||
487 | 6 | published by the Free Software Foundation; either version 2 of | ||
488 | 7 | the License or (at your option) version 3 or any later version | ||
489 | 8 | accepted by the membership of KDE e.V. (or its successor approved | ||
490 | 9 | by the membership of KDE e.V.), which shall act as a proxy | ||
491 | 10 | defined in Section 14 of version 3 of the license. | ||
492 | 11 | |||
493 | 12 | This program is distributed in the hope that it will be useful, | ||
494 | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
495 | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
496 | 15 | GNU General Public License for more details. | ||
497 | 16 | |||
498 | 17 | You should have received a copy of the GNU General Public License | ||
499 | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
500 | 19 | */ | ||
501 | 20 | |||
502 | 21 | #ifndef LSBRELEASE_H | ||
503 | 22 | #define LSBRELEASE_H | ||
504 | 23 | |||
505 | 24 | #include <QtCore/QString> | ||
506 | 25 | |||
507 | 26 | class LSBRelease | ||
508 | 27 | { | ||
509 | 28 | public: | ||
510 | 29 | LSBRelease(); | ||
511 | 30 | |||
512 | 31 | QString id() { return m_id; } | ||
513 | 32 | QString release() { return m_release; } | ||
514 | 33 | QString codename() { return m_codename; } | ||
515 | 34 | QString description() { return m_description; } | ||
516 | 35 | |||
517 | 36 | private: | ||
518 | 37 | QString m_id; | ||
519 | 38 | QString m_release; | ||
520 | 39 | QString m_codename; | ||
521 | 40 | QString m_description; | ||
522 | 41 | }; | ||
523 | 42 | |||
524 | 43 | #endif // LSBRELEASE_H | ||
525 | 0 | 44 | ||
526 | === added file 'src/QAptDecorator.cpp' | |||
527 | --- src/QAptDecorator.cpp 1970-01-01 00:00:00 +0000 | |||
528 | +++ src/QAptDecorator.cpp 2013-08-04 08:01:27 +0000 | |||
529 | @@ -0,0 +1,81 @@ | |||
530 | 1 | /* | ||
531 | 2 | Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org> (cacheupdate example in QApt) | ||
532 | 3 | Copyright © 2013 Michael D. Stemle, Jr. <themanchicken@gmail.com> | ||
533 | 4 | |||
534 | 5 | This program is free software; you can redistribute it and/or | ||
535 | 6 | modify it under the terms of the GNU General Public License as | ||
536 | 7 | published by the Free Software Foundation; either version 2 of | ||
537 | 8 | the License or (at your option) version 3 or any later version | ||
538 | 9 | accepted by the membership of KDE e.V. (or its successor approved | ||
539 | 10 | by the membership of KDE e.V.), which shall act as a proxy | ||
540 | 11 | defined in Section 14 of version 3 of the license. | ||
541 | 12 | |||
542 | 13 | This program is distributed in the hope that it will be useful, | ||
543 | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
544 | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
545 | 16 | GNU General Public License for more details. | ||
546 | 17 | |||
547 | 18 | You should have received a copy of the GNU General Public License | ||
548 | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
549 | 20 | */ | ||
550 | 21 | |||
551 | 22 | #include "QAptDecorator.h" | ||
552 | 23 | |||
553 | 24 | #include <QtCore/QString> | ||
554 | 25 | |||
555 | 26 | #include <LibQApt/Globals> | ||
556 | 27 | #include <KLocalizedString> | ||
557 | 28 | |||
558 | 29 | QString QAptDecorator::errorText(QApt::ErrorCode error, QApt::Transaction *trans) | ||
559 | 30 | { | ||
560 | 31 | QString text; | ||
561 | 32 | |||
562 | 33 | switch (error) { | ||
563 | 34 | case QApt::InitError: | ||
564 | 35 | text = i18nc("@label", "The package system could not be initialized, your " | ||
565 | 36 | "configuration may be broken."); | ||
566 | 37 | break; | ||
567 | 38 | case QApt::LockError: | ||
568 | 39 | text = i18nc("@label", | ||
569 | 40 | "Another application seems to be using the package " | ||
570 | 41 | "system at this time. You must close all other package " | ||
571 | 42 | "managers before you will be able to install or remove " | ||
572 | 43 | "any packages."); | ||
573 | 44 | break; | ||
574 | 45 | case QApt::DiskSpaceError: | ||
575 | 46 | text = i18nc("@label", | ||
576 | 47 | "You do not have enough disk space in the directory " | ||
577 | 48 | "at %1 to continue with this operation.", trans->errorDetails()); | ||
578 | 49 | break; | ||
579 | 50 | case QApt::FetchError: | ||
580 | 51 | text = i18nc("@label", "Could not download packages"); | ||
581 | 52 | break; | ||
582 | 53 | case QApt::CommitError: | ||
583 | 54 | text = i18nc("@label", "An error occurred while applying changes:"); | ||
584 | 55 | break; | ||
585 | 56 | case QApt::AuthError: | ||
586 | 57 | text = i18nc("@label", | ||
587 | 58 | "This operation cannot continue since proper " | ||
588 | 59 | "authorization was not provided"); | ||
589 | 60 | break; | ||
590 | 61 | case QApt::WorkerDisappeared: | ||
591 | 62 | text = i18nc("@label", "It appears that the QApt worker has either crashed " | ||
592 | 63 | "or disappeared. Please report a bug to the QApt maintainers"); | ||
593 | 64 | break; | ||
594 | 65 | case QApt::UntrustedError: | ||
595 | 66 | text = i18ncp("@label", | ||
596 | 67 | "The following package has not been verified by its author. " | ||
597 | 68 | "Downloading untrusted packages has been disallowed " | ||
598 | 69 | "by your current configuration.", | ||
599 | 70 | "The following packages have not been verified by " | ||
600 | 71 | "their authors. " | ||
601 | 72 | "Downloading untrusted packages has " | ||
602 | 73 | "been disallowed by your current configuration.", | ||
603 | 74 | trans->untrustedPackages().size()); | ||
604 | 75 | break; | ||
605 | 76 | default: | ||
606 | 77 | break; | ||
607 | 78 | } | ||
608 | 79 | |||
609 | 80 | return text; | ||
610 | 81 | } | ||
611 | 0 | 82 | ||
612 | === added file 'src/QAptDecorator.h' | |||
613 | --- src/QAptDecorator.h 1970-01-01 00:00:00 +0000 | |||
614 | +++ src/QAptDecorator.h 2013-08-04 08:01:27 +0000 | |||
615 | @@ -0,0 +1,34 @@ | |||
616 | 1 | /* | ||
617 | 2 | Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org> (cacheupdate example in QApt) | ||
618 | 3 | Copyright © 2013 Michael D. Stemle, Jr. <themanchicken@gmail.com> | ||
619 | 4 | |||
620 | 5 | This program is free software; you can redistribute it and/or | ||
621 | 6 | modify it under the terms of the GNU General Public License as | ||
622 | 7 | published by the Free Software Foundation; either version 2 of | ||
623 | 8 | the License or (at your option) version 3 or any later version | ||
624 | 9 | accepted by the membership of KDE e.V. (or its successor approved | ||
625 | 10 | by the membership of KDE e.V.), which shall act as a proxy | ||
626 | 11 | defined in Section 14 of version 3 of the license. | ||
627 | 12 | |||
628 | 13 | This program is distributed in the hope that it will be useful, | ||
629 | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
630 | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
631 | 16 | GNU General Public License for more details. | ||
632 | 17 | |||
633 | 18 | You should have received a copy of the GNU General Public License | ||
634 | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
635 | 20 | */ | ||
636 | 21 | |||
637 | 22 | #ifndef QAPTDECORATOR_H | ||
638 | 23 | #define QAPTDECORATOR_H | ||
639 | 24 | |||
640 | 25 | #include <LibQApt/Globals> | ||
641 | 26 | #include <LibQApt/Transaction> | ||
642 | 27 | |||
643 | 28 | class QAptDecorator | ||
644 | 29 | { | ||
645 | 30 | public: | ||
646 | 31 | static QString errorText(QApt::ErrorCode error, QApt::Transaction *trans); | ||
647 | 32 | }; | ||
648 | 33 | |||
649 | 34 | #endif // QAPTDECORATOR_H |
I only took a quick glance on the merge, but I think you missed the "release" repository. You have X-updates, X-security and X-proposed, but I see no place where you add X without a suffix