Commit 710d8025 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-site: use https for packages.altlinux.org

parent c310597d
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2015 Etersoft # Copyright (C) 2015,2016 Etersoft
# Copyright (C) 2015 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2015,2016 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
load_helper epm-query load_helper epm-query
load_helper epm-print load_helper epm-print
PAOURL="https://packages.altlinux.org"
run_command_if_exists() run_command_if_exists()
{ {
local CMD="$1" local CMD="$1"
...@@ -41,12 +43,13 @@ open_browser() ...@@ -41,12 +43,13 @@ open_browser()
__query_package_hl_url() __query_package_hl_url()
{ {
local PAOAPI="$PAOURL/api"
case $DISTRNAME in case $DISTRNAME in
ALTLinux) ALTLinux)
# http://petstore.swagger.io/?url=http://packages.altlinux.org/api/docs # http://petstore.swagger.io/?url=http://packages.altlinux.org/api/docs
epm assure curl || return 1 epm assure curl || return 1
showcmd curl "http://packages.altlinux.org/api/srpms/$1" showcmd curl "$PAOAPI/srpms/$1"
curl -s --header "Accept: application/json" "http://packages.altlinux.org/api/srpms/$1" | grep '"url"' | sed -e 's|.*"url":"||g' | sed -e 's|".*||g' curl -s --header "Accept: application/json" "$PAOAPI/srpms/$1" | grep '"url"' | sed -e 's|.*"url":"||g' | sed -e 's|".*||g'
return 0 return 0
;; ;;
esac esac
...@@ -87,7 +90,7 @@ get_pao_url() ...@@ -87,7 +90,7 @@ get_pao_url()
*) *)
loc=en loc=en
esac esac
echo "http://packages.altlinux.org/$loc/Sisyphus/srpms" echo "$PAOURL/$loc/Sisyphus/srpms"
} }
query_altlinux_url() query_altlinux_url()
...@@ -109,7 +112,7 @@ epm_site() ...@@ -109,7 +112,7 @@ epm_site()
[ -n "$pkg_filenames" ] || fatal "Info: missing package(s) name" [ -n "$pkg_filenames" ] || fatal "Info: missing package(s) name"
PAO= local PAO=""
for f in $pkg_names $pkg_files ; do for f in $pkg_names $pkg_files ; do
[ "$f" = "-p" ] && PAO="$f" && continue [ "$f" = "-p" ] && PAO="$f" && continue
if [ -n "$PAO" ] ; then if [ -n "$PAO" ] ; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment