diff options
-rw-r--r-- | RPM4/src/RPM4.xs | 2 | ||||
-rw-r--r-- | RPM4/t/05transaction.t | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index 6fb1003..f0bb272 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -1379,7 +1379,7 @@ rpmdbinit(rootdir = NULL) /* rpm{db,ts}init is deprecated, we open a database with create flags * and close it */ /* 0 on success */ - RETVAL = rpmtsOpenDB(ts, O_CREAT); + RETVAL = rpmtsOpenDB(ts, O_RDWR | O_CREAT); ts = rpmtsFree(ts); OUTPUT: RETVAL diff --git a/RPM4/t/05transaction.t b/RPM4/t/05transaction.t index 8ee1f44..1454da1 100644 --- a/RPM4/t/05transaction.t +++ b/RPM4/t/05transaction.t @@ -13,13 +13,12 @@ RPM4::add_macro("_dbpath /dev/null"); ok(RPM4::rpmdbverify() != 0, "Verify non existing database (get error)"); my $tempdir = tempdir(); -rmtree($tempdir) if $tempdir; my $testdir = "$tempdir/testdb"; -mkdir $testdir; +mkdir $testdir || die $!; RPM4::add_macro("_dbpath $testdir"); -ok(RPM4::rpmdbinit() == 0, "initdb works"); +ok(RPM4::rpmdbinit() == 0 || -f "$testdir/Packages", "initdb works"); ok(RPM4::rpmdbrebuild() == 0, "rebuild database"); ok(RPM4::rpmdbverify() == 0, "Verify empty"); |