grim/gplate
Clone
Summary
Browse
Changes
Graph
a good start at the transition of the variable tests, but not done yet...
2009-11-14, Gary Kramlich
2eb5fa071fb6
file is
Executable
a good start at the transition of the variable tests, but not done yet...
#!/bin/sh
PACKAGE_VERSION
=
${
1
}
fail
()
{
echo
${
1
}
exit
1
}
# make sure this isn't a mtn release
if
[
x
`
echo
${
PACKAGE_VERSION
}
|
grep
mtn
`
!
=
x
]
;
then
fail
"Failing to release from monotone"
fi
# make sure ChangeLog is updated, has the correct version, and matches today's
# date
if
[
x
$(
head
ChangeLog
|
grep
-q
"^Version
${
PACKAGE_VERSION
}
`date +%m/%d/%Y`:
$$
"
)
!
=
x
]
;
then
fail
"ChangeLog has not been updated for
${
PACKAGE_VERSION
}
"
fi
# make sure NEWS doesn't have any lines that start with a space
if
[
x
`
grep
"^ "
NEWS
`
!
=
x
]
;
then
fail
"NEWS has lines that start with spaces, this is incorrect"
fi
# make sure there are not any changes in the working copy
if
[
`
mtn
diff
|
grep
-v
"^#"
|
wc
-l
`
-ne
0
]
;
then
fail
"There are chages in the working copy, please commit them."
fi
# make sure we're working from a tag
if
[
x
`
mtn
automate
select
t:gplate-
${
PACKAGE_VERSION
}
`
!
=
x
`
mtn
automate
get_base_revision_id
`
]
;
then
fail
"Refusing to release without a tag"
fi
# yay we passed everything
echo
"version-check passed"
exit
0