mirror of
https://codeberg.org/librewolf/source.git
synced 2025-01-03 03:10:07 -05:00
added git-patchtree.sh
This commit is contained in:
parent
a6e3ec8760
commit
4331a8590f
1 changed files with 38 additions and 0 deletions
38
scripts/git-patchtree.sh
Executable file
38
scripts/git-patchtree.sh
Executable file
|
@ -0,0 +1,38 @@
|
|||
#
|
||||
# taken from ./scripts/check-patchfail.sh
|
||||
#
|
||||
# script: it 1) extract source 2) git init 2) grab filenames from diff and git add them
|
||||
#
|
||||
|
||||
|
||||
if [ ! -f version ]; then
|
||||
echo "error: 'version' does not exist. Are you in the right folder?"
|
||||
exit 1
|
||||
fi
|
||||
firefox=firefox-$(cat version).source.tar.xz
|
||||
if [ ! -f "$firefox" ]; then
|
||||
echo "error: '$firefox' does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "git-patchtree.sh: error, first argument must be a patch file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
echo "Extracting '$firefox'..."
|
||||
rm -rf firefox-$(cat version)
|
||||
tar xf $firefox
|
||||
echo ""
|
||||
|
||||
cd firefox-$(cat version) && \
|
||||
git init && \
|
||||
git add $(grep '+++' "../$1" | awk '{print $2}' | sed s/^b/./) && \
|
||||
git commit -am "original" && \
|
||||
patch -p1 -i "../$1" && \
|
||||
git commit -am "patch"
|
||||
cd ..
|
Loading…
Reference in a new issue