File: setversion.sh

package info (click to toggle)
with-simulated-input-el 2.4+git20200216.29173588-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 148 kB
  • sloc: lisp: 441; sh: 11; makefile: 9
file content (14 lines) | stat: -rwxr-xr-x 485 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

PKG_NAME="with-simulated-input"

TARGET_VERSION="$1"
if [ -n "$TARGET_VERSION" ]; then
    echo "Updating version to $TARGET_VERSION";
    perl -i'orig_*' -lape "s/Version: [0-9.]+/Version: $TARGET_VERSION/g;" \
         -e "s/((?:defconst|defvar|setq).*-version\s+)\"[0-9.]+\"/\${1}\"$TARGET_VERSION\"/g;" \
         -e "s/\(package \"${PKG_NAME}\" \"[0-9.]+\"/(package \"${PKG_NAME}\" \"${TARGET_VERSION}\"/g" \
         *.el
else
    echo "Usage: $0 VERSION_NUMBER"
fi