diff --git a/.env b/.env index db2f9c1..c6f1782 100644 --- a/.env +++ b/.env @@ -5,9 +5,9 @@ RepoVers=2 # Centos Version #CentOsVersion=centos:7.9.2009 -CentOsVersion=oraclelinux:8.6 +CentOsVersion=oraclelinux:8.7 Cible=oraclelinux -VersionCible=8.6 +VersionCible=8.7 PackageManager=dnf # Sync repo script Run=/usr/local/bin/sync.sh diff --git a/bin/esl.fct b/bin/esl.fct index 8501bfb..202711c 100644 --- a/bin/esl.fct +++ b/bin/esl.fct @@ -25,6 +25,14 @@ RunScreen (){ } + +LinkEpel() { + + [[ ! -L $2 ]] && ln -s ol${Majeur}_developer_EPEL x86_64 + + +} + function oraclelinux () { Rand=repo${RANDOM} @@ -36,7 +44,7 @@ function oraclelinux () { RunScreen EPEL dnf reposync -g --newest-only --exclude='*.src' -p /data/repo/EPEL/ol${Majeur} --download-metadata --repoid=ol${Majeur}_developer_EPEL Download /data/repo/EPEL/ EPEL Action "Get in ${osversion} EPEL" cd /data/repo/EPEL/ol${Majeur} - Action "Link SeaNaps environement EPEL" ln -s ol${Majeur}_developer_EPEL x86_64 + Action "Link SeaNaps environement EPEL" LinkEpel ol${Majeur}_developer_EPEL x86_64 diff --git a/create-tag-repo.sh b/create-tag-repo.sh new file mode 100755 index 0000000..30273db --- /dev/null +++ b/create-tag-repo.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +# Print help and exit +usage(){ + echo "-- $0 --" + echo "Freeze package environement in distributions. Create a 'fake' repository with real repodata but symbolic link of rpms" + echo "$0 OrigDir/repmod.xml BaseRepoDir DestDistributionBasenaemeDir" + exit +} + +# Print the first arguement, execute the rest of the arguements and print the result OK/FAILED +action(){ + echo -ne "${1} : " + shift + $@ &> /tmp/aaa + [[ $? -eq 0 ]] && echo -e '\033[0;32mOK\033[0m' || echo -e '\033[0;31mFAILED\033[0m' +} + +# Create tree structure of the repository in the destination directory +CreateEnv(){ + CptErr=0 + [[ ! -d ${DirDest} ]] && mkdir -p ${DirDest} || true + CptErr=$((CptErr + $?)) + for Dir in $(find -L $OrigBaseRepo -type d| sed "s#${OrigBaseRepo}##g") + do + [[ ! -d ${DirDest}/${Dir} ]] && mkdir -p ${DirDest}/${Dir} || true + CptErr=$((CptErr + $?)) + done + + CptErr=$((CptErr + $?)) + return $CptErr + } + +# for each rpm in the (get)Package directory, create a symbolic link in the destination directory +RpmLink(){ + CptErr=0 + for Rpm in $(find -L $OrigBaseRepo -type f -name "*.rpm" | sed "s#${OrigBaseRepo}##g") + do + [[ ! -L ${DirDest}/${Rpm} ]] && ln -s ${OrigBaseRepo}${Rpm} ${DirDest}/${Rpm} || true + CptErr=$((CptErr + $?)) + done + return $CptErr +} + +# Copy repodata files in the destination directory +RepoModCopy(){ + cp -vf $(dirname ${RepModFile})/* $(dirname $(echo ${RepModFile}| sed "s#${BaseDirDestRepo}#${DestDir}#g"))/. + CptErr=$((CptErr + $?)) + return $? +} + +# Check all arguments and create variable environement for readability +CheckArg(){ + [[ ! -f ${1} ]] && usage + RepModFile=${1} + [[ ! -d ${2} ]] && usage + BaseDirDestRepo=${2} + DestDir=${3}/distributions/ + DirDest=$(echo $(dirname $(dirname ${RepModFile})) | sed "s#${BaseDirDestRepo}#${DestDir}#g") + OrigBaseRepo=$(echo $(dirname $(dirname ${RepModFile}))) +} + + +# Main + +CheckArg ${1} ${2} ${3} +echo " +############################################### + RepModFile = ${1} + BaseDirDestRepo = ${2} + DestDir = ${3} +###############################################" + +# Execute + +action "Create dest environement" CreateEnv ${RepModFile} ${BaseDirDestRepo} ${DestDir} +action "Link Rpm" RpmLink ${RepModFile} ${BaseDirDestRepo} ${DestDir} +action "Copy repo data" RepoModCopy ${RepModFile} ${BaseDirDestRepo} ${DestDir} + + diff --git a/readme b/readme new file mode 100644 index 0000000..e04239e --- /dev/null +++ b/readme @@ -0,0 +1,2 @@ +delete-alsa-utils failed +66 install hde ?