]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-apt-ftparchive-src-cachedb
fix apt-config test now that PATH changed in 8c617819
[apt.git] / test / integration / test-apt-ftparchive-src-cachedb
index 3a5507c213e2f21e622637dc9474e2741359e7eb..1af193632192561027701b087753daaa7d3b8c17 100755 (executable)
@@ -105,6 +105,30 @@ mkdir -p aptarchive/dists/test/main/source/
 
 mkdir aptarchive-overrides
 mkdir aptarchive-cache
+
+
+
+# generate with --db option
+(cd aptarchive && aptftparchive --db ./test.db sources pool/main/ \
+    -o APT::FTPArchive::ShowCacheMisses=1  \
+    > dists/test/main/source/Sources \
+    2> stats-out.txt
+    testequal " Misses in Cache: 2" grep Misses stats-out.txt
+)
+assert_correct_sources_file
+
+# generate with --db option (again to ensure its in the cache)
+(cd aptarchive && aptftparchive --db ./test.db sources pool/main/ \
+    -o APT::FTPArchive::ShowCacheMisses=1  \
+    > dists/test/main/source/Sources \
+    2> stats-out.txt  
+    testequal " Misses in Cache: 0" grep Misses stats-out.txt
+)
+assert_correct_sources_file
+
+
+
+# get ready for the "apt-ftparchive generate" command
 cat > apt-ftparchive.conf <<"EOF"
 Dir {
   ArchiveDir "./aptarchive";
@@ -135,7 +159,6 @@ Tree "dists/test" {
 };
 EOF
 
-
 # generate (empty cachedb)
 aptftparchive generate apt-ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1 2> stats-out.txt
 testequal " Misses in Cache: 2" grep Misses stats-out.txt
@@ -148,6 +171,8 @@ aptftparchive generate apt-ftparchive.conf -o APT::FTPArchive::ShowCacheMisses=1
 testequal " Misses in Cache: 0" grep Misses stats-out.txt
 assert_correct_sources_file
 
+
+
 # generate invalid files
 mkdir aptarchive/pool/invalid
 printf "meep" > aptarchive/pool/invalid/invalid_1.0.dsc
@@ -159,4 +184,10 @@ dd if=/dev/zero of="aptarchive/pool/invalid/toobig_1.0.dsc" bs=1k count=129 2>/d
 testequal "
 E: DSC file 'aptarchive/pool/invalid/toobig_1.0.dsc' is too large!" aptftparchive sources aptarchive/pool/invalid
 
+# ensure clean works
+rm -f aptarchive/pool/main/*
+aptftparchive clean apt-ftparchive.conf -o Debug::APT::FTPArchive::Clean=1 > clean-out.txt 2>&1 
+testequal "0   Number of unique keys in the tree" grep unique clean-out.txt
+testequal "sources-main.db" grep sources-main.db clean-out.txt
+