lists.crux.nu
Sign In
Sign Up
Manage this list
Sign In
Sign Up
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
crux-devel
Thread
Start a new thread
Download
Threads by
month
----- 2025 -----
February
January
----- 2024 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2023 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2022 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2021 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2020 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2019 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2018 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2017 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2016 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2015 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2014 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2013 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2012 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2011 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2010 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2009 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2008 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2007 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2006 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2005 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2004 -----
December
November
October
September
August
July
June
May
April
March
February
January
----- 2003 -----
December
November
October
September
August
July
June
crux-devel@lists.crux.nu
2167 discussions
prt-get nicetohave
by Jose V Beneyto
02 May '08
02 May '08
Hello, I wrote a patch for listing 'Nice to have' dependencies with prt-get Sometimes I want to known these nice-to-have ports, but I'm not a bash guru and often I use large lines: $ prt-get cat pinentry Pkgfile | grep '^# Nice to have:' | cut -d':' -f2 | sed -e 's/ //g' -e 's/,/ /' gtk qt3 prt-get nicetohave sounds better imho : ) i.e: $ prt-get info pinentry Name: pinentry Path: /usr/ports/opt Version: 0.7.5 Release: 1 Description: Secure PinEntry Dialog URL:
http://www.gnupg.org
Packager: Alan Mizrahi, alan at mizrahi dot com dot ve Maintainer: Simon Gloßner, viper at hometux dot de Dependencies: ncurses Nice to have: gtk,qt3 $ prt-get nicetohave pinentry gtk qt3 It's not a big changeset, just a little patch which does the trick. I think it could be useful for others, what are your opinions? I attached the patch, for everyone who want to test it and/or give suggestions. Best regards, Jose V Beneyto diff --git a/src/argparser.cpp b/src/argparser.cpp index b971212..f3ac37e 100644 --- a/src/argparser.cpp +++ b/src/argparser.cpp @@ -122,10 +122,10 @@ const string& ArgParser::alternateConfigFile() const */ bool ArgParser::parse() { - const int commandCount = 35; + const int commandCount = 36; string commands[commandCount] = { "list", "search", "dsearch", - "info", - "depends", "install", "depinst", + "info", "depends", "nicetohave", + "install", "depinst", "help", "isinst", "dup", "update", "quickdep", "diff", "quickdiff", "grpinst", "version", "cache", @@ -137,15 +137,15 @@ bool ArgParser::parse() "listorphans" }; Type commandID[commandCount] = { LIST, SEARCH, DSEARCH, INFO, - DEPENDS, INSTALL, DEPINST, - HELP, ISINST, DUP, UPDATE, - QUICKDEP, DIFF, QUICKDIFF, - GRPINST, SHOW_VERSION, CREATE_CACHE, - PATH, LISTINST, PRINTF, README, - DEPENDENT, SYSUP, CURRENT, - FSEARCH, LOCK, UNLOCK, LISTLOCKED, - CAT, LS, EDIT, REMOVE, DEPTREE, - DUMPCONFIG, LISTORPHANS }; + DEPENDS, NICETOHAVE, INSTALL, + DEPINST, HELP, ISINST, DUP, + UPDATE, QUICKDEP, DIFF, + QUICKDIFF, GRPINST, SHOW_VERSION, + CREATE_CACHE, PATH, LISTINST, + PRINTF, README, DEPENDENT, SYSUP, + CURRENT, FSEARCH, LOCK, UNLOCK, + LISTLOCKED, CAT, LS, EDIT, REMOVE, + DEPTREE, DUMPCONFIG, LISTORPHANS }; if ( m_argc < 2 ) { return false; } diff --git a/src/argparser.h b/src/argparser.h index c24e7bd..3fc2b75 100644 --- a/src/argparser.h +++ b/src/argparser.h @@ -31,13 +31,12 @@ public: /*! Command type */ enum Type { HELP, LIST, SEARCH, DSEARCH, INSTALL, DEPINST, - INFO, DEPENDS, ISINST, DUP, UPDATE, - QUICKDEP, DIFF, GRPINST, GRPUPDATE, - QUICKDIFF, SHOW_VERSION, CREATE_CACHE, PATH, - LISTINST, PRINTF, README, DEPENDENT, SYSUP, - CURRENT, FSEARCH, LOCK, UNLOCK, LISTLOCKED, - CAT, LS, EDIT, REMOVE, - DEPTREE, DUMPCONFIG, LISTORPHANS }; + INFO, DEPENDS, NICETOHAVE, ISINST, DUP, UPDATE, + QUICKDEP, DIFF, GRPINST, GRPUPDATE, QUICKDIFF, + SHOW_VERSION, CREATE_CACHE, PATH, LISTINST, + PRINTF, README, DEPENDENT, SYSUP, CURRENT, + FSEARCH, LOCK, UNLOCK, LISTLOCKED, CAT, LS, + EDIT, REMOVE, DEPTREE, DUMPCONFIG, LISTORPHANS }; bool isCommandGiven() const; bool isForced() const; diff --git a/src/installtransaction.h b/src/installtransaction.h index 92cf6ba..d34c38a 100644 --- a/src/installtransaction.h +++ b/src/installtransaction.h @@ -59,7 +59,7 @@ public: PKGMK_EXEC_ERROR, /*!< can't execute pkgmk */ PKGMK_FAILURE, /*!< error while pkgmk */ PKGADD_EXEC_ERROR, /*!< can't execute pkgadd */ - PKGDEST_ERROR, /*!< can't change to PKGDEST */ + PKGDEST_ERROR, /*!< can't change to PKGDEST */ PKGADD_FAILURE, /*!< error while pkgadd */ CYCLIC_DEPEND, /*!< cyclic dependencies found */ LOG_DIR_FAILURE, /*!< couldn't create log directory */ @@ -87,7 +87,7 @@ public: InstallResult install( const ArgParser* parser, bool update, bool group ); - InstallResult calcDependencies(); + InstallResult calcDependencies(); const list< pair<string, InstallInfo> >& installedPackages() const; const list<string>& alreadyInstalledPackages() const; diff --git a/src/main.cpp b/src/main.cpp index abbd52f..45ae00f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -94,6 +94,9 @@ int main( int argc, char** argv ) case ArgParser::DEPENDS: prtGet.printDepends(); break; + case ArgParser::NICETOHAVE: + prtGet.printNicetohave(); + break; case ArgParser::QUICKDEP: prtGet.printDepends( true ); break; diff --git a/src/package.cpp b/src/package.cpp index 8b3779a..4862eac 100644 --- a/src/package.cpp +++ b/src/package.cpp @@ -43,6 +43,7 @@ Package::Package( const string& name, const string& release, const string& description, const string& dependencies, + const string& nicetohave, const string& url, const string& packager, const string& maintainer, @@ -51,10 +52,10 @@ Package::Package( const string& name, const string& hasPostInstall) : m_loaded( true ) { - m_data = new PackageData( name, path, version, release, - description, dependencies, url, - packager, maintainer, hasReadme, - hasPreInstall, hasPostInstall ); + m_data = new PackageData( name, path, version, release, description, + dependencies, nicetohave, url, packager, + maintainer, hasReadme, hasPreInstall, + hasPostInstall ); } @@ -103,6 +104,13 @@ const string& Package::dependencies() const return m_data->depends; } +/*! \return the nice to have line of this package */ +const string& Package::nicetohave() const +{ + load(); + return m_data->nice; +} + /*! \return the url of this package */ const string& Package::url() const { @@ -237,6 +245,32 @@ void Package::load() const #endif } + else if ( startsWithNoCase( line, "nice" ) ) { + string nice = stripWhiteSpace( getValue( line, ':' ) ); + + StringHelper::replaceAll( nice, " ", "," ); + StringHelper::replaceAll( nice, ",,", "," ); + + // TODO: decide which one to use +#if 0 + // remove commented out packages + list<string> nicetohave = StringHelper::split( nice, ',' ); + list<string>::iterator it = nicetohave.begin(); + for ( ; it != nicetohave.end(); ++it ) { + if ( (*it)[0] == '#' ) { + cerr << "Commented nice to have: " << *it << endl; + } else { + if ( it != nicetohave.begin() ) { + m_data->nice += ","; + } + m_data->nice += *it; + } + } +#else + m_data->nice = nice; +#endif + + } } } } @@ -265,6 +299,10 @@ void Package::setDependencies( const std::string& dependencies ) m_data->depends = dependencies; } +void Package::setNicetohave( const std::string& nicetohave ) +{ + m_data->nice = nicetohave; +} PackageData::PackageData( const string& name_, @@ -273,6 +311,7 @@ PackageData::PackageData( const string& name_, const string& release_, const string& description_, const string& dependencies_, + const string& nicetohave_, const string& url_, const string& packager_, const string& maintainer_, @@ -285,6 +324,7 @@ PackageData::PackageData( const string& name_, release( release_ ), description( description_ ), depends( dependencies_ ), + nice( nicetohave_ ), url( url_ ), packager( packager_ ), maintainer( maintainer_ ) diff --git a/src/package.h b/src/package.h index bc3e055..cd67ebf 100644 --- a/src/package.h +++ b/src/package.h @@ -34,6 +34,7 @@ public: const std::string& release, const std::string& description, const std::string& dependencies, + const std::string& nicetohave, const std::string& url, const std::string& packager, const std::string& maintainer, @@ -49,6 +50,7 @@ public: const std::string& release() const; const std::string& description() const; const std::string& dependencies() const; + const std::string& nicetohave() const; const std::string& url() const; const std::string& packager() const; const std::string& maintainer() const; @@ -59,6 +61,7 @@ public: std::string versionReleaseString() const; void setDependencies( const std::string& dependencies ); + void setNicetohave( const std::string& nicetohave ); private: @@ -81,6 +84,7 @@ struct PackageData const std::string& release_="", const std::string& description_="", const std::string& dependencies_="", + const std::string& nicetohave_="", const std::string& url_="", const std::string& packager="", const std::string& maintainer="", @@ -94,6 +98,7 @@ struct PackageData std::string release; std::string description; std::string depends; + std::string nice; std::string url; std::string packager; std::string maintainer; diff --git a/src/prtget.cpp b/src/prtget.cpp index d1709d8..8961fd4 100644 --- a/src/prtget.cpp +++ b/src/prtget.cpp @@ -141,13 +141,15 @@ void PrtGet::printUsage() << endl; cout << "\nDEPENDENCIES" << endl; - cout << " depends <port1 port2...> show dependencies for these ports" + cout << " depends <port1 port2...> show dependencies for these ports" << endl; - cout << " quickdep <port1 port2...> same as 'depends' but simple format" + cout << " quickdep <port1 port2...> same as 'depends' but simple format" << endl; - cout << " deptree <port> show dependencies tree for <port>" + cout << " deptree <port> show dependencies tree for <port>" << endl; - cout << " dependent [opt] <port> show installed packages which " + cout << " nicetohave <port> show ports which are nice to have" + << endl; + cout << " dependent [opt] <port> show installed packages which " << "depend on 'port'" << endl; cout << " where opt can be:" << endl; @@ -398,10 +400,12 @@ void PrtGet::printInfo() if ( !p->maintainer().empty() ) { cout << "Maintainer: " << p->maintainer() << endl; } - if ( !p->dependencies().empty() ) { cout << "Dependencies: " << p->dependencies() << endl; } + if ( !p->nicetohave().empty() ) { + cout << "Nice to have: " << p->nicetohave() << endl; + } // TODO: don't hardcode file names string filesString = ""; @@ -802,6 +806,36 @@ void PrtGet::printDepends( bool simpleListing ) } } +/*! + print nice to have listing +*/ +void PrtGet::printNicetohave() +{ + assertExactArgCount(1); + + initRepo(); + + list<char*>::const_iterator it = m_parser->otherArgs().begin(); + string arg = *it; + const Package* p = m_repo->getPackage( arg ); + + if (!p) { + cerr << "Package '" << arg << "' not found" << endl; + m_returnValue = PG_GENERAL_ERROR; + return; + } + else { + list<string> tokens; + StringHelper::split( p->nicetohave(), ',', tokens ); + list<string>::iterator it = tokens.begin(); + for ( ; it != tokens.end(); ++it ) { + cout << *it << " "; + } + cout << endl; + } +} + + /*! read the config file */ void PrtGet::readConfig() { @@ -1256,6 +1290,7 @@ void PrtGet::printf() StringHelper::replaceAll( output, "%r", p->release() ); StringHelper::replaceAll( output, "%d", p->description() ); StringHelper::replaceAll( output, "%e", p->dependencies() ); + StringHelper::replaceAll( output, "%n", p->nicetohave() ); StringHelper::replaceAll( output, "%P", p->packager() ); StringHelper::replaceAll( output, "%M", p->maintainer() ); @@ -1269,6 +1304,7 @@ void PrtGet::printf() StringHelper::replaceAll( sortkey, "%r", p->release() ); StringHelper::replaceAll( sortkey, "%d", p->description() ); StringHelper::replaceAll( sortkey, "%e", p->dependencies() ); + StringHelper::replaceAll( sortkey, "%n", p->nicetohave() ); StringHelper::replaceAll( sortkey, "%P", p->packager() ); StringHelper::replaceAll( sortkey, "%M", p->maintainer() ); diff --git a/src/prtget.h b/src/prtget.h index 6a82975..2114046 100644 --- a/src/prtget.h +++ b/src/prtget.h @@ -69,6 +69,7 @@ public: void printDepends( bool simpleListing=false ); void printDependTree(); void printDependent(); + void printNicetohave(); void printDiff(); void printQuickDiff(); void listOrphans(); diff --git a/src/repository.cpp b/src/repository.cpp index e911095..538195c 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -276,11 +276,11 @@ Repository::initFromCache( const string& cacheFile ) ++fieldPos; if ( fieldPos == fieldCount ) { fieldPos = 0; - Package* p = new Package( fields[0], fields[1], - fields[2], fields[3], - fields[4], fields[5], fields[6], - fields[7], fields[8], fields[9], - fields[10], fields[11]); + Package* p = new Package( fields[0], fields[1], fields[2], + fields[3], fields[4], fields[5], + fields[6], fields[7], fields[8], + fields[9], fields[10], fields[11], + fields[12]); m_packageMap[p->name()] = p; fgets( input, length, fp ); // read empty line }
5
15
0
0
prtverify daily results
by crux@crux.nu
02 May '08
02 May '08
Differences since last check: (no differences) Full report:
http://crux.nu/files/prtverify.log
1
0
0
0
Potentially broken source downloads
by crux@crux.nu
02 May '08
02 May '08
Port: /home/crux/git-to-rsync-working-copy/crux-2.4/opt/mutt Url:
http://mirrors.sunsite.dk/mutt/devel/mutt-1.5.17.tar.gz
Reason: curl: (52) Empty reply from server State: New Full report:
http://crux.nu/files/check_urls.html
1
0
0
0
prtverify daily results
by crux@crux.nu
01 May '08
01 May '08
Differences since last check: (no differences) Full report:
http://crux.nu/files/prtverify.log
1
0
0
0
Potentially broken source downloads
by crux@crux.nu
01 May '08
01 May '08
Port: /home/crux/git-to-rsync-working-copy/crux-2.4/opt/imagemagick Url:
ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.3.9-0.tar.bz2
Reason: curl: (19) Given file does not exist State: New Port: /home/crux/git-to-rsync-working-copy/crux-2.4/opt/lyx Url:
ftp://ftp.lyx.org/pub/lyx/stable/lyx-1.5.3.tar.bz2
Reason: curl: (7) couldn't connect to host State: New Port: /home/crux/git-to-rsync-working-copy/crux-2.4/opt/ruby-musicbrainz Url:
http://pablotron.org/download/mb-ruby-0.3.0.tar.gz
Reason: curl: (7) couldn't connect to host State: New Full report:
http://crux.nu/files/check_urls.html
1
0
0
0
Potentially broken source downloads
by crux@crux.nu
30 Apr '08
30 Apr '08
Port: /home/crux/git-to-rsync-working-copy/crux-2.4/core/jfsutils Url:
http://jfs.sourceforge.net/project/pub/jfsutils-1.1.12.tar.gz
Reason: curl: (7) couldn't connect to host State: New Port: /home/crux/git-to-rsync-working-copy/crux-2.4/core/procps Url:
http://procps.sourceforge.net/procps-3.2.7.tar.gz
Reason: curl: (7) couldn't connect to host State: New Port: /home/crux/git-to-rsync-working-copy/crux-2.4/opt/ccrypt Url:
http://ccrypt.sourceforge.net/download/ccrypt-1.7.tar.gz
Reason: curl: (7) couldn't connect to host State: New Port: /home/crux/git-to-rsync-working-copy/crux-2.4/opt/glib Url:
ftp://ftp.gnome.org/pub/GNOME/sources/glib/2.16/glib-2.16.3.tar.bz2
Reason: curl: (8) This doesn't seem like a nice ftp-server response State: Reminder Port: /home/crux/git-to-rsync-working-copy/crux-2.4/opt/mpeg2dec Url:
http://libmpeg2.sourceforge.net/files/mpeg2dec-0.4.1.tar.gz
Reason: curl: (7) couldn't connect to host State: New Full report:
http://crux.nu/files/check_urls.html
1
0
0
0
prtverify daily results
by crux@crux.nu
30 Apr '08
30 Apr '08
Differences since last check: (no differences) Full report:
http://crux.nu/files/prtverify.log
1
0
0
0
Potentially broken source downloads
by crux@crux.nu
29 Apr '08
29 Apr '08
Port: /home/crux/git-to-rsync-working-copy/crux-2.4/opt/libpcap Url:
http://www.tcpdump.org/release/libpcap-0.9.8.tar.gz
Reason: curl: (52) Empty reply from server State: New Port: /home/crux/git-to-rsync-working-copy/crux-2.4/opt/libpng Url:
ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.26.tar.bz2
Reason: curl: (19) Given file does not exist State: New Port: /home/crux/git-to-rsync-working-copy/crux-2.4/opt/openntpd Url:
ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/openntpd-3.9p1.tar.gz
Reason: curl: (9) Server denied you to change to the given directory State: New Full report:
http://crux.nu/files/check_urls.html
1
0
0
0
prtverify daily results
by crux@crux.nu
29 Apr '08
29 Apr '08
Differences since last check: (no differences) Full report:
http://crux.nu/files/prtverify.log
1
0
0
0
prtverify daily results
by crux@crux.nu
28 Apr '08
28 Apr '08
Differences since last check: (no differences) Full report:
http://crux.nu/files/prtverify.log
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
217
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
Results per page:
10
25
50
100
200