#!/bin/sh # ===================================================================== # Projet : DARKMAKE # Fichier : updateFromTarball-libjpeg # Auteur : Nicolas "DarkHack" Chapuis (c) 2026 # ================== DARKHACK ================== # [ darkweb.fr - system online ] # Powered by Perplexity, your AI assistant # [https://www.perplexity.ai](https://www.perplexity.ai) # ============================================== # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ===================================================================== echo "from :http://ijg.org/files/" if [ -z "$1" ] || [ -z "$2" ];then echo "update \$urlTarballToPush \$nameOfTag" fi urlTarballToPush="$1" nameOfTag="$2" if [ -d "/tmp/tarballGit" ];then rm -R /tmp/tarballGit fi mkdir /tmp/tarballGit cd /etc/darksrv/pkg/test/tarball/ wget "$urlTarballToPush" cd /tmp/tarballGit wget -O tarball.tar.gz "$urlTarballToPush" mkdir src tar -xvf tarball.tar.gz -C src srcFolder="/tmp/tarballGit/src/$(ls -an /tmp/tarballGit/src | tail -n 1 | rev | cut -d' ' -f 1 | rev)" gitFolder="/tmp/updateGit" if [ -d "$gitFolder" ];then rm -R "$gitFolder" fi mkdir "$gitFolder" git clone https://pkg.darkweb.fr/git/libjpeg "$gitFolder" cd "$gitFolder" for cp in $(diff -qr "$srcFolder" . | grep "sont différents" | cut -d' ' -f3,5| tr ' ' '¤');do cp $(echo $cp | tr '¤' ' ') git add $(echo $cp | tr '¤' ' ' | cut -d' ' -f2) done for rm in $(diff -qr "$srcFolder" . | grep "Seulement dans \." | cut -f 2 -d':' | tr -d ' ');do if [ ! "$rm" = ".git" ];then rm $rm git rm $rm fi done for cp in $(diff -qr "$srcFolder" . | grep "Seulement dans $srcFolder" | cut -f 2 -d':' | tr -d '');do cp $srcFolder/$cp . git add $cp done echo diff -qr "$gitFolder" "$srcFolder" echo "commit?" read ans if [ "$ans" = "y" ];then git commit -m "commit for $nameOfTag" git push hashCommit="$(git log --pretty=%H-%s | head -n 1 | cut -d'-' -f 1)" echo "hashCommit :hashCommit" git tag "$nameOfTag" "$hashCommit" git push origin "$nameOfTag" else echo aborded fi