mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 21:39:39 +02:00
added create_clean_fpcsrc_directory.sh
git-svn-id: trunk@5802 -
This commit is contained in:
parent
7f206eeda3
commit
17b062c027
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1473,6 +1473,7 @@ tools/getallmofiles.sh -text svneol=native#application/x-sh
|
||||
tools/getallpofiles.sh -text svneol=native#application/x-sh
|
||||
tools/install/build_fpc_rpm.sh -text svneol=native#application/x-sh
|
||||
tools/install/build_fpcsrc_rpm.sh -text svneol=native#application/x-sh
|
||||
tools/install/create_clean_fpcsrc_directory.sh -text svneol=native#application/x-sh
|
||||
tools/install/create_clean_lazarus_directory.sh -text svneol=native#application/x-sh
|
||||
tools/install/create_fpc_deb.sh -text svneol=native#application/x-sh
|
||||
tools/install/create_fpc_export_tgz.sh -text svneol=native#application/x-sh
|
||||
|
58
tools/install/create_clean_fpcsrc_directory.sh
Normal file
58
tools/install/create_clean_fpcsrc_directory.sh
Normal file
@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
SrcDir=$1
|
||||
DestDir=$2
|
||||
|
||||
SrcDir=$(echo $SrcDir | sed -e 's#//#/#' -e 's#/$##')/
|
||||
DestDir=$(echo $DestDir | sed -e 's#//#/#' -e 's#/$##')/
|
||||
|
||||
if [ "x$SrcDir" = "x" ]; then
|
||||
echo "Usage: $0 <fpc_source_directory> <fpc_destination_directory>"
|
||||
exit
|
||||
fi
|
||||
if [ "x$DestDir" = "x" ]; then
|
||||
echo "Usage: $0 <fpc_source_directory> <fpc_destination_directory>"
|
||||
exit
|
||||
fi
|
||||
if [ "x$DestDir" = "x/" ]; then
|
||||
echo "Usage: $0 <fpc_source_directory> <fpc_destination_directory>"
|
||||
exit
|
||||
fi
|
||||
if [ ! -d $SrcDir/compiler ]; then
|
||||
echo "The directory does not look like a fpc source directory (lazarus/)"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "copy $SrcDir to $DestDir ..."
|
||||
if [ `which rsync` ]; then
|
||||
rsync -va --exclude="CVS" --exclude=".cvsignore" \
|
||||
--exclude="*.ppu" --exclude="*.ppw" --exclude="*.ppl" \
|
||||
--exclude="*.o" --exclude="*.ow" --exclude="*.rst" \
|
||||
--exclude=".#*" --exclude="*.~*" --exclude="*.bak" \
|
||||
--exclude="*.orig" --exclude="*.rej" --exclude="*.bak" \
|
||||
--exclude=".xvpics" --exclude="*.compiled" --exclude="killme*" \
|
||||
--exclude=".gdb_hist*"
|
||||
$SrcDir $DestDir
|
||||
else
|
||||
cp -a $SrcDir $DestDir
|
||||
fi
|
||||
|
||||
echo "cleaning up (CVS, ppu, o) ..."
|
||||
cd $DestDir
|
||||
make distclean
|
||||
for Ext in ppu ppw ppl o ow rst cvsignore bak orig rej xvpics; do
|
||||
find . -name "*.$Ext" -exec rm -f {} \;
|
||||
done
|
||||
find . -name "*.~*" -exec rm -f {} \;
|
||||
find . -name "*.#*" -exec rm -f {} \;
|
||||
# delete all CVS directories
|
||||
find . -name "CVS" -exec rm -rf {} \;
|
||||
# delete all executables
|
||||
find . -perm +a+x -type f -exec rm -f {} \;
|
||||
cd -
|
||||
|
||||
# end.
|
||||
|
@ -6,8 +6,8 @@ set -e
|
||||
LazSrcDir=$1
|
||||
LazDestDir=$2
|
||||
|
||||
LazSrcDir=$(echo $LazSrcDir | sed -e 's#//#/#' -e 's#/$##')
|
||||
LazDestDir=$(echo $LazDestDir | sed -e 's#//#/#' -e 's#/$##')
|
||||
LazSrcDir=$(echo $LazSrcDir | sed -e 's#//#/#' -e 's#/$##')/
|
||||
LazDestDir=$(echo $LazDestDir | sed -e 's#//#/#' -e 's#/$##')/
|
||||
|
||||
if [ "x$LazSrcDir" = "x" ]; then
|
||||
echo "Usage: $0 <lazarus_source_directory> <lazarus_destination_directory>"
|
||||
@ -34,9 +34,10 @@ if [ `which rsync` ]; then
|
||||
--exclude=".#*" --exclude="*.~*" --exclude="*.bak" \
|
||||
--exclude="*.orig" --exclude="*.rej" --exclude="*.bak" \
|
||||
--exclude=".xvpics" --exclude="*.compiled" --exclude="killme*" \
|
||||
--exclude=".gdb_hist*"
|
||||
$LazSrcDir $LazDestDir
|
||||
else
|
||||
echo cp -a $LazSrcDir $LazDestDir
|
||||
cp -a $LazSrcDir $LazDestDir
|
||||
fi
|
||||
|
||||
echo "cleaning up (CVS, ppu, o) ..."
|
||||
@ -49,7 +50,10 @@ for Ext in ppu ppw ppl o ow rst cvsignore bak orig rej xvpics; do
|
||||
done
|
||||
find . -name "*.~*" -exec rm -f {} \;
|
||||
find . -name "*.#*" -exec rm -f {} \;
|
||||
# delete all CVS directories
|
||||
find . -name "CVS" -exec rm -rf {} \;
|
||||
# delete all executables
|
||||
find . -perm +a+x -type f -exec rm -f {} \;
|
||||
rm -rf tools/install/*.tgz
|
||||
rm -rf tools/install/*.*.spec
|
||||
cd -
|
||||
|
@ -6,6 +6,9 @@ set -x
|
||||
FPCSrcDir=$1
|
||||
OutputFile=$2
|
||||
|
||||
FPCSrcDir=$(echo $FPCSrcDir | sed -e 's#//#/#' -e 's#/$##')/
|
||||
OutputFile=$(echo $OutputFile | sed -e 's#//#/#' -e 's#/$##')
|
||||
|
||||
Usage="Usage: $0 <fpc_source_directory> <outputfile>"
|
||||
|
||||
if [ "x$FPCSrcDir" = "x" ]; then
|
||||
@ -30,26 +33,7 @@ echo "copy $FPCSrcDir to /tmp/fpc ..."
|
||||
cd $TmpBaseDir
|
||||
rm -rf $TmpDir
|
||||
cd -
|
||||
cp -a $FPCSrcDir $TmpDir
|
||||
|
||||
echo "cleaning up (CVS, ppu, o) ..."
|
||||
cd $TmpDir
|
||||
make distclean
|
||||
|
||||
for Ext in ppu ppw ppl o ow rst cvsignore bak; do
|
||||
find . -name "*.$Ext" -exec rm -f {} \;
|
||||
done
|
||||
find . -name "*.~*" -exec rm -f {} \;
|
||||
rm -f *.tar.gz
|
||||
if [ -d CVS ]; then
|
||||
# use xargs to remove directories (otherwise find returns strange things)
|
||||
find . -name 'CVS' | xargs rm -r
|
||||
fi
|
||||
cd -
|
||||
# clean up docs
|
||||
cd $TmpDir/docs
|
||||
make clean
|
||||
cd -
|
||||
sh create_clean_fpcsrc_directory.sh $FPCSrcDir $TmpDir
|
||||
|
||||
# pack
|
||||
echo "creating tgz ..."
|
||||
|
Loading…
Reference in New Issue
Block a user