Browse Source

* Give a clear error when the source of a package is not available

git-svn-id: trunk@35776 -
joost 8 years ago
parent
commit
61739262c7
2 changed files with 8 additions and 4 deletions
  1. 6 3
      packages/fppkg/src/pkgcommands.pp
  2. 2 1
      packages/fppkg/src/pkgmessages.pp

+ 6 - 3
packages/fppkg/src/pkgcommands.pp

@@ -366,11 +366,14 @@ begin
       else
       else
         begin
         begin
           P:=PackageManager.FindPackage(PackageName, pkgpkAvailable);
           P:=PackageManager.FindPackage(PackageName, pkgpkAvailable);
-          if Assigned(P) then
+          if not Assigned(P) then
             begin
             begin
-              if P.PackagesStructure.UnzipBeforeUse then
-                ExecuteAction(PackageName,'unzip');
+              Error(Format(SErrPackageNotAvailable, [PackageName]));
+              Exit;
             end;
             end;
+
+          if P.PackagesStructure.UnzipBeforeUse then
+            ExecuteAction(PackageName,'unzip');
           ExecuteAction(PackageName,'installdependencies');
           ExecuteAction(PackageName,'installdependencies');
         end;
         end;
     end;
     end;

+ 2 - 1
packages/fppkg/src/pkgmessages.pp

@@ -26,7 +26,8 @@ Resourcestring
   SErrMissingPackage         = 'Could not find package "%s"';
   SErrMissingPackage         = 'Could not find package "%s"';
   SErrMissingInstallRepo     = 'Could not find repository "%s"';
   SErrMissingInstallRepo     = 'Could not find repository "%s"';
   SErrNoPackageSpecified     = 'No package specified';
   SErrNoPackageSpecified     = 'No package specified';
-  SErrNoPackageAvailable     = 'Package %s %s is not available';
+  SErrPackageNotAvailable    = 'Source of package %s is not available';
+  SErrNoPackageAvailable     = 'Package dependency %s %s is not available';
   SErrOnlyLocalDir           = 'The specified command "%s" works only on current dir, not on a (remote) package';
   SErrOnlyLocalDir           = 'The specified command "%s" works only on current dir, not on a (remote) package';
   SErrIllConfRepository      = 'Invalid configured repository "%s"';
   SErrIllConfRepository      = 'Invalid configured repository "%s"';
   SErrExecutionFPMake        = 'Execution of FPMake %s failed';
   SErrExecutionFPMake        = 'Execution of FPMake %s failed';