patch to create archives from linux

  • Jordan Wiens

    Jordan Wiens - 2006-10-26

    I wanted to create new versions of Ubuntu 6.10 boot nsis to put on my USB key, but I had to make some patches to the  The better solution would be to use os.sep more thoroughly, but I don't really know, I'm not a programmer.  Had to google to find out how to create a patch file.  :-)  Anyway, here it is.

    ---     2006-10-26 18:19:05.000000000 -0400
    +++       2006-10-26 18:15:45.000000000 -0400
    @@ -1,3 +1,4 @@
    import os
    import sys

    @@ -5,7 +6,7 @@
    languages = os.listdir("translations")
    list_of_contributors = "Greg Johnston <>\nMichael <>\nMarc Herbert <>\nPiarres beobide <>\n"
    dir_nsis_translated = "nsis_translated"
    -nsis_bin = "makensis.exe"
    +nsis_bin = "makensis"

    customizations = []
    @@ -20,10 +21,10 @@
            dir_out = name.replace("_en","")
            dir = dir_nsis_translated+os.sep+dir_out
            for dirpath, dirnames, filenames in os.walk( dir ):
    -            dirpath_formated = dirpath.replace("/","\\&quot;).replace( dir_nsis_translated+os.sep,"")
    -           list_of_files_string = list_of_files_string+"   SetOutPath $INSTDIR\\&quot;+dirpath_formated+"\n"
    +            dirpath_formated = dirpath.replace( dir_nsis_translated+os.sep,"")
    +           list_of_files_string = list_of_files_string+"   SetOutPath $INSTDIR/"+dirpath_formated+"\n"
                for file in filenames:
    -                list_of_files_string = list_of_files_string+"   File \&quot;"+dirpath_formated+"\\&quot;+file+"\&quot;\n"
    +                list_of_files_string = list_of_files_string+"   File \&quot;"+dirpath_formated+"/"+file+"\&quot;\n"
            customizations.append({"FILENAME":name+".nsi","NAME":name,"OUTFILE":name+".exe", "CAPTION":caption, "MENU_TITLE":caption, "KERNEL":dir_out+"/"+kernel["kernel"], "DRIVERS":dir_out+"/"+kernel["drivers"], "LIST_OF_FILES":list_of_files_string, "BOOT_TITLE":caption, "OUTPATH":dir_out})

    template_file = open( "instlux_template_en.nsi", "r" )
    @@ -50,7 +51,7 @@
         for linux in linuxes:
            translations[ language ].append([linux+"_en",linux+language])
         translations[ language ].append(["English",language])
    -    translations[ language ].append(["license_en.txt","translations\\&quot;+language+"\\license_"+language+".txt"])
    +    translations[ language ].append(["license_en.txt","translations/"+language+"/license_"+language+".txt"])

    for language in languages:

    • Jordan Wiens

      Jordan Wiens - 2006-10-26

      Whoops!  One minor bug.  The INSTDIR line should ~not~ be changed from the original like my patch does or the installer breaks.

      Also, a couple of other suggestions:

      It might be nice to use hiddenmenu and timeout 5 or some other small number for the grub menu.lst to keep users from having to select the same install option twice.  Also, it would be nice to add a "quiet" to the kernel boot line as well to keep the output a little less scary for folks not familiar with the linux boot process.  If they really want to see it, they can always grub-edit the quiet out as long as they have two or three seconds to stop the timeout.

    • jordi_massaguer_pla

      Thank you Jordan!


Log in to post a comment.