File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -696,26 +696,28 @@ function _pkginfo_cdata_1_0($xp, $data)
696
696
function infoFromTgzFile ($ file )
697
697
{
698
698
if (!@is_file ($ file )) {
699
- return $ this ->raiseError ("tgz :: could not open file \"$ file \"" );
699
+ return $ this ->raiseError ("could not open file \"$ file \"" );
700
700
}
701
701
$ tar = new Archive_Tar ($ file );
702
702
$ content = $ tar ->listContent ();
703
703
if (!is_array ($ content )) {
704
- return $ this ->raiseError ("tgz :: could not get contents of package \"$ file \"" );
704
+ return $ this ->raiseError ("could not get contents of package \"$ file \"" );
705
705
}
706
706
$ xml = null ;
707
707
foreach ($ content as $ file ) {
708
708
$ name = $ file ['filename ' ];
709
709
if ($ name == 'package.xml ' ) {
710
710
$ xml = $ name ;
711
- } elseif (ereg ('^.*/package.xml$ ' , $ name , $ match )) {
711
+ break ;
712
+ } elseif (ereg ('package.xml$ ' , $ name , $ match )) {
712
713
$ xml = $ match [0 ];
714
+ break ;
713
715
}
714
716
}
715
717
$ tmpdir = System::mkTemp ('-d pear ' );
716
718
$ this ->addTempFile ($ tmpdir );
717
719
if (!$ xml || !$ tar ->extractList ($ xml , $ tmpdir )) {
718
- return $ this ->raiseError ('tgz :: could not extract the package.xml file ' );
720
+ return $ this ->raiseError ('could not extract the package.xml file ' );
719
721
}
720
722
return $ this ->infoFromDescriptionFile ("$ tmpdir/ $ xml " );
721
723
}
You can’t perform that action at this time.
0 commit comments