X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=src%2Fpakfire%2Fpakfire;h=9768836ea527976763f2cfb6a8d0833ee331b553;hp=d262ac384334f71e09f20c2e01493361d5bb1cc8;hb=377560fbff99600f9260764b8c16e8a02821ea3a;hpb=2aa6d448d1f3321e0b016b58401d83da94c4fa65 diff --git a/src/pakfire/pakfire b/src/pakfire/pakfire index d262ac3843..9768836ea5 100644 --- a/src/pakfire/pakfire +++ b/src/pakfire/pakfire @@ -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; @@ -45,6 +46,10 @@ # 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" ); } } @@ -207,9 +212,9 @@ } elsif ("$ARGV[0]" eq "update") { &Pakfire::makeuuid(); &Pakfire::senduuid(); - &Pakfire::getmirrors(); - &Pakfire::dbgetlist("noforce"); - &Pakfire::getcoredb(); + &Pakfire::getmirrors("$force"); + &Pakfire::dbgetlist("$force"); + &Pakfire::getcoredb("$force"); } elsif ("$ARGV[0]" eq "upgrade") { &Pakfire::upgradecore(); @@ -259,6 +264,18 @@ 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; }