[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] RaQ550 - /home/packages problem



At 20:49 23.04.2003 +0200, you wrote:
At 11:46 23.04.2003 +0100, Richard Sidlin wrote:
I have pkg files in /home/packages but does not show up the extra field
either.


Richard

I remember at the beginning I was able to install one pkg manually which was placed in /home/packages but this option hasnt shown up ever since.

Marc

Hi there

As a followup: I decided to check for the problem for myself and I think I located the problem:

It's this snippet of code in manual.php which gets called when you click on "Install Manually". The problem is if you run "file" against any of the newer packages you will get "data" as return value and not "tar" any longer.


These newer pks are obviously signed, you have to first decrypt them ( found on cobalt-developers ):
/usr/bin/gpg --output /tmp/filename.tar --decrypt package.pkg



Snippet from manual.php:
// get all loaded packages. we'll match anything that's a tar
// file
$dirName = "/home/packages";
$magic_cmd = "/usr/bin/file";
$packages = array();
if(is_dir($dirName)) {
  $dir = opendir($dirName);
  while($file = readdir($dir)) {
        if ($file[0] == '.')
                continue;
$serverScriptHelper->shell("$magic_cmd $dirName/$file", $output, 'root');
        if (ereg("(tar|compressed|PGP\s+armored|\sdata$)", $output)) {
                $packages[] = $file;
        }
  }
  closedir($dir);
}



Marc