diff options
author | Katja Marttila <katja.marttila@qt.io> | 2020-09-15 15:30:19 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2020-09-16 07:57:36 +0300 |
commit | 244b3c4e92f0909085d5068d5a8c04137068c06b (patch) | |
tree | 0af9f075b6d6fe6e13dc724b56f40428352d432e /tools | |
parent | 88991ee63437788cce465f2a89f9e4c8c9199554 (diff) |
Repogen: Fix repository generation for empty package dir
Change-Id: I5be59799b399fe8bd6655fcf6d7f6efdf5aa5f53
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/repogen/repogen.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/repogen/repogen.cpp b/tools/repogen/repogen.cpp index 922bdfe30..236b0b901 100644 --- a/tools/repogen/repogen.cpp +++ b/tools/repogen/repogen.cpp @@ -156,11 +156,15 @@ int main(int argc, char** argv) return printErrorAndUsageAndExit(QCoreApplication::translate("QInstaller", "Error: Packages parameter missing argument")); } - - if (!QFileInfo(args.first()).exists()) { + const QDir dir(args.first()); + if (!dir.exists()) { return printErrorAndUsageAndExit(QCoreApplication::translate("QInstaller", "Error: Package directory not found at the specified location")); } + if (dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot).isEmpty()) { + return printErrorAndUsageAndExit(QCoreApplication::translate("QInstaller", + "Error: Package directory is empty")); + } packagesDirectories.append(args.first()); args.removeFirst(); |