123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #!/bin/bash
- # Rosetta Stone Package Manager
- # https://github.com/Digit/witch/issues/18
- #this is just an initial laying out ... much change is expected, and it is not expected to work yet.
- PACKAGEMGR=$(sed -n '4p' $WITCH/config.base.txt)
- #basics first. AFTER we get these, we can futz over the finer grained nuanced commands.
- #install
- #remove
- #update
- #upgrade
- #search
- case $PACKAGEMGR in
- "PORTAGE")
- case $1 in
- "install") emerge $2 ;;
- "remove") emerge -C $2 ;;
- "update") emerge --sync ;;
- "upgrade") emerge -DuN ;;
- "search")
- if [ $eix == "true" ]; then #FIXME
- eix $2
- else
- emerge --search $2
- fi
- ;;
- esac
- ;;
-
- "PALUDIS")
- case $1 in
- "install") cave resolve -x $2 ;;
- "remove") cave resolve -Px $2 ;; # ~ er, i've forgotten the paludis commands. ...
- "update") cave sync ;;
- "upgrade") cave resolve world -x ;;
- "search") cave search $2 ;;
- esac
- # etc
- ;;
-
- "APTGET")
- case $1 in
- "install") apt-get install $2 ;;
- "remove") apt-get remove $2 ;;
- "update") apt-get update ;;
- "upgrade") apt-get upgrade ;;
- "search") apt-cache search $2 ;;
- esac
- ;;
-
- "SLAPTGET")
- case $1 in
- "install") slapt-get install $2 ;;
- "remove") slapt-get remove $2 ;;
- "update") slapt-get update ;;
- "upgrade") slapt-get upgrade ;;
- "search") slapt-cache search $2 ;; #that right?? FIXME
- esac
- ;;
-
- "XBPS")
- case $1 in
- "install") xbps-install $2 ;;
- "remove") xbps-remove $2 ;;
- "update") xbps-install -S ;;
- "upgrade") xbps-install -Su ;;
- "search") xbps-query -Rs $2 ;;
- esac
- ;;
-
- "PACMAN")
- case $1 in
- "install") pacman -S $2 ;;
- "remove") pacman -Rc $2 ;;
- "update") pacman -Sy ;;
- "upgrade") pacman -Syu ;;
- "search") pacman -Ss $2 ;;
- esac
- ;;
-
- "ZYPPER")
- case $1 in
- "install") zypper in $2 ;;
- "remove") zypper rm $2 ;;
- "update") zypper ref ;;
- "upgrade") zypper up ;;
- "search") zypper se $2 ;;
- esac
- ;;
-
- "GUIX")
- case $1 in
- "install") guix package -i $2 ;;
- "remove") guix package -r $2 ;;
- "update") guix pull ;;
- "upgrade") guix package -u $2 ;;
- "search") guix package -s $2 ;;
- esac
- ;;
- esac
- # ^ something like that. basic jist. now clean up, and repeat for other package managers.
- # feel free to come up with a better way... this is just an initial jotting down of the concept... not clean code. SO LETS NOT PUT rspm COMMANDS ANYWHERE UNTIL IT IS REAL WORKING CODE. ;)
|