Giter Site home page Giter Site logo

trytomakeyouprivate / copr-command Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 4.0 47 KB

A small script reenabling the "COPR" command on Fedora distros not including it

License: GNU General Public License v3.0

Shell 100.00%
atomic copr fedora kinoite repository rpm rpm-ostree sericea silverblue ublue

copr-command's People

Stargazers

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

Watchers

 avatar

copr-command's Issues

add "disable"

if grep -qFx 'enabled=1' $repofile; then
   sed 's/enabled=1/enabled=0/g' $repofile > /dev/null \
   && echo "Repository $author/$reponame disabled."
elif grep -qFx 'enabled=0' $repofile; then
    echo "Repo already disabled."
else
   echo "Repo not found."
fi

Use `find` instead of `ls`

Instead of

ls /etc/yum.repos.d/ | grep COPR_

Use

find /etc/yum.repos.d/ -type f -name 'COPR_*' -printf "%f\n"

find is more reliable, as it's strictly used for finding files like in this example with additional options & it's better for further parsing the output, while classic ls is usually used to list folder content & nothing else by the ordinary user.

install to root path

/root/.local/bin does not exist, installing the command will likely need RPM packaging

Duplicate "enable"

Two commands

  • if not exists -> download the repo
  • if already exists -> use sed and activate it

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.