noprobelm / nay Goto Github PK
View Code? Open in Web Editor NEWA wrapper for pacman which includes support for AUR packages
License: MIT License
A wrapper for pacman which includes support for AUR packages
License: MIT License
Defining a dictionary at the beginning of the Args
class is unwieldy, does not ensure the necessary keys will be present, and is not conducive to future expansion. Write an Options
class that will be passed to the Args
object upon initialization.
Due to a weird way in which pacman
sometimes considers stdout
to actually be stderr
, I've had some difficulty implementing subprocess.run(check=True)
for pacman
functions while retaining the full intended stdout
.
One example is with subprocess.run(shlex.split(sudo pacman -Rs <targets>), check=True, stderr=subprocess.PIPE), in which case we're attempting to run
pacmanas a subprocess, catch any errors using
check=True, and print
stderr` to the console if an error is encountered.
In the event this example does not encounter an error, the packages intended for removal will still be displayed in stdout
as intended, but the "proceed" prompt presented by pacman is actually considered stderr
and as a consequence is suppressed from the terminal.
The current design omits stderr=subprocess.PIPE
so the user is presented with the full intended stdout
and stderr
, but as a consequence we can't be specific with our PacmanError
exception handling.
Need to figure out a way to capture stderr and/or stdout while still printing it to the console. The methods subprocess.Popen
exposes (specifically communicate
might be the solution to this problem.
Only "inclusive" options (i.e. 1 2 3 5-7) are supported. Add capability for exclusion.
networkx is overkill for an application like this and adds significant weight to nay's dependency list. I used networkx in the first place to get AUR dependency resolution working, but we can easily enough replace this dependency by implementing our own breadth-first search algorithm to install "layers" of dependencies in the correct order.
So far the focus has mainly been on Sync
, Remove
, and Query
operations. The latter two are easy as the options/args are redirected to their corresponding "pure wrapper" classes from the operations
module.
Need to consider adding operations for -D
, -T
, -U
, and -F
so nay
is fully interchangeable with pacman
Add operations:
-D
(database)-T
(deptest)-U
(upgrade)-F
(files)The current implementation assumes you either will or won't run sudo for all options that fall under an operation. The reality is it isn't this black and white. For example, pacman -D
operations may or may not require sudo.
pacman -D --asdeps
requires sudo
pacman -Dk
does not require sudo
Maybe this could be resolved by checking for the error: you cannot perform this operation unless you are root
error produced by pacman
, but this approach would be blocked by #38
Root privileges are required for this option.
The args module looks for at least one argument. Need to add a case for optless/argless call
The default right now is to sort by database of origin (core
, extra
, community
, multilib
, <any other arbitrary databases>
, aur
), then alphabetically by package name, but the user should have the option to sort by whatever criteria they desire.
The utils
and operations
module are filled with functions/classes with less-than-ideal args, both in their definitions as well as the manner in which they're passed. Needs to be cleaned up to be consistent across the board.
If it's not a huge headache, nay
would benefit from custom progress bars. The progress bars provided by rich
are easy to implement and look beautiful (not to mention they're used by pip
)
I originally thought it would be a good idea to have an AUR
and SyncDB
subclass for each type of package to eliminate the necessity for conditional statements when creating a Package
object's renderable
attribute, but this has just resulted in confusing code where different objects must be instantiated depending on the package's source.
The reality is that a package's representation can really only go one of two ways depending on whether its origin is from a sync database or the AUR. I should condense these objects and deal with the consequence of having a few conditional statements when defining the renderable
and info
class attributes.
Need to add manual parsing of PKGBUILD files to recursively identify and add AUR dependencies for installation.
nay will currently install all packages and dependencies, regardless of whether they were explicitly supplied by the user. Update functionality to install only packages that were either specified by the user or are uninstalled dependencies.
Some options like y
and u
(for sync operations) can be stacked to invoke different operations. Need to add support for this.
Example syntax:
nay -G <targets>
asp checkout <target>
: dump in PWDgit clone https://aur.archlinux.org/<target>.git
: dump in PWDThe main options have been added so far, but there are many less-used options available for Sync that need to be added.
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.