RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Olivier Thauvin
  Root:   /v/rpm/cvs                       Email:  [EMAIL PROTECTED]
  Module: rpm                              Date:   14-Aug-2007 03:19:41
  Branch: HEAD                             Handle: 2007081402194100

  Modified files:
    rpm/perl                RPM_PackageIterator.xs rpmxs.c
    rpm/perl/t              05.packageiterator.t

  Log:
    - perl: fix RPM::PkgIterator->new and add initial tests

  Summary:
    Revision    Changes     Path
    1.2         +2  -1      rpm/perl/RPM_PackageIterator.xs
    1.4         +1  -1      rpm/perl/rpmxs.c
    1.2         +24 -3      rpm/perl/t/05.packageiterator.t
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/perl/RPM_PackageIterator.xs
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 RPM_PackageIterator.xs
  --- rpm/perl/RPM_PackageIterator.xs   5 Aug 2007 22:14:12 -0000       1.1
  +++ rpm/perl/RPM_PackageIterator.xs   14 Aug 2007 01:19:41 -0000      1.2
  @@ -34,7 +34,8 @@
       int keylen
       PREINIT:
       rpmts ts = rpmtsCreate();
  -    CODE:
  +    PPCODE:
  +    PUTBACK;
       _newiterator(ts, sv_tagname, sv_tagvalue, keylen);
       SPAGAIN;
       ts = rpmtsFree(ts);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/perl/rpmxs.c
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 rpmxs.c
  --- rpm/perl/rpmxs.c  7 Aug 2007 00:09:58 -0000       1.3
  +++ rpm/perl/rpmxs.c  14 Aug 2007 01:19:41 -0000      1.4
  @@ -97,7 +97,7 @@
       void * value = NULL;
       int i = 0;
       dSP;
  -        if (sv_tagname == NULL || !SvOK(sv_tagname)) {
  +    if (sv_tagname == NULL || !SvOK(sv_tagname)) {
           tag = RPMDBI_PACKAGES; /* Assume search into installed packages */
       } else {
           tag = sv2dbquerytag(sv_tagname);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/perl/t/05.packageiterator.t
  ============================================================================
  $ cvs diff -u -r1.1 -r1.2 05.packageiterator.t
  --- rpm/perl/t/05.packageiterator.t   5 Aug 2007 22:12:53 -0000       1.1
  +++ rpm/perl/t/05.packageiterator.t   14 Aug 2007 01:19:41 -0000      1.2
  @@ -2,10 +2,31 @@
   
   use strict;
   use Test::More tests => 2;
  +use RPM;
   
  +my $tempdbpath = `pwd`;
  +chomp($tempdbpath);
  +$tempdbpath .= '/t/tempdb';
  +
  +END {
  +    clean();
  +}
  +
  +sub clean {
  +    system(qw(rm -fr), $tempdbpath);
  +}
  +
  +clean();
  +
  +# Creating temp db
  +mkdir($tempdbpath) or die "Cannot create $tempdbpath";
  +my @rpmcmd = (qw(../rpm --macros ../macros --define), "_dbpath $tempdbpath", 
'--initdb');
  +system(@rpmcmd) and die "Cannot init db in $tempdbpath";
  +
  +RPM::load_macro_file('../macros');
  +RPM::add_macro("_dbpath $tempdbpath");
   use_ok('RPM::PackageIterator');
   
  -SKIP: {
  -skip "Does not work at time", 1;
   isa_ok(RPM::PackageIterator->new(), 'RPM::PackageIterator');
  -}
  +
  +clean();
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to