working commit

This commit is contained in:
2026-02-17 19:24:29 +02:00
parent b76ea1a9ac
commit 8739f2feb7
18 changed files with 1702 additions and 756 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
FROM alpine:3.20 as builder FROM alpine:3.20 AS builder
RUN apk --no-cache add make binutils gcc libc-dev automake autoconf curl RUN apk --no-cache add make binutils gcc libc-dev automake autoconf curl
RUN curl -o /usr/local/lib/go.tar.gz https://dl.google.com/go/go1.25.5.linux-amd64.tar.gz RUN curl -o /usr/local/lib/go.tar.gz https://dl.google.com/go/go1.25.5.linux-amd64.tar.gz
@@ -14,7 +14,8 @@ RUN make all install
RUN make clean RUN make clean
RUN rm -rf /app/src RUN rm -rf /app/src
FROM alpine:3.20 FROM alpine:3.20 AS runner
COPY --from=builder /app /app COPY --from=builder /app /app
RUN chmod 1777 /var RUN chmod 1777 /var
WORKDIR /app WORKDIR /app
-3
View File
@@ -1,6 +1,5 @@
AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo
GOFLAGS= -v GOFLAGS= -v
bin_PROGRAMS = mstorectl bin_PROGRAMS = mstorectl
sbin_PROGRAMS = mstored sbin_PROGRAMS = mstored
@@ -189,8 +188,6 @@ IMAGE_NAME = $(PACKAGE_NAME):$(PACKAGE_VERSION)
IMAGE_TARNAME = $(PACKAGE_NAME)-$(PACKAGE_VERSION).img IMAGE_TARNAME = $(PACKAGE_NAME)-$(PACKAGE_VERSION).img
IMAGE_CONTAINERFILE = Containerfile IMAGE_CONTAINERFILE = Containerfile
image:: build-image image:: build-image
build-image: clean build-image: clean
$(GO) mod vendor $(GO) mod vendor
+28 -15
View File
@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.16.5 from Makefile.am. # Makefile.in generated by automake 1.17 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc. # Copyright (C) 1994-2024 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -70,6 +70,8 @@ am__make_running_with_option = \
test $$has_opt = yes test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
am__rm_f = rm -f $(am__rm_f_notfound)
am__rm_rf = rm -rf $(am__rm_f_notfound)
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
@@ -180,20 +182,22 @@ distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir) top_distdir = $(distdir)
am__remove_distdir = \ am__remove_distdir = \
if test -d "$(distdir)"; then \ if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ find "$(distdir)" -type d ! -perm -700 -exec chmod u+rwx {} ';' \
&& rm -rf "$(distdir)" \ ; rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \ || { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi else :; fi
am__post_remove_distdir = $(am__remove_distdir) am__post_remove_distdir = $(am__remove_distdir)
DIST_ARCHIVES = $(distdir).tar.gz DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best GZIP_ENV = -9
DIST_TARGETS = dist-gzip DIST_TARGETS = dist-gzip
# Exists only to be overridden by the user if desired. # Exists only to be overridden by the user if desired.
AM_DISTCHECK_DVI_TARGET = dvi AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print distcleancheck_listfiles = \
find . \( -type f -a \! \
\( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print
ACLOCAL = @ACLOCAL@ ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@ AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -251,8 +255,10 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@ abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@ abs_top_srcdir = @abs_top_srcdir@
am__leading_dot = @am__leading_dot@ am__leading_dot = @am__leading_dot@
am__rm_f_notfound = @am__rm_f_notfound@
am__tar = @am__tar@ am__tar = @am__tar@
am__untar = @am__untar@ am__untar = @am__untar@
am__xargs_n = @am__xargs_n@
bindir = @bindir@ bindir = @bindir@
build = @build@ build = @build@
build_alias = @build_alias@ build_alias = @build_alias@
@@ -556,10 +562,10 @@ uninstall-binPROGRAMS:
`; \ `; \
test -n "$$list" || exit 0; \ test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files cd "$(DESTDIR)$(bindir)" && $(am__rm_f) $$files
clean-binPROGRAMS: clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -$(am__rm_f) $(bin_PROGRAMS)
install-sbinPROGRAMS: $(sbin_PROGRAMS) install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
@@ -598,10 +604,10 @@ uninstall-sbinPROGRAMS:
`; \ `; \
test -n "$$list" || exit 0; \ test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(sbindir)" && rm -f $$files cd "$(DESTDIR)$(sbindir)" && $(am__rm_f) $$files
clean-sbinPROGRAMS: clean-sbinPROGRAMS:
-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) -$(am__rm_f) $(sbin_PROGRAMS)
mostlyclean-compile: mostlyclean-compile:
-rm -f *.$(OBJEXT) -rm -f *.$(OBJEXT)
@@ -672,7 +678,7 @@ distdir: $(BUILT_SOURCES)
distdir-am: $(DISTFILES) distdir-am: $(DISTFILES)
$(am__remove_distdir) $(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)" $(AM_V_at)$(MKDIR_P) "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \ list='$(DISTFILES)'; \
@@ -758,7 +764,7 @@ dist dist-all:
distcheck: dist distcheck: dist
case '$(DIST_ARCHIVES)' in \ case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \ *.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \ *.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \ *.tar.lz*) \
@@ -768,7 +774,7 @@ distcheck: dist
*.tar.Z*) \ *.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \ *.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \ *.zip*) \
unzip $(distdir).zip ;;\ unzip $(distdir).zip ;;\
*.tar.zst*) \ *.tar.zst*) \
@@ -870,8 +876,8 @@ mostlyclean-generic:
clean-generic: clean-generic:
distclean-generic: distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -$(am__rm_f) $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@@ -1046,3 +1052,10 @@ distclean-local:
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT: .NOEXPORT:
# Tell GNU make to disable its built-in pattern rules.
%:: %,v
%:: RCS/%,v
%:: RCS/%
%:: s.%
%:: SCCS/s.%
Vendored
+281 -124
View File
@@ -1,6 +1,6 @@
# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # generated automatically by aclocal 1.17 -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Copyright (C) 1996-2024 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -14,13 +14,13 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION], m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],,
[m4_warning([this file was generated for autoconf 2.71. [m4_warning([this file was generated for autoconf 2.72.
You have another version of autoconf. It may work, but is not guaranteed to. You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely. If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])]) To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2021 Free Software Foundation, Inc. # Copyright (C) 2002-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y. # generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.) # (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION], AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16' [am__api_version='1.17'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro. dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.16.5], [], m4_if([$1], [1.17], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
]) ])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.16.5])dnl [AM_AUTOMAKE_VERSION([1.17])dnl
m4_ifndef([AC_AUTOCONF_VERSION], m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*- # AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc. # Copyright (C) 2001-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*- # AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2021 Free Software Foundation, Inc. # Copyright (C) 1997-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -143,7 +143,7 @@ fi])])
# Do all the work for Automake. -*- Autoconf -*- # Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Copyright (C) 1996-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -277,7 +277,7 @@ if test -z "$CSCOPE"; then
fi fi
AC_SUBST([CSCOPE]) AC_SUBST([CSCOPE])
AC_REQUIRE([AM_SILENT_RULES])dnl AC_REQUIRE([_AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
@@ -285,47 +285,9 @@ AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT], [m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
# POSIX will say in a future version that running "rm -f" with no argument AC_REQUIRE([_AM_PROG_RM_F])
# is OK; and we want to be able to make that assumption in our Makefile AC_REQUIRE([_AM_PROG_XARGS_N])
# recipes. So use an aggressive probe to check that the usage we want is
# actually supported "in the wild" to an acceptable degree.
# See automake bug#10828.
# To make any issue more visible, cause the running configure to be aborted
# by default if the 'rm' program in use doesn't match our expectations; the
# user can still override this though.
if rm -f && rm -fr && rm -rf; then : OK; else
cat >&2 <<'END'
Oops!
Your 'rm' program seems unable to run without file operands specified
on the command line, even when the '-f' option is present. This is contrary
to the behaviour of most rm programs out there, and not conforming with
the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
Please tell bug-automake@gnu.org about your system, including the value
of your $PATH and any error possibly output before this message. This
can help us improve future automake versions.
END
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
echo 'Configuration will proceed anyway, since you have set the' >&2
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
echo >&2
else
cat >&2 <<'END'
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
fi
dnl The trailing newline in this macro's definition is deliberate, for dnl The trailing newline in this macro's definition is deliberate, for
dnl backward compatibility and to allow trailing 'dnl'-style comments dnl backward compatibility and to allow trailing 'dnl'-style comments
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
@@ -358,7 +320,7 @@ for _am_header in $config_headers :; do
done done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2021 Free Software Foundation, Inc. # Copyright (C) 2001-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -379,7 +341,7 @@ if test x"${install_sh+set}" != xset; then
fi fi
AC_SUBST([install_sh])]) AC_SUBST([install_sh])])
# Copyright (C) 2003-2021 Free Software Foundation, Inc. # Copyright (C) 2003-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -400,7 +362,7 @@ AC_SUBST([am__leading_dot])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2021 Free Software Foundation, Inc. # Copyright (C) 1997-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -434,7 +396,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*- # Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc. # Copyright (C) 2001-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -463,7 +425,23 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION], AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 2001-2021 Free Software Foundation, Inc. # Copyright (C) 2022-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_PROG_RM_F
# ---------------
# Check whether 'rm -f' without any arguments works.
# https://bugs.gnu.org/10828
AC_DEFUN([_AM_PROG_RM_F],
[am__rm_f_notfound=
AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""'])
AC_SUBST(am__rm_f_notfound)
])
# Copyright (C) 2001-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -482,16 +460,169 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*- # Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Copyright (C) 1996-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# _AM_SLEEP_FRACTIONAL_SECONDS
# ----------------------------
AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl
AC_CACHE_CHECK([whether sleep supports fractional seconds],
am_cv_sleep_fractional_seconds, [dnl
AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes],
[am_cv_sleep_fractional_seconds=no])
])])
# _AM_FILESYSTEM_TIMESTAMP_RESOLUTION
# -----------------------------------
# Determine the filesystem's resolution for file modification
# timestamps. The coarsest we know of is FAT, with a resolution
# of only two seconds, even with the most recent "exFAT" extensions.
# The finest (e.g. ext4 with large inodes, XFS, ZFS) is one
# nanosecond, matching clock_gettime. However, it is probably not
# possible to delay execution of a shell script for less than one
# millisecond, due to process creation overhead and scheduling
# granularity, so we don't check for anything finer than that. (See below.)
AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl
AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS])
AC_CACHE_CHECK([filesystem timestamp resolution],
am_cv_filesystem_timestamp_resolution, [dnl
# Default to the worst case.
am_cv_filesystem_timestamp_resolution=2
# Only try to go finer than 1 sec if sleep can do it.
# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work,
# - 1 sec is not much of a win compared to 2 sec, and
# - it takes 2 seconds to perform the test whether 1 sec works.
#
# Instead, just use the default 2s on platforms that have 1s resolution,
# accept the extra 1s delay when using $sleep in the Automake tests, in
# exchange for not incurring the 2s delay for running the test for all
# packages.
#
am_try_resolutions=
if test "$am_cv_sleep_fractional_seconds" = yes; then
# Even a millisecond often causes a bunch of false positives,
# so just try a hundredth of a second. The time saved between .001 and
# .01 is not terribly consequential.
am_try_resolutions="0.01 0.1 $am_try_resolutions"
fi
# In order to catch current-generation FAT out, we must *modify* files
# that already exist; the *creation* timestamp is finer. Use names
# that make ls -t sort them differently when they have equal
# timestamps than when they have distinct timestamps, keeping
# in mind that ls -t prints the *newest* file first.
rm -f conftest.ts?
: > conftest.ts1
: > conftest.ts2
: > conftest.ts3
# Make sure ls -t actually works. Do 'set' in a subshell so we don't
# clobber the current shell's arguments. (Outer-level square brackets
# are removed by m4; they're present so that m4 does not expand
# <dollar><star>; be careful, easy to get confused.)
if (
set X `[ls -t conftest.ts[12]]` &&
{
test "$[]*" != "X conftest.ts1 conftest.ts2" ||
test "$[]*" != "X conftest.ts2 conftest.ts1";
}
); then :; else
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
_AS_ECHO_UNQUOTED(
["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""],
[AS_MESSAGE_LOG_FD])
AC_MSG_FAILURE([ls -t produces unexpected output.
Make sure there is not a broken ls alias in your environment.])
fi
for am_try_res in $am_try_resolutions; do
# Any one fine-grained sleep might happen to cross the boundary
# between two values of a coarser actual resolution, but if we do
# two fine-grained sleeps in a row, at least one of them will fall
# entirely within a coarse interval.
echo alpha > conftest.ts1
sleep $am_try_res
echo beta > conftest.ts2
sleep $am_try_res
echo gamma > conftest.ts3
# We assume that 'ls -t' will make use of high-resolution
# timestamps if the operating system supports them at all.
if (set X `ls -t conftest.ts?` &&
test "$[]2" = conftest.ts3 &&
test "$[]3" = conftest.ts2 &&
test "$[]4" = conftest.ts1); then
#
# Ok, ls -t worked. If we're at a resolution of 1 second, we're done,
# because we don't need to test make.
make_ok=true
if test $am_try_res != 1; then
# But if we've succeeded so far with a subsecond resolution, we
# have one more thing to check: make. It can happen that
# everything else supports the subsecond mtimes, but make doesn't;
# notably on macOS, which ships make 3.81 from 2006 (the last one
# released under GPLv2). https://bugs.gnu.org/68808
#
# We test $MAKE if it is defined in the environment, else "make".
# It might get overridden later, but our hope is that in practice
# it does not matter: it is the system "make" which is (by far)
# the most likely to be broken, whereas if the user overrides it,
# probably they did so with a better, or at least not worse, make.
# https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html
#
# Create a Makefile (real tab character here):
rm -f conftest.mk
echo 'conftest.ts1: conftest.ts2' >conftest.mk
echo ' touch conftest.ts2' >>conftest.mk
#
# Now, running
# touch conftest.ts1; touch conftest.ts2; make
# should touch ts1 because ts2 is newer. This could happen by luck,
# but most often, it will fail if make's support is insufficient. So
# test for several consecutive successes.
#
# (We reuse conftest.ts[12] because we still want to modify existing
# files, not create new ones, per above.)
n=0
make=${MAKE-make}
until test $n -eq 3; do
echo one > conftest.ts1
sleep $am_try_res
echo two > conftest.ts2 # ts2 should now be newer than ts1
if $make -f conftest.mk | grep 'up to date' >/dev/null; then
make_ok=false
break # out of $n loop
fi
n=`expr $n + 1`
done
fi
#
if $make_ok; then
# Everything we know to check worked out, so call this resolution good.
am_cv_filesystem_timestamp_resolution=$am_try_res
break # out of $am_try_res loop
fi
# Otherwise, we'll go on to check the next resolution.
fi
done
rm -f conftest.ts?
# (end _am_filesystem_timestamp_resolution)
])])
# AM_SANITY_CHECK # AM_SANITY_CHECK
# --------------- # ---------------
AC_DEFUN([AM_SANITY_CHECK], AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane]) [AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION])
# This check should not be cached, as it may vary across builds of
# different projects.
AC_MSG_CHECKING([whether build environment is sane])
# Reject unsafe characters in $srcdir or the absolute working directory # Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter. # name. Accept space and tab only in the latter.
am_lf=' am_lf='
@@ -510,49 +641,40 @@ esac
# symlink; some systems play weird games with the mod time of symlinks # symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing # (eg FreeBSD returns the mod time of the symlink's containing
# directory). # directory).
if ( am_build_env_is_sane=no
am_has_slept=no am_has_slept=no
for am_try in 1 2; do rm -f conftest.file
echo "timestamp, slept: $am_has_slept" > conftest.file for am_try in 1 2; do
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` echo "timestamp, slept: $am_has_slept" > conftest.file
if test "$[*]" = "X"; then if (
# -L didn't work. set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
set X `ls -t "$srcdir/configure" conftest.file` if test "$[]*" = "X"; then
fi # -L didn't work.
if test "$[*]" != "X $srcdir/configure conftest.file" \ set X `ls -t "$srcdir/configure" conftest.file`
&& test "$[*]" != "X conftest.file $srcdir/configure"; then fi
test "$[]2" = conftest.file
); then
am_build_env_is_sane=yes
break
fi
# Just in case.
sleep "$am_cv_filesystem_timestamp_resolution"
am_has_slept=yes
done
# If neither matched, then we have a broken ls. This can happen AC_MSG_RESULT([$am_build_env_is_sane])
# if, for instance, CONFIG_SHELL is bash and it inherits a if test "$am_build_env_is_sane" = no; then
# broken ls alias from the environment. This has actually AC_MSG_ERROR([newly created file is older than distributed files!
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
if test "$[2]" = conftest.file || test $am_try -eq 2; then
break
fi
# Just in case.
sleep 1
am_has_slept=yes
done
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock]) Check your system clock])
fi fi
AC_MSG_RESULT([yes])
# If we didn't sleep, we still need to ensure time stamps of config.status and # If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer. # generated files are strictly newer.
am_sleep_pid= am_sleep_pid=
if grep 'slept: no' conftest.file >/dev/null 2>&1; then AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl
( sleep 1 ) & ( sleep "$am_cv_filesystem_timestamp_resolution" ) &
am_sleep_pid=$! am_sleep_pid=$!
fi ])
AC_CONFIG_COMMANDS_PRE( AC_CONFIG_COMMANDS_PRE(
[AC_MSG_CHECKING([that generated files are newer than configure]) [AC_MSG_CHECKING([that generated files are newer than configure])
if test -n "$am_sleep_pid"; then if test -n "$am_sleep_pid"; then
@@ -563,18 +685,18 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file rm -f conftest.file
]) ])
# Copyright (C) 2009-2021 Free Software Foundation, Inc. # Copyright (C) 2009-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# AM_SILENT_RULES([DEFAULT]) # _AM_SILENT_RULES
# -------------------------- # ----------------
# Enable less verbose build rules; with the default set to DEFAULT # Enable less verbose build rules support.
# ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([_AM_SILENT_RULES],
AC_DEFUN([AM_SILENT_RULES], [AM_DEFAULT_VERBOSITY=1
[AC_ARG_ENABLE([silent-rules], [dnl AC_ARG_ENABLE([silent-rules], [dnl
AS_HELP_STRING( AS_HELP_STRING(
[--enable-silent-rules], [--enable-silent-rules],
[less verbose build output (undo: "make V=1")]) [less verbose build output (undo: "make V=1")])
@@ -582,11 +704,6 @@ AS_HELP_STRING(
[--disable-silent-rules], [--disable-silent-rules],
[verbose build output (undo: "make V=0")])dnl [verbose build output (undo: "make V=0")])dnl
]) ])
case $enable_silent_rules in @%:@ (((
yes) AM_DEFAULT_VERBOSITY=0;;
no) AM_DEFAULT_VERBOSITY=1;;
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
esac
dnl dnl
dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
dnl do not support nested variable expansions. dnl do not support nested variable expansions.
@@ -605,14 +722,6 @@ am__doit:
else else
am_cv_make_support_nested_variables=no am_cv_make_support_nested_variables=no
fi]) fi])
if test $am_cv_make_support_nested_variables = yes; then
dnl Using '$V' instead of '$(V)' breaks IRIX make.
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
AM_V=$AM_DEFAULT_VERBOSITY
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
AC_SUBST([AM_V])dnl AC_SUBST([AM_V])dnl
AM_SUBST_NOTMAKE([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl
AC_SUBST([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_V])dnl
@@ -621,9 +730,33 @@ AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
AM_BACKSLASH='\' AM_BACKSLASH='\'
AC_SUBST([AM_BACKSLASH])dnl AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls
dnl to AM_SILENT_RULES to change the default value.
AC_CONFIG_COMMANDS_PRE([dnl
case $enable_silent_rules in @%:@ (((
yes) AM_DEFAULT_VERBOSITY=0;;
no) AM_DEFAULT_VERBOSITY=1;;
esac
if test $am_cv_make_support_nested_variables = yes; then
dnl Using '$V' instead of '$(V)' breaks IRIX make.
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
AM_V=$AM_DEFAULT_VERBOSITY
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
])dnl
]) ])
# Copyright (C) 2001-2021 Free Software Foundation, Inc. # AM_SILENT_RULES([DEFAULT])
# --------------------------
# Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or
# empty being verbose).
AC_DEFUN([AM_SILENT_RULES],
[AC_REQUIRE([_AM_SILENT_RULES])
AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])])
# Copyright (C) 2001-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -651,7 +784,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2021 Free Software Foundation, Inc. # Copyright (C) 2006-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -670,7 +803,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*- # Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2021 Free Software Foundation, Inc. # Copyright (C) 2004-2024 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@@ -716,15 +849,19 @@ m4_if([$1], [v7],
am_uid=`id -u || echo unknown` am_uid=`id -u || echo unknown`
am_gid=`id -g || echo unknown` am_gid=`id -g || echo unknown`
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
if test $am_uid -le $am_max_uid; then if test x$am_uid = xunknown; then
AC_MSG_RESULT([yes]) AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work])
elif test $am_uid -le $am_max_uid; then
AC_MSG_RESULT([yes])
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
_am_tools=none _am_tools=none
fi fi
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
if test $am_gid -le $am_max_gid; then if test x$gm_gid = xunknown; then
AC_MSG_RESULT([yes]) AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work])
elif test $am_gid -le $am_max_gid; then
AC_MSG_RESULT([yes])
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
_am_tools=none _am_tools=none
@@ -801,3 +938,23 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar]) AC_SUBST([am__untar])
]) # _AM_PROG_TAR ]) # _AM_PROG_TAR
# Copyright (C) 2022-2024 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_PROG_XARGS_N
# ----------------
# Check whether 'xargs -n' works. It should work everywhere, so the fallback
# is not optimized at all as we never expect to use it.
AC_DEFUN([_AM_PROG_XARGS_N],
[AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl
AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2
3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])])
AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl
am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }'
])dnl
AC_SUBST(am__xargs_n)
])
+30 -19
View File
@@ -29,12 +29,12 @@ func (hand *Handler) AuthMiddleware(next router.Handler) router.Handler {
var handlerFunc router.HandlerFunc var handlerFunc router.HandlerFunc
handlerFunc = func(rctx *router.Context) { handlerFunc = func(rctx *router.Context) {
hand.logg.Debugf("Call authorization middleware") //hand.logg.Debugf("Call authorization middleware")
success, accountID, err := hand.CheckAccess(rctx) success, accountID, err := hand.CheckAccess(rctx)
if success { if success {
rctx.SetBool(authTag, true) rctx.SetBool(authTag, true)
rctx.SetString(userTag, accountID) rctx.SetString(userTag, accountID)
hand.logg.Debugf("Authorization for accountID [%s]", rctx.Strings[userTag]) //hand.logg.Debugf("Authorization for accountID [%s]", rctx.Strings[userTag])
} }
if err != nil { if err != nil {
hand.logg.Errorf("Authorization middleware error: %v", err) hand.logg.Errorf("Authorization middleware error: %v", err)
@@ -45,6 +45,7 @@ func (hand *Handler) AuthMiddleware(next router.Handler) router.Handler {
return handlerFunc return handlerFunc
} }
// Authentification
func (hand *Handler) CheckAccess(rctx *router.Context) (bool, string, error) { func (hand *Handler) CheckAccess(rctx *router.Context) (bool, string, error) {
var err error var err error
var success bool var success bool
@@ -56,12 +57,15 @@ func (hand *Handler) CheckAccess(rctx *router.Context) (bool, string, error) {
authHeader := rctx.GetHeader("Authorization") authHeader := rctx.GetHeader("Authorization")
if authHeader != "" { if authHeader != "" {
hand.logg.Debugf("Authorization header is %s", authHeader) //hand.logg.Debugf("Authorization header is %s", authHeader)
username, password, err = auxhttp.ParseBasicAuth(authHeader) username, password, err = auxhttp.ParseBasicAuth(authHeader)
if err != nil { if err != nil {
return success, accountID, err return success, accountID, err
} }
hand.logg.Debugf("Authorization pair is %s:%s", username, password) //hand.logg.Debugf("Authorization pair is %s:%s", username, password)
if username == "" || password == "" {
goto anonymous
}
success, id, err := hand.ValidatePassword(rctx.Ctx, username, password) success, id, err := hand.ValidatePassword(rctx.Ctx, username, password)
if err != nil { if err != nil {
@@ -74,6 +78,7 @@ func (hand *Handler) CheckAccess(rctx *router.Context) (bool, string, error) {
accountID = id accountID = id
return success, accountID, err return success, accountID, err
} }
anonymous:
success = true success = true
accountID = descr.AnonymousID accountID = descr.AnonymousID
return success, accountID, err return success, accountID, err
@@ -99,38 +104,44 @@ func (hand *Handler) ValidatePassword(ctx context.Context, username, password st
return valid, accountID, err return valid, accountID, err
} }
func (hand *Handler) CheckRight(ctx context.Context, accountID, right, subject string) (bool, error) { // Authorization
func (hand *Handler) CheckRight(ctx context.Context, accountID, reqRight, subject string) (bool, error) {
var err error var err error
var res bool var res bool
hand.logg.Debugf("Cop check your right %s: %s %s", accountID, right, subject) //hand.logg.Debugf("Cop check your right %s: %s %s", accountID, reqRight, subject)
// =[]= // =[]=
// .------. // .------. ---
// .---[-] [#] \--, // .---[-] [#] \--, ---
// >| [ ] [ ] | // >| [ ] [ ] | ---...
// '--0-------0----' // '--0-------0----'
// Bad news for you, baby.... # // Bad news for you, baby.... #
// //
exists, grant, err := hand.mdb.GetGrantByAccoundIDRight(ctx, accountID, right) exists, grants, err := hand.mdb.ListGrantsByAccoundIDRight(ctx, accountID, reqRight)
if err != nil { if err != nil {
return res, err return res, err
} }
if !exists { if !exists {
return res, err return res, err
} }
switch right { switch reqRight {
case descr.RightReadFiles, descr.RightWriteFiles: case descr.RightReadFiles, descr.RightWriteFiles:
grant.Pattern = ".*" for _, grant := range grants {
re, err := regexp.Compile(grant.Pattern) re, err := regexp.Compile(grant.Pattern)
if err != nil { if err != nil {
return res, err hand.logg.Warningf("Wrong pattern %s for grant %s: %v", grant.Pattern, grant.ID, err)
} err = nil
if !re.MatchString(subject) { continue
return res, err }
if re.MatchString(subject) {
res = true
break
}
} }
default: default:
// NOP // NOP
} }
res = true res = true
hand.logg.Debugf("Checking right %s for %s: %v", right, accountID, res) //hand.logg.Debugf("Result of checking right %s for %s: %v", reqRight, accountID, res)
return res, err return res, err
} }
+8 -2
View File
@@ -21,6 +21,8 @@ func (hand *Handler) ManifestExists(rctx *router.Context) {
name, _ := rctx.GetSubpath("name") name, _ := rctx.GetSubpath("name")
reference, _ := rctx.GetSubpath("reference") reference, _ := rctx.GetSubpath("reference")
hand.DumpHeaders("ManigestExists:\n", rctx)
params := &operator.ManifestExistsParams{ params := &operator.ManifestExistsParams{
Name: name, Name: name,
Reference: reference, Reference: reference,
@@ -94,6 +96,8 @@ func (hand *Handler) GetManifest(rctx *router.Context) {
name, _ := rctx.GetSubpath("name") name, _ := rctx.GetSubpath("name")
reference, _ := rctx.GetSubpath("reference") reference, _ := rctx.GetSubpath("reference")
//hand.DumpHeaders("GetManigest", rctx)
params := &operator.GetManifestParams{ params := &operator.GetManifestParams{
Name: name, Name: name,
Reference: reference, Reference: reference,
@@ -118,10 +122,12 @@ func (hand *Handler) GetManifest(rctx *router.Context) {
return return
} }
if code == http.StatusOK { if code == http.StatusOK {
//hand.logg.Debugf("GetManifest type: %s", res.ContentType)
//hand.logg.Debugf("GetManifest payload: %s", res.Payload)
rctx.SetHeader("Content-Length", res.ContentLength) rctx.SetHeader("Content-Length", res.ContentLength)
rctx.SetHeader("Content-Type", res.ContentType) //rctx.SetHeader("Content-Type", res.ContentType)
rctx.SetHeader("Docker-Content-Digest", res.DockerContentDigest) rctx.SetHeader("Docker-Content-Digest", res.DockerContentDigest)
rctx.SendBytes(code, []byte(res.Payload)) rctx.SendBytes(code, res.ContentType, []byte(res.Payload))
return return
} }
rctx.SetStatus(code) rctx.SetStatus(code)
-1
View File
@@ -21,7 +21,6 @@ func (hand *Handler) GetVersion(rctx *router.Context) {
params := &operator.GetVersionParams{} params := &operator.GetVersionParams{}
//hand.DumpHeaders("GetVersion", rctx) //hand.DumpHeaders("GetVersion", rctx)
authorization := rctx.GetHeader("Authorization") authorization := rctx.GetHeader("Authorization")
if authorization == "" { if authorization == "" {
rctx.SetHeader("WWW-Authenticate", `Basic realm="mstore"`) rctx.SetHeader("WWW-Authenticate", `Basic realm="mstore"`)
+14
View File
@@ -93,6 +93,20 @@ func (db *Database) GetGrantByAccoundIDRight(ctx context.Context, accountID, rig
return true, res, err return true, res, err
} }
func (db *Database) ListGrantsByAccoundIDRight(ctx context.Context, accountID, right string) (bool, []descr.Grant, error) {
var err error
request := `SELECT * FROM grants WHERE account_id = $1 AND right = $2`
res := make([]descr.Grant, 0)
err = db.db.Select(&res, request, accountID, right)
if err != nil {
return false, res, err
}
if len(res) == 0 {
return false, res, err
}
return true, res, err
}
func (db *Database) GetGrantByAccoundIDRightPattern(ctx context.Context, accountID, right, pattern string) (bool, *descr.Grant, error) { func (db *Database) GetGrantByAccoundIDRightPattern(ctx context.Context, accountID, right, pattern string) (bool, *descr.Grant, error) {
var err error var err error
res := &descr.Grant{} res := &descr.Grant{}
+22 -6
View File
@@ -22,11 +22,6 @@ import (
"mstore/pkg/auxoci" "mstore/pkg/auxoci"
) )
const (
ddmMimeType = "application/vnd.docker.distribution.manifest.v2+json"
oimMimeType = "application/vnd.oci.image.manifest.v1+json"
)
type ManifestExistsParams struct { type ManifestExistsParams struct {
Name string Name string
Reference string Reference string
@@ -93,6 +88,14 @@ type PutManifestResult struct {
Location string Location string
} }
const (
ddmMimeType = "application/vnd.docker.distribution.manifest.v2+json"
oimMimeType = "application/vnd.oci.image.manifest.v1+json"
oicMimeType = "application/vnd.oci.image.config.v1+json"
dciMimeType = "application/vnd.docker.container.image.v1+json"
)
// TODO: lock for the name-reference or simular? // TODO: lock for the name-reference or simular?
func (oper *Operator) PutManifest(ctx context.Context, params *PutManifestParams) (*PutManifestResult, int, error) { func (oper *Operator) PutManifest(ctx context.Context, params *PutManifestParams) (*PutManifestResult, int, error) {
var err error var err error
@@ -107,7 +110,12 @@ func (oper *Operator) PutManifest(ctx context.Context, params *PutManifestParams
return res, http.StatusBadRequest, err return res, http.StatusBadRequest, err
} }
// Check Content-Type // Check Content-Type
if params.ContentType != oimMimeType { var mimeIsAcceptably bool
mimeIsAcceptably = mimeIsAcceptably || params.ContentType == oimMimeType
mimeIsAcceptably = mimeIsAcceptably || params.ContentType == ddmMimeType
mimeIsAcceptably = mimeIsAcceptably || params.ContentType == oicMimeType
mimeIsAcceptably = mimeIsAcceptably || params.ContentType == dciMimeType
if !mimeIsAcceptably {
err = fmt.Errorf("Unknown or empty Content-Type: %s", params.ContentType) err = fmt.Errorf("Unknown or empty Content-Type: %s", params.ContentType)
return res, http.StatusNotFound, err return res, http.StatusNotFound, err
} }
@@ -143,6 +151,14 @@ func (oper *Operator) PutManifest(ctx context.Context, params *PutManifestParams
code := http.StatusRequestEntityTooLarge code := http.StatusRequestEntityTooLarge
return res, code, err return res, code, err
} }
// Check point
oper.logg.Debugf("=== Incoming manifest type: %s", params.ContentType)
oper.logg.Debugf("=== Incoming manifest body: %s", string(incomingManifestBytes))
if params.ContentType == oicMimeType || params.ContentType == dciMimeType {
return res, http.StatusOK, err
}
incomingManifest, err := auxoci.ParseOCIManifest(incomingManifestBytes) incomingManifest, err := auxoci.ParseOCIManifest(incomingManifestBytes)
if err != nil { if err != nil {
err = fmt.Errorf("Parsing OCI manifest error: %v", err) err = fmt.Errorf("Parsing OCI manifest error: %v", err)
+2 -2
View File
@@ -142,9 +142,9 @@ func (rctx *Context) SendText(statusCode int, payload string) {
rctx.Writer.Write([]byte(payload)) rctx.Writer.Write([]byte(payload))
} }
func (rctx *Context) SendBytes(statusCode int, payload []byte) { func (rctx *Context) SendBytes(statusCode int, ctype string, payload []byte) {
size := strconv.FormatInt(int64(len(payload)), 10) size := strconv.FormatInt(int64(len(payload)), 10)
rctx.Writer.Header().Set("Content-Type", "application/octet-stream") rctx.Writer.Header().Set("Content-Type", ctype)
rctx.Writer.Header().Set("Content-Length", size) rctx.Writer.Header().Set("Content-Length", size)
rctx.Writer.WriteHeader(statusCode) rctx.Writer.WriteHeader(statusCode)
rctx.Writer.Write(payload) rctx.Writer.Write(payload)
+9
View File
@@ -16,6 +16,7 @@ import (
"time" "time"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper"
"mstore/app/descr" "mstore/app/descr"
"mstore/pkg/client" "mstore/pkg/client"
@@ -115,6 +116,14 @@ func (util *AccountUtil) CreateAccountCmds() *cobra.Command {
listAccountsCmd.MarkFlagRequired("host") listAccountsCmd.MarkFlagRequired("host")
subCmd.AddCommand(listAccountsCmd) subCmd.AddCommand(listAccountsCmd)
viper.BindPFlags(subCmd.Flags())
viper.SetEnvPrefix("MSTORE")
// Bind environment variables
viper.BindEnv("user")
viper.BindEnv("pass")
viper.BindEnv("host")
return subCmd return subCmd
} }
+86 -25
View File
@@ -1,10 +1,10 @@
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright 1992-2022 Free Software Foundation, Inc. # Copyright 1992-2024 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale # shellcheck disable=SC2006,SC2268 # see below for rationale
timestamp='2022-01-09' timestamp='2024-07-27'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@ me=`echo "$0" | sed -e 's,.*/,,'`
usage="\ usage="\
Usage: $0 [OPTION] Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on. Output the configuration name of the system '$me' is run on.
Options: Options:
-h, --help print this help, then exit -h, --help print this help, then exit
@@ -60,13 +60,13 @@ version="\
GNU config.guess ($timestamp) GNU config.guess ($timestamp)
Originally written by Per Bothner. Originally written by Per Bothner.
Copyright 1992-2022 Free Software Foundation, Inc. Copyright 1992-2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help=" help="
Try \`$me --help' for more information." Try '$me --help' for more information."
# Parse command line # Parse command line
while test $# -gt 0 ; do while test $# -gt 0 ; do
@@ -102,8 +102,8 @@ GUESS=
# temporary files to be created and, as you can see below, it is a # temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion. # headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated. # use 'HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team. # Portable tmp directory creation inspired by the Autoconf team.
@@ -123,7 +123,7 @@ set_cc_for_build() {
dummy=$tmp/dummy dummy=$tmp/dummy
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,) echo "int x;" > "$dummy.c" ,,) echo "int x;" > "$dummy.c"
for driver in cc gcc c89 c99 ; do for driver in cc gcc c17 c99 c89 ; do
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD=$driver CC_FOR_BUILD=$driver
break break
@@ -155,6 +155,9 @@ Linux|GNU|GNU/*)
set_cc_for_build set_cc_for_build
cat <<-EOF > "$dummy.c" cat <<-EOF > "$dummy.c"
#if defined(__ANDROID__)
LIBC=android
#else
#include <features.h> #include <features.h>
#if defined(__UCLIBC__) #if defined(__UCLIBC__)
LIBC=uclibc LIBC=uclibc
@@ -162,6 +165,8 @@ Linux|GNU|GNU/*)
LIBC=dietlibc LIBC=dietlibc
#elif defined(__GLIBC__) #elif defined(__GLIBC__)
LIBC=gnu LIBC=gnu
#elif defined(__LLVM_LIBC__)
LIBC=llvm
#else #else
#include <stdarg.h> #include <stdarg.h>
/* First heuristic to detect musl libc. */ /* First heuristic to detect musl libc. */
@@ -169,6 +174,7 @@ Linux|GNU|GNU/*)
LIBC=musl LIBC=musl
#endif #endif
#endif #endif
#endif
EOF EOF
cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
eval "$cc_set_libc" eval "$cc_set_libc"
@@ -459,7 +465,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
UNAME_RELEASE=`uname -v` UNAME_RELEASE=`uname -v`
;; ;;
esac esac
# Japanese Language versions have a version number like `4.1.3-JL'. # Japanese Language versions have a version number like '4.1.3-JL'.
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
GUESS=sparc-sun-sunos$SUN_REL GUESS=sparc-sun-sunos$SUN_REL
;; ;;
@@ -628,7 +634,8 @@ EOF
sed 's/^ //' << EOF > "$dummy.c" sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h> #include <sys/systemcfg.h>
main() int
main ()
{ {
if (!__power_pc()) if (!__power_pc())
exit(1); exit(1);
@@ -712,7 +719,8 @@ EOF
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
int main () int
main ()
{ {
#if defined(_SC_KERNEL_BITS) #if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS); long bits = sysconf(_SC_KERNEL_BITS);
@@ -904,7 +912,7 @@ EOF
fi fi
;; ;;
*:FreeBSD:*:*) *:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p` UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in case $UNAME_PROCESSOR in
amd64) amd64)
UNAME_PROCESSOR=x86_64 ;; UNAME_PROCESSOR=x86_64 ;;
@@ -966,11 +974,37 @@ EOF
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
;; ;;
x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
;;
*:[Mm]anagarm:*:*)
GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
;;
*:Minix:*:*) *:Minix:*:*)
GUESS=$UNAME_MACHINE-unknown-minix GUESS=$UNAME_MACHINE-unknown-minix
;; ;;
aarch64:Linux:*:*) aarch64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC set_cc_for_build
CPU=$UNAME_MACHINE
LIBCABI=$LIBC
if test "$CC_FOR_BUILD" != no_compiler_found; then
ABI=64
sed 's/^ //' << EOF > "$dummy.c"
#ifdef __ARM_EABI__
#ifdef __ARM_PCS_VFP
ABI=eabihf
#else
ABI=eabi
#endif
#endif
EOF
cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
eval "$cc_set_abi"
case $ABI in
eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
esac
fi
GUESS=$CPU-unknown-linux-$LIBCABI
;; ;;
aarch64_be:Linux:*:*) aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be UNAME_MACHINE=aarch64_be
@@ -1036,7 +1070,16 @@ EOF
k1om:Linux:*:*) k1om:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;; ;;
loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) kvx:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
kvx:cos:*:*)
GUESS=$UNAME_MACHINE-unknown-cos
;;
kvx:mbr:*:*)
GUESS=$UNAME_MACHINE-unknown-mbr
;;
loongarch32:Linux:*:* | loongarch64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;; ;;
m32r*:Linux:*:*) m32r*:Linux:*:*)
@@ -1151,16 +1194,27 @@ EOF
;; ;;
x86_64:Linux:*:*) x86_64:Linux:*:*)
set_cc_for_build set_cc_for_build
CPU=$UNAME_MACHINE
LIBCABI=$LIBC LIBCABI=$LIBC
if test "$CC_FOR_BUILD" != no_compiler_found; then if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ ABI=64
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ sed 's/^ //' << EOF > "$dummy.c"
grep IS_X32 >/dev/null #ifdef __i386__
then ABI=x86
LIBCABI=${LIBC}x32 #else
fi #ifdef __ILP32__
ABI=x32
#endif
#endif
EOF
cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
eval "$cc_set_abi"
case $ABI in
x86) CPU=i686 ;;
x32) LIBCABI=${LIBC}x32 ;;
esac
fi fi
GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI GUESS=$CPU-pc-linux-$LIBCABI
;; ;;
xtensa*:Linux:*:*) xtensa*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
@@ -1180,7 +1234,7 @@ EOF
GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
;; ;;
i*86:OS/2:*:*) i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility # If we were able to find 'uname', then EMX Unix compatibility
# is probably installed. # is probably installed.
GUESS=$UNAME_MACHINE-pc-os2-emx GUESS=$UNAME_MACHINE-pc-os2-emx
;; ;;
@@ -1321,7 +1375,7 @@ EOF
GUESS=ns32k-sni-sysv GUESS=ns32k-sni-sysv
fi fi
;; ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV> # says <Richard.M.Bartel@ccMail.Census.GOV>
GUESS=i586-unisys-sysv4 GUESS=i586-unisys-sysv4
;; ;;
@@ -1367,8 +1421,11 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible. BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
GUESS=i586-pc-haiku GUESS=i586-pc-haiku
;; ;;
x86_64:Haiku:*:*) ppc:Haiku:*:*) # Haiku running on Apple PowerPC
GUESS=x86_64-unknown-haiku GUESS=powerpc-apple-haiku
;;
*:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat)
GUESS=$UNAME_MACHINE-unknown-haiku
;; ;;
SX-4:SUPER-UX:*:*) SX-4:SUPER-UX:*:*)
GUESS=sx4-nec-superux$UNAME_RELEASE GUESS=sx4-nec-superux$UNAME_RELEASE
@@ -1540,6 +1597,9 @@ EOF
*:Unleashed:*:*) *:Unleashed:*:*)
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
;; ;;
*:Ironclad:*:*)
GUESS=$UNAME_MACHINE-unknown-ironclad
;;
esac esac
# Do we have a guess based on uname results? # Do we have a guess based on uname results?
@@ -1563,6 +1623,7 @@ cat > "$dummy.c" <<EOF
#endif #endif
#endif #endif
#endif #endif
int
main () main ()
{ {
#if defined (sony) #if defined (sony)
Vendored
+703 -239
View File
File diff suppressed because it is too large Load Diff
Vendored
+459 -284
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -1,6 +1,7 @@
#!/usr/bin/make -f #!/usr/bin/make -f
export GO111MODULE=on export GO111MODULE=on
export GOPROXY=https://proxy.golang.org
%: %:
dh $@ dh $@
@@ -8,4 +9,5 @@ export GO111MODULE=on
override_dh_auto_configure: override_dh_auto_configure:
./configure --prefix=/usr ./configure --prefix=/usr
#EOF #EOF
+7 -7
View File
@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# install - install a program, script, or datafile # install - install a program, script, or datafile
scriptversion=2020-11-14.01; # UTC scriptversion=2024-06-19.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was # This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the # later released in X11R6 (xc/config/util/install.sh) with the
@@ -124,9 +124,9 @@ it's up to you to specify -f if you want it.
If -S is not specified, no backups are attempted. If -S is not specified, no backups are attempted.
Email bug reports to bug-automake@gnu.org. Report bugs to <bug-automake@gnu.org>.
Automake home page: https://www.gnu.org/software/automake/ GNU Automake home page: <https://www.gnu.org/software/automake/>.
" General help using GNU software: <https://www.gnu.org/gethelp/>."
while test $# -ne 0; do while test $# -ne 0; do
case $1 in case $1 in
@@ -170,7 +170,7 @@ while test $# -ne 0; do
-T) is_target_a_directory=never;; -T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;; --version) echo "$0 (GNU Automake) $scriptversion"; exit $?;;
--) shift --) shift
break;; break;;
@@ -345,7 +345,7 @@ do
' 0 ' 0
# Because "mkdir -p" follows existing symlinks and we likely work # Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir' # directly in world-writable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test # directory is successfully created first before we actually test
# 'mkdir -p'. # 'mkdir -p'.
if (umask $mkdir_umask && if (umask $mkdir_umask &&
@@ -353,7 +353,7 @@ do
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then then
if test -z "$dir_arg" || { if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m. # Check for POSIX incompatibility with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't. # other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+48 -27
View File
@@ -1,9 +1,11 @@
#! /bin/sh #! /bin/sh
# Common wrapper for a few potentially missing GNU programs. # Common wrapper for a few potentially missing GNU and other programs.
scriptversion=2018-03-07.03; # UTC scriptversion=2024-06-07.14; # UTC
# Copyright (C) 1996-2021 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells
# Copyright (C) 1996-2024 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@@ -54,18 +56,20 @@ Options:
-v, --version output version information and exit -v, --version output version information and exit
Supported PROGRAM values: Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo aclocal autoconf autogen autoheader autom4te automake autoreconf
bison yacc flex lex help2man bison flex help2man lex makeinfo perl yacc
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name. 'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>." Report bugs to <bug-automake@gnu.org>.
GNU Automake home page: <https://www.gnu.org/software/automake/>.
General help using GNU software: <https://www.gnu.org/gethelp/>."
exit $? exit $?
;; ;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version) -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)" echo "missing (GNU Automake) $scriptversion"
exit $? exit $?
;; ;;
@@ -108,7 +112,7 @@ gnu_software_URL=https://www.gnu.org/software
program_details () program_details ()
{ {
case $1 in case $1 in
aclocal|automake) aclocal|automake|autoreconf)
echo "The '$1' program is part of the GNU Automake package:" echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>" echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
@@ -123,6 +127,9 @@ program_details ()
echo "<$gnu_software_URL/m4/>" echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>" echo "<$perl_URL>"
;; ;;
*)
:
;;
esac esac
} }
@@ -137,48 +144,55 @@ give_advice ()
printf '%s\n' "'$1' is $msg." printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'" configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
autoheader_deps="'acconfig.h'"
automake_deps="'Makefile.am'"
aclocal_deps="'acinclude.m4'"
case $normalized_program in case $normalized_program in
aclocal*)
echo "You should only need it if you modified $aclocal_deps or"
echo "$configure_deps."
;;
autoconf*) autoconf*)
echo "You should only need it if you modified 'configure.ac'," echo "You should only need it if you modified $configure_deps."
echo "or m4 files included by it." ;;
program_details 'autoconf' autogen*)
echo "You should only need it if you modified a '.def' or '.tpl' file."
echo "You may want to install the GNU AutoGen package:"
echo "<$gnu_software_URL/autogen/>"
;; ;;
autoheader*) autoheader*)
echo "You should only need it if you modified 'acconfig.h' or" echo "You should only need it if you modified $autoheader_deps or"
echo "$configure_deps." echo "$configure_deps."
program_details 'autoheader'
;; ;;
automake*) automake*)
echo "You should only need it if you modified 'Makefile.am' or" echo "You should only need it if you modified $automake_deps or"
echo "$configure_deps." echo "$configure_deps."
program_details 'automake'
;; ;;
aclocal*) autom4te*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require" echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt." echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te' ;;
autoreconf*)
echo "You should only need it if you modified $aclocal_deps or"
echo "$automake_deps or $autoheader_deps or $automake_deps or"
echo "$configure_deps."
;; ;;
bison*|yacc*) bison*|yacc*)
echo "You should only need it if you modified a '.y' file." echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:" echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>" echo "<$gnu_software_URL/bison/>"
;; ;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*) help2man*)
echo "You should only need it if you modified a dependency" \ echo "You should only need it if you modified a dependency" \
"of a man page." "of a man page."
echo "You may want to install the GNU Help2man package:" echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>" echo "<$gnu_software_URL/help2man/>"
;; ;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
makeinfo*) makeinfo*)
echo "You should only need it if you modified a '.texi' file, or" echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual." echo "any other file indirectly affecting the aspect of the manual."
@@ -189,6 +203,12 @@ give_advice ()
echo "want to install GNU make:" echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>" echo "<$gnu_software_URL/make/>"
;; ;;
perl*)
echo "You should only need it to run GNU Autoconf, GNU Automake, "
echo " assorted other tools, or if you modified a Perl source file."
echo "You may want to install the Perl 5 language interpreter:"
echo "<$perl_URL>"
;;
*) *)
echo "You might have modified some files without having the proper" echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it" echo "tools for further handling them. Check the 'README' file, it"
@@ -197,6 +217,7 @@ give_advice ()
echo "case some other package contains this missing '$1' program." echo "case some other package contains this missing '$1' program."
;; ;;
esac esac
program_details "$normalized_program"
} }
give_advice "$1" | sed -e '1s/^/WARNING: /' \ give_advice "$1" | sed -e '1s/^/WARNING: /' \