mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-03 17:50:11 +02:00
checkupdates: exit with error if fdroiddata git repo is dirty
One key security property of the F-Droid ecosystem is that the sensitive code is all stored forever in git repos and source tarballs. That means we can easily go back and see if there where exploits and where they came from. Therefore, checkupdates should require everything in fdroiddata be committed to git before running. This provides --allow-dirty to override that behavior.
This commit is contained in:
parent
67d386d925
commit
86907d2ebf
@ -174,7 +174,7 @@ __complete_publish() {
|
|||||||
|
|
||||||
__complete_checkupdates() {
|
__complete_checkupdates() {
|
||||||
opts="-v -q"
|
opts="-v -q"
|
||||||
lopts="--verbose --quiet --auto --autoonly --commit --gplay"
|
lopts="--verbose --quiet --auto --autoonly --commit --gplay --allow-dirty"
|
||||||
case "${cur}" in
|
case "${cur}" in
|
||||||
-*)
|
-*)
|
||||||
__complete_options
|
__complete_options
|
||||||
|
@ -572,6 +572,8 @@ def main():
|
|||||||
help=_("Only process apps with auto-updates"))
|
help=_("Only process apps with auto-updates"))
|
||||||
parser.add_argument("--commit", action="store_true", default=False,
|
parser.add_argument("--commit", action="store_true", default=False,
|
||||||
help=_("Commit changes"))
|
help=_("Commit changes"))
|
||||||
|
parser.add_argument("--allow-dirty", action="store_true", default=False,
|
||||||
|
help=_("Run on git repo that has uncommitted changes"))
|
||||||
parser.add_argument("--gplay", action="store_true", default=False,
|
parser.add_argument("--gplay", action="store_true", default=False,
|
||||||
help=_("Only print differences with the Play Store"))
|
help=_("Only print differences with the Play Store"))
|
||||||
metadata.add_metadata_arguments(parser)
|
metadata.add_metadata_arguments(parser)
|
||||||
@ -580,6 +582,12 @@ def main():
|
|||||||
|
|
||||||
config = common.read_config(options)
|
config = common.read_config(options)
|
||||||
|
|
||||||
|
if not options.allow_dirty:
|
||||||
|
status = subprocess.check_output(['git', 'status', '--porcelain'])
|
||||||
|
if status:
|
||||||
|
logging.error(_('Build metadata git repo has uncommited changes!'))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# Get all apps...
|
# Get all apps...
|
||||||
allapps = metadata.read_metadata()
|
allapps = metadata.read_metadata()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user