dnf 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/sh
  2. # This file is part of UPMS. 
  3. # Copyright (c) 2016 ali abdul ghani <blade.vp2020@gmail.com>
  4. # UPMS is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version. 
  8. # UPMS is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12.  
  13. # You should have received a copy of the GNU General Public License
  14. # along with UPMS. If not, see <http://www.gnu.org/licenses/>.
  15. updatey() {
  16. if test $# = 0
  17. then
  18. apt-get -y update && apt-get -y upgrade
  19. else
  20. apt-get -y install $1
  21. fi
  22. }
  23. yes() {
  24. if test "$1" = "install"
  25. then
  26. apt-get -y install $2
  27. elif test "$1" = "upgrade"
  28. then
  29. updatey $2
  30. elif test "$1" = "remove"
  31. then
  32. apt-get -y purge $2
  33. else
  34. echo E: Invalid operation $1
  35. fi
  36. }
  37. update() {
  38. if test $# = 0
  39. then
  40. apt-get update && apt-get upgrade
  41. else
  42. apt-get install $1
  43. fi
  44. }
  45. if test "$1" = "install"
  46. then
  47. apt-get install $2
  48. elif test "$1" = "autoremove"
  49. then
  50. apt-get autoremove
  51. elif test "$1" = "upgrade"
  52. then
  53. update $2
  54. elif test "$1" = "info"
  55. then
  56. apt-cache show $2
  57. elif test "$1" = "-y"
  58. then
  59. updatey $2 $3
  60. elif test "$1" = "remove"
  61. then
  62. apt-get purge $2
  63. else
  64. echo E: Invalid operation $1
  65. fi