pff: support des archives sh de l'amue
This commit is contained in:
parent
0d1193278c
commit
e08c66bc89
|
@ -1424,6 +1424,7 @@ function is_archive() {
|
||||||
name="${name%.jar}"
|
name="${name%.jar}"
|
||||||
name="${name%.war}"
|
name="${name%.war}"
|
||||||
name="${name%.ear}"
|
name="${name%.ear}"
|
||||||
|
[ "$NUTOOLS_SH_ARCHIVE_SUPPORT" ] && name="${name%.sh}"
|
||||||
[ "$name" != "$1" ]
|
[ "$name" != "$1" ]
|
||||||
}
|
}
|
||||||
function extract_archive() {
|
function extract_archive() {
|
||||||
|
@ -1445,6 +1446,12 @@ function extract_archive() {
|
||||||
cd "$destdir"
|
cd "$destdir"
|
||||||
jar xf "$arch" "$@"
|
jar xf "$arch" "$@"
|
||||||
) || return
|
) || return
|
||||||
|
elif [ "$NUTOOLS_SH_ARCHIVE_SUPPORT" ] && endswith "$arch" .sh; then
|
||||||
|
(
|
||||||
|
arch="$(abspath "$arch")"
|
||||||
|
cd "$destdir"
|
||||||
|
"${BASH:-/bin/sh}" "$arch" --tar xf "$@"
|
||||||
|
) || return
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
@ -1462,6 +1469,7 @@ function get_archive_basename() {
|
||||||
basename="${basename%.jar}"
|
basename="${basename%.jar}"
|
||||||
basename="${basename%.war}"
|
basename="${basename%.war}"
|
||||||
basename="${basename%.ear}"
|
basename="${basename%.ear}"
|
||||||
|
[ "$NUTOOLS_SH_ARCHIVE_SUPPORT" ] && basename="${basename%.sh}"
|
||||||
# résultat
|
# résultat
|
||||||
echo "$basename"
|
echo "$basename"
|
||||||
}
|
}
|
||||||
|
@ -1481,6 +1489,7 @@ function get_archive_appname() {
|
||||||
appname="${appname%.jar}"
|
appname="${appname%.jar}"
|
||||||
appname="${appname%.war}"
|
appname="${appname%.war}"
|
||||||
appname="${appname%.ear}"
|
appname="${appname%.ear}"
|
||||||
|
[ "$NUTOOLS_SH_ARCHIVE_SUPPORT" ] && appname="${appname%.sh}"
|
||||||
# supprimer la version et afficher
|
# supprimer la version et afficher
|
||||||
echo "$appname" | awk '{
|
echo "$appname" | awk '{
|
||||||
if (match($0, /[-_.]([0-9]+([-_.][0-9]+)*([a-zA-Z][0-9]*|[-_.][0-9]+[a-zA-Z][0-9]*)?)$/)) {
|
if (match($0, /[-_.]([0-9]+([-_.][0-9]+)*([a-zA-Z][0-9]*|[-_.][0-9]+[a-zA-Z][0-9]*)?)$/)) {
|
||||||
|
|
37
pff
37
pff
|
@ -16,6 +16,7 @@ ORIGEXT=pff
|
||||||
DEFAULT_ORIGEXTS=(".$ORIGEXT" .origine .default)
|
DEFAULT_ORIGEXTS=(".$ORIGEXT" .origine .default)
|
||||||
PFFCONF=.pff.conf # ne pas modifier
|
PFFCONF=.pff.conf # ne pas modifier
|
||||||
DEFAULT_PROTECTS=(/.git/ .svn/ /pff/ "/$PFFCONF")
|
DEFAULT_PROTECTS=(/.git/ .svn/ /pff/ "/$PFFCONF")
|
||||||
|
NUTOOLS_SH_ARCHIVE_SUPPORT=1
|
||||||
|
|
||||||
PFFCONFVARS=(
|
PFFCONFVARS=(
|
||||||
"VERSION//Version actuellement installée"
|
"VERSION//Version actuellement installée"
|
||||||
|
@ -807,15 +808,22 @@ function new__prepare_archive() {
|
||||||
enote "Auto-sélection du type distribution de patch sur la base de l'extension .zip"
|
enote "Auto-sélection du type distribution de patch sur la base de l'extension .zip"
|
||||||
DISTTYPE=patch
|
DISTTYPE=patch
|
||||||
;;
|
;;
|
||||||
|
*.sh)
|
||||||
|
die "Ce type d'archive ne contient pas l'information du type de distribution. Vous devez spécifier l'une des options -F ou -H"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
die "L'extension de l'archive n'est pas reconnue. Vous devez spécifier l'une des options -F ou -H"
|
die "L'extension de l'archive n'est pas reconnue. Vous devez spécifier l'une des options -F ou -H"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
local -a tmpargs
|
||||||
|
case "$archive" in
|
||||||
|
*.sh) tmpargs=(--exclude cleanup.sh --exclude install.sh);;
|
||||||
|
esac
|
||||||
|
|
||||||
ac_set_tmpdir tmpd
|
ac_set_tmpdir tmpd
|
||||||
estep "Extraction de $(ppath "$archive" "$cwd")"
|
estep "Extraction de $(ppath "$archive" "$cwd")"
|
||||||
extract_archive "$archive" "$tmpd" || die
|
extract_archive "$archive" "$tmpd" "${tmpargs[@]}" || die
|
||||||
srcdir="$tmpd"
|
srcdir="$tmpd"
|
||||||
|
|
||||||
if [ -n "$unwrap" ]; then
|
if [ -n "$unwrap" ]; then
|
||||||
|
@ -859,22 +867,21 @@ function new__prepare_archive() {
|
||||||
local "$destver"; upvar "$destver" "$version"
|
local "$destver"; upvar "$destver" "$version"
|
||||||
}
|
}
|
||||||
|
|
||||||
function new_cmd_amue_clean_libs() {
|
function new_cmd_amue_clean() {
|
||||||
# en mode distribution "patch", supprimer le contenu du répertoire
|
# en mode distribution "patch", supprimer le contenu des répertoires
|
||||||
# WEB-INF/lib si ces fichiers sont relivrés
|
# spécifiés s'ils sont relivrés
|
||||||
[ "$DISTTYPE" == patch ] || return
|
[ "$DISTTYPE" == patch ] || return
|
||||||
if [ -n "$(/bin/ls -d "$srcdir/WEB-INF/lib"/* 2>/dev/null)" ]; then
|
[ $# -gt 0 ] || set -- WEB-INF/{lib,classes/{gouv,com,org}} wsdl
|
||||||
rm -f WEB-INF/lib/*
|
local dir
|
||||||
fi
|
for dir in "$@"; do
|
||||||
}
|
if [ -n "$(/bin/ls -d "$srcdir/$dir"/* 2>/dev/null)" ]; then
|
||||||
function new_cmd_amue_clean_wsdl() {
|
eval "rm -rf $dir/*"
|
||||||
# en mode distribution "patch", supprimer le contenu du répertoire
|
fi
|
||||||
# WEB-INF/wsdl si ces fichiers sont relivrés
|
done
|
||||||
[ "$DISTTYPE" == patch ] || return
|
|
||||||
if [ -n "$(/bin/ls -d "$srcdir/WEB-INF/wsdl"/* 2>/dev/null)" ]; then
|
|
||||||
rm -f WEB-INF/wsdl/*
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
# compat
|
||||||
|
function new_cmd_amue_clean_libs() { new_cmd_amue_clean WEB-INF/lib; }
|
||||||
|
function new_cmd_amue_clean_wsdl() { new_cmd_amue_clean wsdl; }
|
||||||
|
|
||||||
function new_cmd() {
|
function new_cmd() {
|
||||||
local autopatch="$1" version="$2" disttype="$3" unwrap="$4" merge_strategy="$5" commit_policy="$6"; shift; shift; shift; shift; shift; shift
|
local autopatch="$1" version="$2" disttype="$3" unwrap="$4" merge_strategy="$5" commit_policy="$6"; shift; shift; shift; shift; shift; shift
|
||||||
|
|
Loading…
Reference in New Issue