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%.war}"
|
||||
name="${name%.ear}"
|
||||
[ "$NUTOOLS_SH_ARCHIVE_SUPPORT" ] && name="${name%.sh}"
|
||||
[ "$name" != "$1" ]
|
||||
}
|
||||
function extract_archive() {
|
||||
|
@ -1445,6 +1446,12 @@ function extract_archive() {
|
|||
cd "$destdir"
|
||||
jar xf "$arch" "$@"
|
||||
) || return
|
||||
elif [ "$NUTOOLS_SH_ARCHIVE_SUPPORT" ] && endswith "$arch" .sh; then
|
||||
(
|
||||
arch="$(abspath "$arch")"
|
||||
cd "$destdir"
|
||||
"${BASH:-/bin/sh}" "$arch" --tar xf "$@"
|
||||
) || return
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
|
@ -1462,6 +1469,7 @@ function get_archive_basename() {
|
|||
basename="${basename%.jar}"
|
||||
basename="${basename%.war}"
|
||||
basename="${basename%.ear}"
|
||||
[ "$NUTOOLS_SH_ARCHIVE_SUPPORT" ] && basename="${basename%.sh}"
|
||||
# résultat
|
||||
echo "$basename"
|
||||
}
|
||||
|
@ -1481,6 +1489,7 @@ function get_archive_appname() {
|
|||
appname="${appname%.jar}"
|
||||
appname="${appname%.war}"
|
||||
appname="${appname%.ear}"
|
||||
[ "$NUTOOLS_SH_ARCHIVE_SUPPORT" ] && appname="${appname%.sh}"
|
||||
# supprimer la version et afficher
|
||||
echo "$appname" | awk '{
|
||||
if (match($0, /[-_.]([0-9]+([-_.][0-9]+)*([a-zA-Z][0-9]*|[-_.][0-9]+[a-zA-Z][0-9]*)?)$/)) {
|
||||
|
|
35
pff
35
pff
|
@ -16,6 +16,7 @@ ORIGEXT=pff
|
|||
DEFAULT_ORIGEXTS=(".$ORIGEXT" .origine .default)
|
||||
PFFCONF=.pff.conf # ne pas modifier
|
||||
DEFAULT_PROTECTS=(/.git/ .svn/ /pff/ "/$PFFCONF")
|
||||
NUTOOLS_SH_ARCHIVE_SUPPORT=1
|
||||
|
||||
PFFCONFVARS=(
|
||||
"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"
|
||||
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"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
local -a tmpargs
|
||||
case "$archive" in
|
||||
*.sh) tmpargs=(--exclude cleanup.sh --exclude install.sh);;
|
||||
esac
|
||||
|
||||
ac_set_tmpdir tmpd
|
||||
estep "Extraction de $(ppath "$archive" "$cwd")"
|
||||
extract_archive "$archive" "$tmpd" || die
|
||||
extract_archive "$archive" "$tmpd" "${tmpargs[@]}" || die
|
||||
srcdir="$tmpd"
|
||||
|
||||
if [ -n "$unwrap" ]; then
|
||||
|
@ -859,22 +867,21 @@ function new__prepare_archive() {
|
|||
local "$destver"; upvar "$destver" "$version"
|
||||
}
|
||||
|
||||
function new_cmd_amue_clean_libs() {
|
||||
# en mode distribution "patch", supprimer le contenu du répertoire
|
||||
# WEB-INF/lib si ces fichiers sont relivrés
|
||||
function new_cmd_amue_clean() {
|
||||
# en mode distribution "patch", supprimer le contenu des répertoires
|
||||
# spécifiés s'ils sont relivrés
|
||||
[ "$DISTTYPE" == patch ] || return
|
||||
if [ -n "$(/bin/ls -d "$srcdir/WEB-INF/lib"/* 2>/dev/null)" ]; then
|
||||
rm -f WEB-INF/lib/*
|
||||
fi
|
||||
}
|
||||
function new_cmd_amue_clean_wsdl() {
|
||||
# en mode distribution "patch", supprimer le contenu du répertoire
|
||||
# WEB-INF/wsdl si ces fichiers sont relivrés
|
||||
[ "$DISTTYPE" == patch ] || return
|
||||
if [ -n "$(/bin/ls -d "$srcdir/WEB-INF/wsdl"/* 2>/dev/null)" ]; then
|
||||
rm -f WEB-INF/wsdl/*
|
||||
[ $# -gt 0 ] || set -- WEB-INF/{lib,classes/{gouv,com,org}} wsdl
|
||||
local dir
|
||||
for dir in "$@"; do
|
||||
if [ -n "$(/bin/ls -d "$srcdir/$dir"/* 2>/dev/null)" ]; then
|
||||
eval "rm -rf $dir/*"
|
||||
fi
|
||||
done
|
||||
}
|
||||
# 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() {
|
||||
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