[Debian-in-commits] [SCM] dh-make-font.git branch, master, updated. 197cb2fff43cd34414433b4bf98cf8ac83679176

Vasudev Kamath kamathvasudev at gmail.com
Wed Sep 19 07:03:35 UTC 2012


The following commit has been merged in the master branch:
commit 33a54f02a716afdead7772e1a7e9530b679b6e24
Author: Vasudev Kamath <kamathvasudev at gmail.com>
Date:   Wed Sep 19 12:07:32 2012 +0530

    Copyright modifying function is finalized

diff --git a/dh-make-font b/dh-make-font
index 702301c..70e226a 100755
--- a/dh-make-font
+++ b/dh-make-font
@@ -171,6 +171,31 @@ def update_control_file(args):
                 with open('control','wb') as fd:
                         fd.write(control_content)
 
+def update_copyright_file(args):
+        """
+          `args`: Command line arguments
+          This function prepares copyright file in debian copyright-format
+          1.0.
+          
+        """
+        copyright_content = ""
+        with open('copyright','rb') as fd:
+                contents = fd.read()
+                contents = contents.split('\n')
+                for line in contents:
+                        if line.startswith('Format:'):
+                                copyright_content += "Format: " + "http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/"
+                        elif line.startswith('Source:') and args.upstream:
+                                copyright_content += "Source: " + args.upstream
+                        else:
+                                copyright_content += line
+
+                        copyright_content += '\n'
+                        
+        with open('copyright','wb') as fd:
+                fd.write(copyright_content)
+        
+
 def create_install_and_links():        
         """
            This function writes install file it checks for availabilty of
@@ -333,17 +358,29 @@ def main():
                 print("dh_make_font: dh_make died so I die.")
                 exit(256)
 
+        # Lets get into Debian directory and work there
         os.chdir(os.path.abspath('debian'))
+
+        # Remove unwanted files for font package
         for dirpath,dirname,filenames in os.walk('.'):
                 for filename in filenames:
                         if not filename in required_files:
                                 os.remove(filename)
 
+        # Write a proper watch file
         with open('watch','w') as fd:
                 fd.write(watch)        
 
+        # Fix control file
         update_control_file(args)
+
+        # Fix copyright ile
+        update_copyright_file(args)
+
+        # Create install and links file
         create_install_and_links()
+
+        # We are done tell packager what he needs to check
         print_todo()
 
 if __name__ == "__main__":

-- 
dh-make-font.git



More information about the Debian-in-commits mailing list