OpenPKG CVS Repository
  http://www.openpkg.org/cvsweb/cvsweb.cgi
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-re                       Date:   14-Aug-2002 12:05:06
  Branch: HEAD                             Handle: 2002081411050600

  Modified files:
    openpkg-re              src2make.pl

  Log:
    correct support for strange packages like gcc

  Summary:
    Revision    Changes     Path
    1.40        +8  -7      openpkg-re/src2make.pl
  ____________________________________________________________________________

  Index: openpkg-re/src2make.pl
  ============================================================
  $ cvs diff -u -r1.39 -r1.40 src2make.pl
  --- openpkg-re/src2make.pl    14 Aug 2002 10:00:47 -0000      1.39
  +++ openpkg-re/src2make.pl    14 Aug 2002 10:05:06 -0000      1.40
  @@ -205,19 +205,20 @@
       #   (because RPM has only single REQUIRE queries and applied to
       #   source RPMs they return the BuildPreReq and applied to the .spec
       #   they act as applied on a binary RPM and return the PreReq)
  -    &runcmd("$prefix/bin/rpm2cpio $srcdir/$srcrpm | (cd $tmpdir && $cpio -idvmu 
$srcrpm_name.spec >/dev/null 2>&1)");
  -    if (not -f "$tmpdir/$srcrpm_name.spec") {
  +    system("rm -rf $tmpdir/$srcrpm_name >/dev/null 2>&1 || true");
  +    mkdir("$tmpdir/$srcrpm_name", 0700) || die "cannot create temporary directory 
'$tmpdir/$srcrpm_name'";
  +    &runcmd("$prefix/bin/rpm2cpio $srcdir/$srcrpm | (cd $tmpdir/$srcrpm_name && 
$cpio -idvmu $srcrpm_name.spec $srcrpm_name.sh >/dev/null 2>&1)");
  +    if (not -f "$tmpdir/$srcrpm_name/$srcrpm_name.spec") {
           die "failed to extract '$srcrpm_name.spec' from '$srcdir/$srcrpm'";
       }
       $q = "[M-PreReq:<%{REQUIRENAME} %|REQUIREFLAGS?{%{REQUIREFLAGS:depflags} 
%{REQUIREVERSION}}:{}|>\n]";
       $q .= "[M-Provides:<%{PROVIDENAME} %|PROVIDEFLAGS?{%{PROVIDEFLAGS:depflags} 
%{PROVIDEVERSION}}:{}|>\n]";
  -    my $pwd = `pwd`;
  -    $o = `cd $tmpdir && $prefix/bin/rpm -q --qf "$q" --define "_sourcedir $pwd" 
--define '_specdir $pwd' --specfile $srcrpm_name.spec`;
  +    $o = `cd $tmpdir/$srcrpm_name && $prefix/bin/rpm -q --qf "$q" --define 
'_sourcedir .' --define '_specdir .' --specfile $srcrpm_name.spec`;
       $o =~ s|M-PreReq:<rpmlib\(.*?\).*?>\n||gs;
       $r = &parseresponse($o);
       my $pkg_ireq     = $r->{PreReq};
       my $pkg_prov     = $r->{Provides};
  -    unlink("$tmpdir/$srcrpm_name.spec");
  +    system("rm -rf $tmpdir/$srcrpm_name >/dev/null 2>&1 || true");
   
       #    helper function for parsing the query outputs
       sub parseresponse {
  @@ -260,8 +261,8 @@
           $str =~ s|,\s+$||s;
           return $str;
       }
  -    #&verbose("  build   requirement: ".&reqstr($pkg_breq));
  -    #&verbose("  install requirement: ".&reqstr($pkg_ireq));
  +    &verbose("  build   requirement: ".&reqstr($pkg_breq));
  +    &verbose("  install requirement: ".&reqstr($pkg_ireq));
   
       #   remember dependencies in graphs:
       #   this -> dep1, ..., this -> depN
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to