File: newruby

package info (click to toggle)
ruby2.7 2.7.4-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 112,576 kB
  • sloc: ruby: 849,454; ansic: 697,834; yacc: 45,100; xml: 25,367; pascal: 10,051; javascript: 6,575; sh: 3,848; makefile: 759; cpp: 713; asm: 333; python: 295; lisp: 97; sed: 94; perl: 62; awk: 36
file content (29 lines) | stat: -rwxr-xr-x 790 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

set -e

if [ $# -ne 1 ]; then
  echo "usage: $0 NEWVERSION"
  exit 1
fi

old_source=$(dpkg-parsechangelog -SSource)
old_version=${old_source##ruby}

new_version="$1"
new_source="ruby${new_version}"
new_api_version="${new_version}.0"

files_to_change=$(grep -rl "${old_source}" debian/ | grep -v changelog)

set -x
sed -i -e "s/${old_source}/${new_source}/g; s/${old_version}.\[0-9]/${new_api_version}/g; s/${old_version}/${new_version}/g" $files_to_change

rename "s/${old_source}/${new_source}/" debian/*${old_source}*

# manpages
sed -i -e "s/\(gem\|rdoc\)${old_version}/\1${new_version}/gi" \
	debian/manpages/* debian/*.manpages
rename "s/${old_version}/${new_version}/g" debian/manpages/*

dch --package "${new_source}" --newversion "${new_version}.0-1" "Ruby $new_version"