File: migration.py

package info (click to toggle)
cruft-ng 0.9.77
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,836 kB
  • sloc: cpp: 1,748; sh: 816; python: 233; makefile: 97; ansic: 82; perl: 75
file content (15 lines) | stat: -rwxr-xr-x 404 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/python3

BASE = '/usr/share/cruft/rules'

import glob
import os
import subprocess

for rule in glob.glob('rules/*'):
    package = os.path.basename(rule)
    dest = os.path.join(BASE, package)
    if os.path.isfile(dest):
        print('%s has been dh-cruft enabled' % package)
        subprocess.call(['diff', '-u', rule, dest])
        subprocess.call(['git', 'mv', rule, 'archive/stable'])