]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/pakfire/pakfire
Pakfire laedt die Listen jetzt besser und hat eine veraenderte Oberflaeche bekommen.
[ipfire-2.x.git] / src / pakfire / pakfire
index 7ab6f7395c5f2767fea44e4618922b78f7576cd9..9768836ea527976763f2cfb6a8d0833ee331b553 100644 (file)
@@ -3,6 +3,7 @@
        require "/opt/pakfire/lib/functions.pl";
        
        my $interactive = 1;
+       my $force = "noforce";
        
        &Pakfire::logger("PAKFIRE INFO: IPFire Pakfire $Conf::version started!");
        &Pakfire::checkcryptodb;
                        
                        # Turn off shell colors - Bad for displaying in webinterface
                        $Pakfire::enable_colors = 0 if ("$_" eq "--no-colors");
+                       
+                       # Turn on force mode
+                       $force = "force" if ("$_" eq "-f" );
+                       $force = "force" if ("$_" eq "--force" );
                }
        }
 
                
                my @paks;
                my $pak;
-               
                foreach $pak (@ARGV) {
                        unless ("$pak" =~ "^-") {
                                $return = &Pakfire::isinstalled($pak);
                                        &Pakfire::message("PAKFIRE WARN: $pak is not installed");
                                        next;
                                }
-                       
                                push(@paks, $pak);
-                       
                        }
                }
                
        
        
        } elsif ("$ARGV[0]" eq "update") {
-               my $force = "noforce";
                &Pakfire::makeuuid();
                &Pakfire::senduuid();
-               &Pakfire::getmirrors();
-               $force = "force" if ("$ARGV[1]" eq "--force");
+               &Pakfire::getmirrors("$force");
                &Pakfire::dbgetlist("$force");
-               
-       
+               &Pakfire::getcoredb("$force");
+
        } elsif ("$ARGV[0]" eq "upgrade") {
+               &Pakfire::upgradecore();
                my @upgradepaks = &Pakfire::dblist("upgrade", "noweb");
                my @temp;
                
                }
                
        } elsif ("$ARGV[0]" eq "list") {
-               &Pakfire::dblist("all", "noweb");
+               if ("$ARGV[1]" =~ /installed|notinstalled/) {
+                       &Pakfire::dblist("$ARGV[1]", "noweb");
+               } else {
+                       &Pakfire::message("PAKFIRE WARN: Not a known option $ARGV[1]") if ($ARGV[1]); 
+                       &Pakfire::dblist("all", "noweb");
+               }
                
        } elsif ("$ARGV[0]" eq "resolvedeps") {
                foreach (@ARGV) {
                        next if ("$_" =~ "^-");
                        &Pakfire::resolvedeps("$_");
                }
+       } elsif ("$ARGV[0]" eq "enable") {
+               if ("$ARGV[1]" eq "updates") {
+                       system("ln -s ../../opt/pakfire/pakfire /etc/fcron.daily/pakfire-update");
+               elsif ("$ARGV[1]" eq "upgrades") {
+                       system("ln -s ../../opt/pakfire/pakfire /etc/fcron.daily/pakfire-upgrade");
+               }
+       } elsif ("$ARGV[0]" eq "disable") {
+               if ("$ARGV[1]" eq "updates") {
+                       system("rm -f /etc/fcron.daily/pakfire-update");
+               elsif ("$ARGV[1]" eq "upgrades") {
+                       system("rm -f /etc/fcron.daily/pakfire-upgrade");
+               }
        } else {
                &Pakfire::usage;
        }