Code Monkey home page Code Monkey logo

blackarch-devtools's Introduction

blackarch-devtools's People

Contributors

edu4rdshl avatar naltun avatar noraj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

blackarch-devtools's Issues

cleanning option

Actually I remove the chroot and setup it back each time I want to try a package to have a clean setup. Do you know if it is possible to add an option for cleaning the chroot?

Exit call 1 when called without arguments

Even if the test succeed and the command was executed there is still this error at the end:

image

This is due to exit code 1 when the tool was called without options (displaying the help message):

$ blackarch-devtools
blackarch-devtools 0.1.2
Eduard Tolosa <[email protected]>
Development tools for BlackArch Linux

USAGE:
    blackarch-devtools [FLAGS] [OPTIONS]

FLAGS:
    -b, --build      Build package from PKGBUILD in clean chroot environment.
    -c, --clean      Clean chroot environment before building.
    -h, --help       Prints help information
    -s, --setup      Setup the clean chroot environment (automatically setup blackarch keyring).
    -t, --test       Install and test package in clean chroot environment.
    -u, --update     Update BlackArch Linux chroot environment.
    -V, --version    Prints version information
    -v               Sets the level of verbosity

OPTIONS:
    -e, --executable <executable>
            Name of the binary file provided by the package that you're installing in the chroot environment.

    -I, --install-missing <install-missing>...
            Build package files that aren't available in repos. You can specify it multiple times.

    -p, --package <package>                       Build package to install in the clean chroot environment.

$ echo $?           
1

-e option doesn't support executable with arguments

-e option doesn't support executable with arguments.

image

So you can try packages like webshells that are not deploying executable because -e is required. Somting like ls -lhA /usr/share/webshells would have been relevant to test this package but since executable only takes a binary name without arguments it is not yet possible.

[Question] -I and -b

If I use -I to install a missing dep

    -I, --install-missing <install-missing>...
            Build package files that aren't available in repos. You can specify it multiple times.

like this:

blackarch-devtools -I ../perl-encoding-ber/perl-encoding-ber-1.02-1-any.pkg.tar.xz                                                                                       
Syncing chroot copy /home/noraj/blackarch_chroot/blackarch/ with /home/noraj/blackarch_chroot/root/ ...                                                                                                                                       
Chroot environment is ready!                                                                                                                                                                                                                  
Installing missing packages: ["../perl-encoding-ber/perl-encoding-ber-1.02-1-any.pkg.tar.xz"]                                                                                                                                                 
loading packages...                                                                                                                                                                                                                           
resolving dependencies...                                                                                                                                                                                                                     
looking for conflicting packages...                                                                                                                                                                                                           
                                                                                                                                                                                                                                              
Packages (1) perl-encoding-ber-1.02-1                                                                                                                                                                                                         
                                                                                                                                                                                                                                              
Total Installed Size:  0.05 MiB                                                                                                                                                                                                               
                                                                                                                                                                                                                                              
:: Proceed with installation? [Y/n]                                                                                                                                                                                                           
(1/1) checking keys in keyring                                                                                                                 [########################################################################################] 100%
(1/1) checking package integrity                                                                                                               [########################################################################################] 100%
(1/1) loading package files                                                                                                                    [########################################################################################] 100%
(1/1) checking for file conflicts                                                                                                              [########################################################################################] 100%
(1/1) checking available disk space                                                                                                            [########################################################################################] 100%
:: Processing package changes...                                                                                                                                                                                                              
(1/1) installing perl-encoding-ber                                                                                                             [########################################################################################] 100%
:: Running post-transaction hooks...                                                                                                                                                                                                          
(1/2) Arming ConditionNeedsUpdate...                                                                                                                                                                                                          
(2/2) Warn about old perl modules                                                                                                                                                                                                             
==> Making package: rdp-sec-check 9.5956857-1 (sam. 25 janv. 2020 22:16:32 CET)                                                                                                                                                               
==> Retrieving sources...                                                                                                                                                                                                                     
  -> Updating rdp-sec-check git repo...                                                                                                                                                                                                       
Fetching origin                                                                                                                                                                                                                               
==> Validating source files with sha512sums...                                                                                                                                                                                                
    rdp-sec-check ... Skipped                                                                                                                                                                                                                 
==> Making package: rdp-sec-check 9.5956857-1 (Sat 25 Jan 2020 10:16:35 PM CET)                                                                                                                                                               
==> Checking runtime dependencies...                                                                                                                                                                                                          
==> Checking buildtime dependencies...                                                                                                                                                                                                        
==> Installing missing dependencies..
...

I can see it install the package in the working directory and did not install the package I provided to the -I option.

Then using blackarch-devtools -b on a package that has perl-encoding-ber fails because perl-encoding-ber was not installed.

Am I using the -I option incorrectly? Or is there a bug?

Often I have to create a PKGBUILD for a tool but also for one of its dependencies. In this case using blackarch-devtools -b always fails because I can't install the PKGBUILD of the dependency at the same time or before.

How do you do that?

Clearer arg parsing / help message

docopt exists in most languages including rust: https://github.com/docopt/docopt.rs

It defines the interface for your command-line app, and automatically generates a parser for it.

But even if not using this arg parser, adopting a similar help message would be clearer.

Eg.

blackarch-devtools 0.4.0
Eduard Tolosa <[email protected]>
Development tools for BlackArch Linux

Usage:
  ba-dev (-b | -s | -u | -e... [-p] | -I...) [OPTIONS]
  ba-dev (-h | --help)
  ba-dev --version

Options:
  -b, --build                                    Build package from PKGBUILD in clean chroot environment.
  -s, --setup                                    Setup the clean chroot environment (automatically setup blackarch keyring).
  -u, --update                                   Update chroot environment before building.
  -e, --executable <executable>...               Execute the command to test the package in the chroot environment.
  -I, --install-missing <install-missing>...     Build package requiring files that aren't available in repos. You can specify it multiple times.
  -p, --package <package>                        Build package to install in the clean chroot environment.
  -h --help                                      Prints help information
  -V, --version                                  Prints version information
  -v, --verbosity                                Sets the level of verbosity

Instead of

blackarch-devtools 0.4.0
Eduard Tolosa <[email protected]>
Development tools for BlackArch Linux

USAGE:
    ba-dev [FLAGS] [OPTIONS]

FLAGS:
    -b, --build      Build package from PKGBUILD in clean chroot environment.
    -h, --help       Prints help information
    -s, --setup      Setup the clean chroot environment (automatically setup blackarch keyring).
    -u, --update     Update chroot environment before building.
    -V, --version    Prints version information
    -v               Sets the level of verbosity

OPTIONS:
    -e, --executable <executable>...              Execute the command to test the package in the chroot environment.
    -I, --install-missing <install-missing>...
            Build package files that aren't available in repos. You can specify it multiple times.

    -p, --package <package>                       Build package to install in the clean chroot environment.

Because the way it is now we don't know what's a command and what's an option, what is optional, required, mutually exclusive, and repeating elements and which option can be used with which command.

I โค๏ธ this tool and I think it deserves a better help ๐Ÿ˜ƒ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.