cwilling / hoorex Goto Github PK
View Code? Open in Web Editor NEWThis repo now archived. Development continues at https://gitlab.com/chris.willing/hoorex
Home Page: https://gitlab.com/chris.willing/hoorex
License: GNU General Public License v3.0
This repo now archived. Development continues at https://gitlab.com/chris.willing/hoorex
Home Page: https://gitlab.com/chris.willing/hoorex
License: GNU General Public License v3.0
Deal with bad package names at command line. Currently we just fail and show backtrace.
Sometimes I just want an ordering of the packages I input to hoorex i.e. no info about other packages possibly related by some dependency to those in the original list.
NB. somewhat similar filters already exist: -I & -i options restrict output to packages already installed on the system.
Could we do without pyxdg package as a prerequisite to run HooRex? It would make HooRex much more self-contained without it ...
Add option to show output as a single column i.e. newline separated rather than space separated
Examples:
$ ./hoorex -r ttf-mscorefonts -d
DEBUG: VERBOSE mode set at command line
DEBUG: Set sbo_path to /home/aaditya/slackbuilds from config file
DEBUG: sbo_path: /home/aaditya/slackbuilds
DEBUG: Loading existing repo data
DEBUG: PkgData loaded from file OK
DEBUG: Processing initial targets of: []
DEBUG: REVERSE mode set at command line
DEBUG: [[]]
$ ./hoorex -r cantarell-fonts -d
DEBUG: VERBOSE mode set at command line
DEBUG: Set sbo_path to /home/aaditya/slackbuilds from config file
DEBUG: sbo_path: /home/aaditya/slackbuilds
DEBUG: Loading existing repo data
DEBUG: PkgData loaded from file OK
DEBUG: Processing initial targets of: []
DEBUG: REVERSE mode set at command line
DEBUG: [[]]
Tried with 0.5.6
as well as git version.
There's no internal mechanism for editing the user's default configuration; just manual editing of their defaults.cfg file. Probably want something like:
hoorex -c|--configure key=value
It would need some validation component i.e. is it a valid key? is it a valid value?
Hi,
when running with DEPTARGET=PREREQS only .info-files with a PREREQS= line are considered when running build_dicts().
I'm not sure if this is intended behaviour, is it?
Reproduction:
on a new SBo repo run "hoorex -d -f". Around 2000 packages are found.
Running "DEPTARGET=PREREQS hoorex -d -f" results in zero packages.
Now add a PREREQS-line to any package and re-run the above command.
Patch:
diff --git a/hoorex b/hoorex
index 0829d69..06c15a2 100755
--- a/hoorex
+++ b/hoorex
@@ -353,6 +353,20 @@ def build_dicts(sbo_path, PkgData, deptarget='REQUIRES'):
DirectRequires[pkgname].remove('%README%')
except:
pass
+ else:
+ n = reg_requires.search(txt)
+ if n:
+ value = ''
+ if n.group('value'):
+ # Remove line continuation backslashes
+ value = n.group('value').replace('\\', '')
+ hlog.debug("Adding %s ----- (%s)" % (pkgname, value))
+ PkgCategory[pkgname] = category
+ DirectRequires[pkgname] = value.split()
+ try:
+ DirectRequires[pkgname].remove('%README%')
+ except:
+ pass
#print
hlog.debug("Step 1 done - %d entries" % len(DirectRequires))
This works for me so far, but I didn't test it in depth.
And maybe it is possible to set the repoData filename and PREREQS==True from the config file? So we can have two config files, one with prereqs and one without them. I have to admid, I'm not sure if this would be useful.
Thanks for the tool and enjoy the weekend :)
Dennis
[root@raymonde:~] # hoorex lame
Traceback (most recent call last):
File "/usr/bin/hoorex", line 427, in
main()
File "/usr/bin/hoorex", line 32, in main
default_config = load_user_config()
File "/usr/bin/hoorex", line 372, in load_user_config
with open(config_file, 'wb') as configfile:
IOError: [Errno 2] No such file or directory: '/root/.config/hoorex/defaults.cfg'
Do we need a "write to file" option? Its easy enough to redirect stdout without a dedicated option.
Using --long output in any but last stage of pipeline fails because sorting expects just a list of package names, not list of category/package
We calculate dependencies using the REQUIRES field in packages' .info files. In some repos the .info files may be enhanced with fields to describe different dependencies. We should be able to determine the dependency relationships with these differently named fields. A command line option backed by configuration setting for this is easy enough (build_dicts already has a karg deptarget='REQUIRES' so that the caller could specify a different deptarget).
The main problem is when the new field used in the .info fields includes a $REQUIRES entry i.e. it normally relies on shell expansion. Since we don't use shell to decipher the .info files, we'd have to do that ourselves.
At the moment we log as critical any input package names that are unknown i.e. not from the SBo repo, and then exit. How about being more relaxed about this - just ignore it and carry on. Perhaps some option to enforce strictness though ..
Filter normal output to show those packages which are already installed
We have ready for next release some predefined groups that can used as input, rather than having to itemize some large list on the command line, using the new -g|--group option. The groups that HooRex know about are all the SBo software categories (audio, libraries, system etc.) as well as the "all" group i.e. everything in the repository. So 'hoorex -g desktop' means to use all the package names in the desktop category as input.
The predefined groups are probably more cute than useful; what might be really useful is if the user could define their own groups e.g. 'hoorex -G mine="abc uwh kfj ... jfdh" in which "mine" would be the group name and abc, uwh, kfj, some more pkgs and jfdh would be the package names in the group. We could save that in the user's configuration so they could always run "hoorex -g mine" to process all the packages in the mine group.
Or, is it sufficient that since we can have package names taken from stdin, the user could just make a file with the packages of interest and then do "hoorex < package_list_file.txt"?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.