File: create_orig

package info (click to toggle)
lazpaint 7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 56,000 kB
  • sloc: pascal: 277,538; python: 2,494; makefile: 233; sh: 221
file content (35 lines) | stat: -rwxr-xr-x 1,001 bytes parent folder | download | duplicates (4)
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
30
31
32
33
34
35
#!/bin/bash
dirname=${PWD##*/}
if ! [[ "$dirname" =~ ^lazpaint-[0-9]+(\.[0-9]+)*$ ]]; then
    echo "Parent folder name must be \"lazpaint-#[.#][.#]\" but is \"$dirname\" instead"
    echo "where #[.#][.#] is the app version number"
    exit 1
fi
if ! [ -d bgrabitmap ] || ! [ -d bgracontrols ]; then
    echo "Cannot find bgrabitmap or bgracontrols subdirectories."
    exit 1
fi
if [ -d bgrabitmap/test ] || [ -d lazpaint/release/windows ]; then
    echo "Lazarus custom packages have not been pruned. Call ./prune_lpk first"
    exit 1
fi
archive=${dirname/-/_}.orig.tar.gz
read -p "Create \"../${archive}\" file (y/n)?" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
    make distclean

    cd ..
    tar --exclude=./${dirname}/debian --exclude-vcs -zcvf ${archive} ./${dirname}
    cd "$dirname"
    echo "Done creating ../${archive}"
    echo
    read -p "Launch \"debuild -us -uc\" on the package now (y/n)?" -n 1 -r
    echo
    if [[ $REPLY =~ ^[Yy]$ ]]
    then
    	debuild -us -uc
    fi
fi