Browse Source

Switch to 'http' as the default https method

The old curl based method is still available as 'curl',
'curl+http', and 'curl+https'.
tags/debian/1.5_alpha4
Julian Andres Klode 3 years ago
parent
commit
c6a428e4d1
11 changed files with 39 additions and 15 deletions
  1. +1
    -1
      .travis.yml
  2. +1
    -0
      CMakeLists.txt
  3. +9
    -0
      debian/NEWS
  4. +3
    -1
      debian/apt-transport-https.install
  5. +9
    -4
      debian/control
  6. +1
    -1
      debian/rules
  7. +12
    -5
      methods/CMakeLists.txt
  8. +1
    -1
      methods/curl.cc
  9. +0
    -0
      methods/curl.h
  10. +1
    -1
      po/CMakeLists.txt
  11. +1
    -1
      test/integration/test-apt-update-failure-propagation

+ 1
- 1
.travis.yml View File

@@ -5,8 +5,8 @@ services:
- docker
env:
- USER=travis CMAKE_FLAGS=
- USER=travis CMAKE_FLAGS="-DWITH_DOC=OFF -DWITH_CURL=OFF"
- USER=root CMAKE_FLAGS=-DWITH_DOC=OFF
- USER=travis CMAKE_FLAGS="-DWITH_DOC=OFF -DFORCE_CURL=ON"
install:
- sed -i -e "s#1000#$(id -u)#g" Dockerfile
- docker build --tag=apt-ci .


+ 1
- 0
CMakeLists.txt View File

@@ -79,6 +79,7 @@ endif()
# apt-transport-https dependencies
option(WITH_CURL "Build curl-based methods" ON)
if (WITH_CURL)
option(FORCE_CURL "Use curl-based methods" OFF)
find_package(CURL REQUIRED)
if (CURL_FOUND)
set(HAVE_CURL 1)


+ 9
- 0
debian/NEWS View File

@@ -1,3 +1,12 @@
apt (1.5~alpha4) UNRELEASED; urgency=medium

The apt package now installs the http method for https access, the
apt-transport-https package is deprecated, and installs a curl method
now that can be used as a fallback with curl+https URLs, or by setting
Dir::Bin::Methods::https to "curl".

-- Julian Andres Klode <jak@debian.org> Fri, 30 Jun 2017 15:26:44 +0200

apt (1.5~alpha1) experimental; urgency=medium

[ Changes to unauthenticated repositories ]


+ 3
- 1
debian/apt-transport-https.install View File

@@ -1 +1,3 @@
usr/lib/apt/methods/https
usr/lib/apt/methods/curl
usr/lib/apt/methods/curl+http
usr/lib/apt/methods/curl+https

+ 9
- 4
debian/control View File

@@ -36,8 +36,9 @@ Depends: adduser,
${apt:keyring},
${misc:Depends},
${shlibs:Depends}
Replaces: apt-utils (<< 1.3~exp2~)
Breaks: apt-utils (<< 1.3~exp2~)
Replaces: apt-utils (<< 1.3~exp2~), apt-transport-https (<< 1.5~alpha4~)
Breaks: apt-utils (<< 1.3~exp2~), apt-transport-https (<< 1.5~alpha4~)
Provides: apt-transport-https (= ${binary:Version})
Recommends: ca-certificates
Suggests: apt-doc,
aptitude | synaptic | wajig,
@@ -148,10 +149,10 @@ Description: package management related utility programs

Package: apt-transport-https
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Depends: ${misc:Depends}, ${shlibs:Depends}, apt (>= 1.5~alpha4~)
Recommends: ca-certificates
Priority: optional
Description: https download transport for APT
Description: Transitional package: curl-https download transport for APT
This package enables the usage of 'deb https://foo distro main' lines
in the /etc/apt/sources.list so that all package managers using the
libapt-pkg library can access metadata and packages available in sources
@@ -159,3 +160,7 @@ Description: https download transport for APT
.
This transport supports server as well as client authentication
with certificates.
.
This package is no longer needed, https support was integrated into apt,
and is only provided as a fallback if some bugs are found in apt's native
https support.

+ 1
- 1
debian/rules View File

@@ -22,7 +22,7 @@ override_dh_install-indep:

override_dh_install-arch:
dh_install -papt-utils -X/dump
dh_install -papt -Xmethods/https
dh_install -papt -Xmethods/curl -Xmethods/curl+https -Xmethods/curl+http
dh_install --remaining --list-missing
install -m 644 debian/apt.conf.autoremove debian/apt/etc/apt/apt.conf.d/01autoremove
install -m 755 debian/apt.auto-removal.sh debian/apt/etc/kernel/postinst.d/apt-auto-removal


+ 12
- 5
methods/CMakeLists.txt View File

@@ -7,7 +7,7 @@ add_executable(cdrom cdrom.cc)
add_executable(http http.cc http_main.cc rfc2553emu.cc connect.cc basehttp.cc)
add_executable(mirror mirror.cc http.cc rfc2553emu.cc connect.cc basehttp.cc)
if (HAVE_CURL)
add_executable(https https.cc basehttp.cc)
add_executable(curl curl.cc basehttp.cc)
endif()
add_executable(ftp ftp.cc rfc2553emu.cc connect.cc)
add_executable(rred rred.cc)
@@ -16,7 +16,7 @@ add_executable(rsh rsh.cc)
target_compile_definitions(http PRIVATE ${GNUTLS_DEFINITIONS})
target_include_directories(http PRIVATE ${GNUTLS_INCLUDE_DIR})
if (HAVE_CURL)
target_include_directories(https PRIVATE ${CURL_INCLUDE_DIRS})
target_include_directories(curl PRIVATE ${CURL_INCLUDE_DIRS})
endif()

# Link the executables against the libraries
@@ -28,7 +28,7 @@ target_link_libraries(cdrom apt-pkg)
target_link_libraries(http apt-pkg ${GNUTLS_LIBRARIES})
target_link_libraries(mirror apt-pkg ${RESOLV_LIBRARIES} ${GNUTLS_LIBRARIES})
if (HAVE_CURL)
target_link_libraries(https apt-pkg ${CURL_LIBRARIES})
target_link_libraries(curl apt-pkg ${CURL_LIBRARIES})
endif()
target_link_libraries(ftp apt-pkg ${GNUTLS_LIBRARIES})
target_link_libraries(rred apt-pkg)
@@ -40,8 +40,15 @@ install(TARGETS file copy store gpgv cdrom http ftp rred rsh mirror

add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods store gzip lzma bzip2 xz)
add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods rsh ssh)
if (HAVE_CURL)
install(TARGETS https RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/methods)

set(curl_slaves curl+https curl+http)

if (FORCE_CURL)
set(curl_slaves ${curl_slaves} https)
else()
add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods http https)
endif()
if (HAVE_CURL)
install(TARGETS curl RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/methods)
add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods curl ${curl_slaves})
endif()

methods/https.cc → methods/curl.cc View File

@@ -33,7 +33,7 @@
#include <sstream>


#include "https.h"
#include "curl.h"

#include <apti18n.h>
/*}}}*/

methods/https.h → methods/curl.h View File


+ 1
- 1
po/CMakeLists.txt View File

@@ -11,7 +11,7 @@ apt_add_translation_domain(
)

if (HAVE_CURL)
set(curl_methods https)
set(curl_methods curl)
else()
set(curl_methods)
endif()


+ 1
- 1
test/integration/test-apt-update-failure-propagation View File

@@ -100,7 +100,7 @@ for FILE in rootdir/etc/apt/sources.list.d/*-stable-* ; do
sed -i -e "s#:${APTHTTPSPORT}/#:666/#" "$FILE"
done
testwarning aptget update -o Dir::Bin::Methods::https="${OLDMETHODS}/https"
if grep -q WITH_CURL:BOOL=OFF $PROJECT_BINARY_DIR/CMakeCache.txt; then
if grep -q FORCE_CURL:BOOL=OFF $PROJECT_BINARY_DIR/CMakeCache.txt; then
testequalor2 "W: Failed to fetch https://localhost:666/dists/stable/InRelease Failed to connect to localhost port 666: Connection refused
W: Some index files failed to download. They have been ignored, or old ones used instead." "W: Failed to fetch https://localhost:666/dists/stable/InRelease Could not connect to localhost:666 (127.0.0.1). - connect (111: Connection refused)
W: Some index files failed to download. They have been ignored, or old ones used instead." tail -n 2 rootdir/tmp/testwarning.output


Loading…
Cancel
Save