]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/pakfire/lib/functions.pl
pakfire: Optimize upgradecore function
[people/pmueller/ipfire-2.x.git] / src / pakfire / lib / functions.pl
index 971aa2d5956c0d96182efaa1fb7246592e0d14c0..4f0515f62b048b2f197dfb25cc3d736ec436c339 100644 (file)
@@ -773,35 +773,28 @@ sub setuppak {
 }
 
 sub upgradecore {
-       getcoredb("noforce");
-       eval(`grep "core_" $Conf::dbdir/lists/core-list.db`);
-       if ("$core_release" > "$Conf::core_mine") {
-               # Safety check for lazy testers:
-               # Before we upgrade to the latest release, we re-install the previous release
-               # to make sure that the tester has always been on the latest version.
-               my $tree = &get_tree();
-               $Conf::core_mine-- if ($tree eq "testing" || $tree eq "unstable");
-
-               message("CORE UPGR: Upgrading from release $Conf::core_mine to $core_release");
-
-               my @seq = `seq $Conf::core_mine $core_release`;
-               shift @seq;
-               my $release;
-               foreach $release (@seq) {
-                       chomp($release);
-                       getpak("core-upgrade-$release");
-               }
-
-               foreach $release (@seq) {
-                       chomp($release);
-                       upgradepak("core-upgrade-$release");
-               }
-
-               system("echo $core_release > $Conf::coredir/mine");
+       # Safety check for lazy testers:
+       # Before we upgrade to the latest release, we re-install the previous release
+       # to make sure that the tester has always been on the latest version.
+       my $tree = &get_tree();
+       $Conf::core_mine-- if ($tree eq "testing" || $tree eq "unstable");
 
-       } else {
-               message("CORE INFO: No new upgrades available. You are on release $Conf::core_mine.");
+       message("CORE UPGR: Upgrading from release $Conf::core_mine to $core_release");
+       
+       my @seq = ($Conf::core_mine .. $core_release);
+       shift @seq;
+       my $release;
+       foreach $release (@seq) {
+               chomp($release);
+               getpak("core-upgrade-$release");
        }
+       
+       foreach $release (@seq) {
+               chomp($release);
+               upgradepak("core-upgrade-$release");
+       }
+       
+       system("echo $core_release > $Conf::coredir/mine");
 }
 
 sub isinstalled {