Advertising
Paste Description for null
gupding.c
- null
- Monday, May 28th, 2012 at 1:18:02pm MDT
- #include <sys/ioctl.h>
- #include <stdio.h>
- int main (void)
- {
- int choice = 0;
- struct winsize w;
- ioctl(0, TIOCGWINSZ, &w);
- setuid(0);
- do
- {
- printf(" \n");
- printf("\033[01;31m1)\033[01;32m -= Update portage tree =-\033[01;00m\n");
- printf("\033[01;31m2)\033[01;32m -= Update your system =-\033[01;00m\n");
- printf("\033[01;31m3)\033[01;32m -= Update your system (+bdeps) =-\033[01;00m\n");
- printf("\033[01;31m4)\033[01;32m -= Rebuild your system =-\033[01;00m\n");
- printf("\033[01;31m5)\033[01;32m -= Remove obsoleted packages =-\033[01;00m\n");
- printf("\033[01;31m6)\033[01;32m -= Rebuild broken packages =-\033[01;00m\n");
- printf("\033[01;31m7)\033[01;32m -= Clean distfiles =-\033[01;00m\n");
- printf("\033[01;31m0)\033[01;32m -= Exit =-\033[01;00m\n");
- scanf("%d", &choice);
- if (choice)
- {
- printf(" \n");
- switch (choice)
- {
- case 1:
- printf("\033[01;32m-= Updating portage tree =-\033[01;00m\n");
- system("emerge --verbose --sync");
- printf("\033[01;32m-= Portage tree updated successfully =-\033[01;00m\n");
- break;
- case 2:
- printf("\033[01;32m-= Updating your system =-\033[01;00m\n");
- system("emerge --ask --deep --newuse --tree --update --verbose world");
- printf("\033[01;32m-= System updated successfully =-\033[01;00m\n");
- break;
- case 3:
- printf("\033[01;32m-= Updating your system (+bdeps) =-\033[01;00m\n");
- system("emerge --ask --deep --newuse --tree --update --verbose --with-bdeps=y world");
- printf("\033[01;32m-= System (+bdeps) updated successfully =-\033[01;00m\n");
- break;
- case 4:
- printf("\033[01;32m-= Rebuilding your system =-\033[01;00m\n");
- system("emerge --ask --emptytree --verbose world");
- printf("\033[01;32m-= System rebuilded successfully =-\033[01;00m\n");
- break;
- case 5:
- printf("\033[01;32m-= Removing obsoleted packages =-\033[01;00m\n");
- system("emerge --ask --verbose --depclean");
- printf("\033[01;32m-= Obsoleted packages removed successfully =-\033[01;00m\n");
- break;
- case 6:
- printf("\033[01;32m-= Rebuilding broken packages =-\033[01;00m\n");
- system("revdep-rebuild");
- printf("\033[01;32m-= Broken packages rebuilded successfully =-\033[01;00m\n");
- break;
- case 7:
- printf("\033[01;32m-= Cleaning distfiles =-\033[01;00m\n");
- system("eclean -d distfiles");
- system("rm -f /usr/portage/distfiles/*");
- printf("\033[01;32m-= Distfiles cleaned successfully =-\033[01;00m\n");
- break;
- case 0:
- printf("\033[01;32m-= Exiting =-\033[01;00m\n");
- break;
- default:
- printf("\033[01;32m-= Wrong choice, choose again =-\033[01;00m\n");
- break;
- }
- }
- } while (!(isalpha(choice)) && (choice != 0));
- return 0;
- }
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.