From a515bb48a081aeb1b6cbe67bfeea3b1a950fd216 Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Wed, 7 Feb 2018 13:29:49 -0800 Subject: [PATCH] Remove the obsolete `reformat-changelog` script --- scripts/reformat-changelog | 66 -------------------------------------- 1 file changed, 66 deletions(-) delete mode 100755 scripts/reformat-changelog diff --git a/scripts/reformat-changelog b/scripts/reformat-changelog deleted file mode 100755 index 899a9fa..0000000 --- a/scripts/reformat-changelog +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env hy - -(import re) -(import pdb) -(import codecs) - -(setv *maintainer-line* - " -- Alexander Artemenko Thu, 30 Sep 2014 13:06:09 +0400") - -(defn read-lines-from-file [filename] - (let [f (codecs.open filename "r" "utf-8")] - (fn [] (let [line (.readline f) ] - line)))) - - -(defn get-version-number [line] - (let [match (re.search r"Changes from.*(\d+\.\d+\.\d+)$" line)] - (if match - (let [version (.group match (int 1)) - numbered (list (map int (.split version "."))) - explicit-mapping {"0.9.12" "0.10.0" - "0.8.2" "0.9.0"}] - (assoc numbered 2 (+ (get numbered 2) 1)) - (.get explicit-mapping - version - (.join "." (map str numbered))))))) - - -(defn read-version-content [reader] - (setv line (reader)) - (setv content []) - (while (and line (not (get-version-number line))) - (.append content (.strip line)) - (setv line (reader))) - [content line]) - - -(defn read-versions-from-file [filename] - (let [reader (read-lines-from-file filename)] - (read-versions-rec (reader) - reader))) - -(defn read-versions-rec [line reader] - (if line - (let [version (get-version-number line) - [content next-line] (read-version-content reader)] - - (+ [{"from" version - "content" content}] - (read-versions-rec next-line reader))) - [])) - -(defn format-deb-version [version] - (setv result [(.format "hy ({}) unstable; urgency=low" - (get version "from"))]) - (for [line (get version "content")] - (.append result (+ " " line))) - (.append result *maintainer-line*) - (.append result "") - (.join "\n" result)) - - -(defmain [&rest args] - (let [versions (read-versions-from-file "NEWS")] - (for [version versions] - (print (.encode (format-deb-version version) "utf-8")))))