anonymous group photoblog software
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

22 lines
716 B

  1. #!/bin/sed -rnf
  2. # usage: ./config.sed config.pl > config.py
  3. s/use constant ([A-Z_]+) ?=> ?(['"].*['"]|[0-9\*]+);(\s*#?.*)$/\1 = \2\3/g;
  4. s/^1;$//;
  5. s/^#? ?(use|no) encoding.*$//;
  6. s/^##use constant CONVERT_COMMAND.*$//;
  7. s/^# ffffffff.*$//;
  8. # multiline hack
  9. 1h;1!H;
  10. $ {
  11. g;
  12. s#SQL_DBI_SOURCE = 'DBI:([^:]+):database=([^:]+);host=([^']+)'.*\nSQL_USERNAME = '([^']+)'.*\nSQL_PASSWORD = '([^']+)'[^\n]*\n#SQL_ENGINE = '\1://\4:\5@\3/\2'\n#;
  13. s/\n\n+/\n/g;
  14. s|$|\
  15. BOARD_DIR = \'\' \# Root of board cache relative to document root.\
  16. SERVER_NAME = \'desuchan.net\' \# What's the name of this server?\
  17. DEBUG = False \# Debug mode|
  18. p;
  19. }