[tyndur-devel] [PATCH] Translated some build scripts
Patrick Pokatilo ·
Signed-off-by: Patrick Pokatilo <shyxormz at asxsoft.de> --- build/scripts/create_partition | 4 +- build/scripts/get_partition | 4 +- build/scripts/image_cdrom | 10 ++++---- buildmk.sh | 40 +++++++++++++++++++------------------- config.py | 42 ++++++++++++++++++++-------------------- config.sh | 4 +- 6 files changed, 52 insertions(+), 52 deletions(-) diff --git a/build/scripts/create_partition b/build/scripts/create_partition index feb5574..78510b0 100755 --- a/build/scripts/create_partition +++ b/build/scripts/create_partition @@ -65,7 +65,7 @@ def le_dword(dword): # Abrrechen wenn kein Argument mit dem Pfad gefunden werden konnte if len(sys.argv) <= 1: - print 'Bitte Imagepfad angeben' + print 'Please specify an image path' sys.exit(-1) # Ansonsten wird der Pfad gespeichert @@ -74,7 +74,7 @@ image_path = sys.argv[1] # Image oeffnen image_file = open(image_path, mode='r+b') if image_file == 0: - print 'Image konnte nicht geoeffnet werden.' + print 'Image could not be opened.' sys.exit(-1) stat_info = os.lstat(image_path) image_size = stat_info[stat.ST_SIZE] diff --git a/build/scripts/get_partition b/build/scripts/get_partition index 0f89086..40e2d54 100755 --- a/build/scripts/get_partition +++ b/build/scripts/get_partition @@ -44,7 +44,7 @@ def le_dword(a, b, c, d): # Abrrechen wenn kein Argument mit dem Pfad gefunden werden konnte if len(sys.argv) <= 1: - print 'Bitte Imagepfad angeben' + print 'Please specify an image path' sys.exit(-1) # Ansonsten wird der Pfad gespeichert @@ -53,7 +53,7 @@ image_path = sys.argv[1] # Image oeffnen image_file = open(image_path, mode='rb') if image_file == 0: - print 'Image konnte nicht geoeffnet werden.' + print 'Image could not be opened.' sys.exit(-1) # Partitionstabelle vorbereiten und einlesen diff --git a/build/scripts/image_cdrom b/build/scripts/image_cdrom index 7f91a77..5c3d170 100755 --- a/build/scripts/image_cdrom +++ b/build/scripts/image_cdrom @@ -51,7 +51,7 @@ export MTOOLSRC=lostmtools.conf # Festplattenpartition kopieren if [ ! -f $HD_IMAGE_PATH ]; then - echo "Benoetige ein Festplattenimage" + echo "Require a hard disk image" exit 1 fi @@ -78,8 +78,8 @@ if [ -f $STAGE2_ELTORITO ]; then # Eltorito -boot-load-size 4 -boot-info-table -m .svn -o $IMAGE_PATH \ $ROOT $ROOT_COMMON $ROOT_CDROM - echo "CD-Image erfolgreich erstellt!" - echo "Verwendete Methode: Eltorito" + echo "CD image created successfully!" + echo "Used method: Eltorito" exit fi @@ -131,5 +131,5 @@ cp $FLOPPY_IMAGE_PATH $ROOT_CDROM mkisofs -b $(basename $FLOPPY_IMAGE_PATH) -m .svn -o $IMAGE_PATH $ROOT $ROOT_COMMON $ROOT_CDROM $ROOT_LOCAL rm $ROOT_CDROM/$(basename $FLOPPY_IMAGE_PATH) -echo "CD-Image erfolgreich erstellt!" -echo "Verwendete Methode: Floppy-Emulation" +echo "CD image created successfully!" +echo "Used method: Floppy emulation" diff --git a/buildmk.sh b/buildmk.sh index b9d4194..11c98e0 100644 --- a/buildmk.sh +++ b/buildmk.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright (c) 2006 The tyndur Project. All rights reserved. -# +# # This code is derived from software contributed to the tyndur Project # by Kevin Wolf. # @@ -21,16 +21,16 @@ # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. shopt -s extglob @@ -102,7 +102,7 @@ if [ "`pwd | grep '/src/kernel2'`" == "" ]; then cat <<EOF >> Makefile \$(MAKE) --no-print-directory -s makefiles \$(MAKE) --no-print-directory -s subdirs - \$(MAKE) --no-print-directory -s obj + \$(MAKE) --no-print-directory -s obj EOF else cat <<EOF >> Makefile @@ -154,14 +154,14 @@ echo subdirs: >> Makefile for file in lib rtl !(lib|rtl|arch) arch; do if [ -d "$file" ]; then if [ "$file" == "include" -o \( -f "$file/.nobuild" -a ! -f "$file/.ignorenobuild" \) ]; then - echo Ueberspringe `pwd`/$file/Makefile + echo Skip `pwd`/$file/Makefile continue fi if [ "`basename \`pwd\``" == "arch" ] && [ "$file" != "$LOST_ARCH" ]; then - echo Ueberspringe `pwd`/$file/Makefile + echo Skip `pwd`/$file/Makefile continue fi - echo Erzeuge `pwd`/$file/Makefile + echo Create `pwd`/$file/Makefile echo -e "\\t\$(MAKE)" --no-print-directory -sC "$file" >> Makefile # echo -e \\tmake -C "$file" '| (grep -vE "^(make|if)" || true)' >> Makefile @@ -179,13 +179,13 @@ for file in *.c *.cpp *.asm *.pas *.S; do *.c) echo ${file%.c}.o: $file >> Makefile echo -e \\techo "'CC $file: $CC'" >> Makefile - + echo -e \\t\$\(CC\) $file >> Makefile ;; *.cpp) echo ${file%.cpp}.o: $file >> Makefile echo -e \\techo "'CPP $file: $CPP'" >> Makefile - + echo -e \\t\$\(CPP\) $file >> Makefile ;; @@ -203,7 +203,7 @@ for file in *.c *.cpp *.asm *.pas *.S; do ;; *.pas) echo ${file%.pas}.o: $file >> Makefile - + echo -e \\techo "'PPC $file'" >> Makefile if [ "$file" == "system.pas" ]; then echo -e \\t\$\(PPC\) -Us -Fiinclude/inc/ -Fiinclude/i386/ -Fiinclude/common/ $file >> Makefile @@ -214,7 +214,7 @@ for file in *.c *.cpp *.asm *.pas *.S; do *.S) echo ${file%.S}.o: $file >> Makefile echo -e \\techo "'AS $file: $CPP'" >> Makefile - + echo -e \\t\$\(AS\) -o ${file%.S}.o $file >> Makefile ;; esac @@ -232,7 +232,7 @@ softclean: clean_objs for file in *; do if [ -f "\$\$file/Makefile" -a \( ! -f "\$\$file/.nobuild" -o -f "\$\$file/.ignorenobuild" \) ]; then \$(MAKE) -sC "\$\$file" softclean; fi done clean: clean_objs - for file in *; do if [ -f "\$\$file/Makefile" -a \( ! -f "\$\$file/.nobuild" -o -f "\$\$file/.ignorenobuild" \) ]; then \$(MAKE) -sC "\$\$file" clean; rm "\$\$file/Makefile"; fi done + for file in *; do if [ -f "\$\$file/Makefile" -a \( ! -f "\$\$file/.nobuild" -o -f "\$\$file/.ignorenobuild" \) ]; then \$(MAKE) -sC "\$\$file" clean; rm "\$\$file/Makefile"; fi done .SILENT: all makefiles subdirs obj clean softclean clean_objs clean_root updateroot image-floppy image-hd test-qemu test-qemu-hd EOF @@ -284,10 +284,10 @@ bugreport: gcc -v 2> bugreport/gcc.version nasm -v > bugreport/nasm.version ld -v > bugreport/ld.version - + cp build/*.mod bugreport/ cp build/*.krn bugreport/ - + tar cjf bugreport.tar.bz2 bugreport rm -rf bugreport EOF diff --git a/config.py b/config.py index f3748d6..1fd34e8 100755 --- a/config.py +++ b/config.py @@ -7,8 +7,8 @@ frontend = "dialog" result = os.popen('which ' + frontend) if result.read() == '': - print "\nDas gewuenschte Frontend (" + frontend + ") steht nicht zur Verfuegung." - print "Sie muessen ein anderes waehlen (editieren sie config.py), oder das gewaehlte installieren.\n" + print "\nThe selected frontend (" + frontend + ") is not available." + print "You have to select a different one (edit config.py) or install the selected.\n" sys.exit(1) @@ -16,16 +16,16 @@ class shift_register: def __init__(self, size): self.size = size self.data = {} - + for index in range(1, size): self.data[index] = "" - + def shift(self, value): for index in range(0, self.size - 1): self.data[self.size - index] = self.data[self.size - index - 1] - + self.data[1] = value - + def at(self, index): if index in range(1, self.size): return self.data[index] @@ -49,12 +49,12 @@ def show_dialog(options, define_name, define_value): return "#undef " + define_name elif options['type'] == 'text': result = os.popen(frontend + ' --stdout --title "' + title + '" --inputbox "' + options['desc'] + '" 0 0 "' + define_value + '"').readline() - + return '#define ' + define_name + ' ' + result - + elif options['type'] == 'radio': opts = options['values'].split(',') - + opts_list = '' for opt in opts: opts_list = opts_list + ' "' + opt + '" "" ' @@ -62,7 +62,7 @@ def show_dialog(options, define_name, define_value): opts_list += 'on' else: opts_list += 'off' - + result = os.popen(frontend + ' --stdout --title "' + title + '" --radiolist "' + options['desc'] + '" 0 0 ' + str(len(opts)) + ' ' + opts_list ).readline() return '#define ' + define_name + ' ' + result @@ -83,36 +83,36 @@ regex_option = re.compile('^\//%(.*?) ["\'`](.*?)["\'`]') for _line in lines: line = _line.strip() line_buffer.shift(line) - - + + if(regex_define.match(line)): options = {} for index in range(2, line_buffer.size): if regex_define.match(line_buffer.at(index)): break - + option_match = regex_option.match(line_buffer.at(index)) if option_match: options[option_match.group(1)] = option_match.group(2) - - + + match_define_complex = regex_define_complex.match(line) if(match_define_complex): define_name = match_define_complex.group(1) define_value = match_define_complex.group(2) print 'define name:`' + define_name + '` value:`' + match_define_complex.group(2) + '`' _line = _line.replace(line, show_dialog(options, define_name, define_value)) - + else: match_define_simple = regex_define_simple.match(line) is_defined = match_define_simple.group(1) define_name = match_define_simple.group(2) - + print 'define name:`' + define_name + '` value:`' + is_defined + '`' - + _line = _line.replace(line, show_dialog(options, define_name, is_defined)) - + config_file_dest.write(_line) @@ -120,5 +120,5 @@ for _line in lines: config_file_dest.close() config_file_source.close() -print "\n\nAls naechster Schritt ist in den meisten Faellen ein 'make clean' notwendig." -print "Anschliessend koennen mit 'make' der tyndur-Kernel und die Module erstellt werden.\n\n" +print "\n\nIn most cases the next step has to be 'make clean'." +print "Afterwards the tyndur-kernel and the modules can be created via 'make'.\n\n" diff --git a/config.sh b/config.sh index 0ae1246..676288a 100644 --- a/config.sh +++ b/config.sh @@ -19,7 +19,7 @@ fi if [ "$LOST_ARCH" == "amd64" ]; then COMPILER_PREFIX=$COMPILER_PREFIX_AMD64 - + LOST_TOOLS_AR=$COMPILER_PREFIX"ar" LOST_TOOLS_AS=$COMPILER_PREFIX"as -64" LOST_TOOLS_LD=$COMPILER_PREFIX"ld -m elf_x86_64" @@ -29,7 +29,7 @@ if [ "$LOST_ARCH" == "amd64" ]; then LOST_TOOLS_STRIP=$COMPILER_PREFIX"strip -F elf64-x86-64" else COMPILER_PREFIX=$COMPILER_PREFIX_I386 - + LOST_TOOLS_AR=$COMPILER_PREFIX"ar" LOST_TOOLS_AS=$COMPILER_PREFIX"as -32" LOST_TOOLS_LD=$COMPILER_PREFIX"ld -m elf_i386" -- 1.6.3.3