Просмотр исходного кода

fix compile and tests error

I am pretty sure I did that before committing broken stuff…

Git-Dch: Ignore
David Kalnischkies лет назад: 11
Родитель
Сommit
9d653a6de2

+ 4 - 4
apt-pkg/acquire-item.cc

@@ -1742,10 +1742,6 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/
    // check if we need to fail at this point 
    // check if we need to fail at this point 
    if (AuthPass == true && CheckStopAuthentication(RealURI, Message))
    if (AuthPass == true && CheckStopAuthentication(RealURI, Message))
          return;
          return;
-   else if (AuthPass == false)
-      _error->Warning(_("The data from '%s' is not signed. Packages "
-                        "from that repository can not be authenticated."),
-                      URIDesc.c_str());
 
 
    // FIXME: meh, this is not really elegant
    // FIXME: meh, this is not really elegant
    string InReleaseURI = RealURI.replace(RealURI.rfind("Release.gpg"), 12,
    string InReleaseURI = RealURI.replace(RealURI.rfind("Release.gpg"), 12,
@@ -1774,6 +1770,10 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/
          return;
          return;
       }
       }
    }
    }
+   else
+      _error->Warning(_("The data from '%s' is not signed. Packages "
+	       "from that repository can not be authenticated."),
+	    URIDesc.c_str());
 
 
    // this ensures that any file in the lists/ dir is removed by the
    // this ensures that any file in the lists/ dir is removed by the
    // transaction
    // transaction

+ 3 - 3
apt-pkg/acquire.cc

@@ -1018,6 +1018,6 @@ void pkgAcquireStatus::Fetched(unsigned long long Size,unsigned long long Resume
 }
 }
 									/*}}}*/
 									/*}}}*/
 
 
-pkgAcquire::UriIterator::~UriIterator() {}
-pkgAcquire::MethodConfig::~MethodConfig() {}
-pkgAcquireStatus::~pkgAcquireStatus() {}
+APT_CONST pkgAcquire::UriIterator::~UriIterator() {}
+APT_CONST pkgAcquire::MethodConfig::~MethodConfig() {}
+APT_CONST pkgAcquireStatus::~pkgAcquireStatus() {}

+ 1 - 1
apt-pkg/clean.cc

@@ -132,4 +132,4 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache)
 }
 }
 									/*}}}*/
 									/*}}}*/
 
 
-pkgArchiveCleaner::~pkgArchiveCleaner() {}
+APT_CONST pkgArchiveCleaner::~pkgArchiveCleaner() {}

+ 1 - 1
apt-pkg/deb/debrecords.cc

@@ -208,4 +208,4 @@ void debRecordParser::GetRec(const char *&Start,const char *&Stop)
 }
 }
 									/*}}}*/
 									/*}}}*/
 
 
-debRecordParser::~debRecordParser() {};
+debRecordParser::~debRecordParser() {}

+ 1 - 1
apt-pkg/indexcopy.cc

@@ -794,4 +794,4 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name,	/*{{{*/
 }
 }
 									/*}}}*/
 									/*}}}*/
 
 
-IndexCopy::~IndexCopy() {}
+APT_CONST IndexCopy::~IndexCopy() {}

+ 1 - 1
test/integration/framework

@@ -851,7 +851,7 @@ setupaptarchive() {
 	else
 	else
 		setupflataptarchive
 		setupflataptarchive
 	fi
 	fi
-	signreleasefiles 'Joe Sixpack' "$@"
+	signreleasefiles 'Joe Sixpack'
 	if [ "1" != "$NOUPDATE" ]; then
 	if [ "1" != "$NOUPDATE" ]; then
 		testsuccess aptget update -o Debug::pkgAcquire::Worker=true -o Debug::Acquire::gpgv=true
 		testsuccess aptget update -o Debug::pkgAcquire::Worker=true -o Debug::Acquire::gpgv=true
 	fi
 	fi

+ 1 - 4
test/integration/test-apt-get-update-unauth-warning

@@ -24,10 +24,7 @@ testequal "Ign file: unstable InRelease
 Err file: unstable Release
 Err file: unstable Release
   File not found
   File not found
 W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository.
 W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository.
-W: Use --allow-insecure-repositories to force the update
-W: Failed to fetch file:$APTARCHIVE/dists/unstable/Release  File not found
-
-E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update
+E: Use --allow-insecure-repositories to force the update" aptget update
 
 
 # no package foo
 # no package foo
 testequal "Listing..." apt list foo
 testequal "Listing..." apt list foo

+ 1 - 1
test/integration/test-apt-update-expected-size

@@ -38,7 +38,7 @@ echo "1234567890" >> aptarchive/dists/unstable/main/binary-i386/Packages.gz
 echo "1234567890" >> aptarchive/dists/unstable/main/binary-i386/Packages
 echo "1234567890" >> aptarchive/dists/unstable/main/binary-i386/Packages
 NEW_SIZE="$(stat --printf=%s aptarchive/dists/unstable/main/binary-i386/Packages)"
 NEW_SIZE="$(stat --printf=%s aptarchive/dists/unstable/main/binary-i386/Packages)"
 rm -f rootdir/var/lib/apt/lists/localhost*
 rm -f rootdir/var/lib/apt/lists/localhost*
-testequal "W: Failed to fetch http://localhost:8080/dists/unstable/main/binary-i386/Packages  Writing more data than expected ($NEW_SIZE > $SIZE) [IP: ::1 8080]
+testequal "W: Failed to fetch http://localhost:8080/dists/unstable/main/binary-i386/Packages  Writing more data than expected ($NEW_SIZE > $SIZE)
 
 
 E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq
 E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq
 
 

+ 2 - 1
test/integration/test-apt-update-ims

@@ -73,7 +73,8 @@ Ign http://localhost:8080 unstable Release.gpg
 Hit http://localhost:8080 unstable/main Sources
 Hit http://localhost:8080 unstable/main Sources
 Hit http://localhost:8080 unstable/main amd64 Packages
 Hit http://localhost:8080 unstable/main amd64 Packages
 Hit http://localhost:8080 unstable/main Translation-en
 Hit http://localhost:8080 unstable/main Translation-en
-Reading package lists..."
+Reading package lists...
+W: The data from 'http://localhost:8080 unstable Release.gpg' is not signed. Packages from that repository can not be authenticated."
 
 
 find aptarchive -name "Release.gpg" | xargs rm -f
 find aptarchive -name "Release.gpg" | xargs rm -f
 
 

+ 1 - 1
test/integration/test-apt-update-rollback

@@ -136,7 +136,7 @@ test_inrelease_to_unauth_inrelease() {
     msgmsg 'Test InRelease to InRelease without good sig'
     msgmsg 'Test InRelease to InRelease without good sig'
     start_with_good_inrelease
     start_with_good_inrelease
 
 
-    signreleasefiles 'Marvin Paranoid' '+1hour'
+    signreleasefiles 'Marvin Paranoid'
 
 
     testequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E8525D47528144E2
     testequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E8525D47528144E2
 
 

+ 27 - 0
test/integration/test-sourceslist-trusted-options

@@ -166,3 +166,30 @@ insecureaptgetupdate
 everythingfails
 everythingfails
 everythingfails -t stable
 everythingfails -t stable
 everythingfails -t testing
 everythingfails -t testing
+
+# same as the one further above, but this time testing is unsigned
+find aptarchive/ \( -name 'InRelease' -o -name 'Release.gpg' \) -delete
+signreleasefiles 'Joe Sixpack' 'aptarchive/dists/stable'
+
+msgmsg 'Test without trusted option and unsigned and good sources'
+cp -a rootdir/etc/apt/sources.list.d.bak/* rootdir/etc/apt/sources.list.d/
+insecureaptgetupdate
+everythingfails
+everythingsucceeds -t stable
+everythingfails -t testing
+
+msgmsg 'Test with trusted=yes option and unsigned and good sources'
+cp -a rootdir/etc/apt/sources.list.d.bak/* rootdir/etc/apt/sources.list.d/
+sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir/etc/apt/sources.list.d/*
+aptgetupdate
+everythingsucceeds
+everythingsucceeds -t stable
+everythingsucceeds -t testing
+
+msgmsg 'Test with trusted=no option and unsigned and good sources'
+cp -a rootdir/etc/apt/sources.list.d.bak/* rootdir/etc/apt/sources.list.d/
+sed -i 's#^deb\(-src\)\? #deb\1 [trusted=no] #' rootdir/etc/apt/sources.list.d/*
+insecureaptgetupdate
+everythingfails
+everythingfails -t stable
+everythingfails -t testing