From 858312ba2ce3ece8193cbaf959542b3f12eac233 Mon Sep 17 00:00:00 2001 From: Robert Lehmann Date: Wed, 10 Jul 2024 10:36:38 +0200 Subject: [PATCH] opkg-update-index: Fix common linter warnings This patch fixes common linter warnings. Signed-off-by: Robert Lehmann Signed-off-by: Alex Stewart --- opkg-update-index | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/opkg-update-index b/opkg-update-index index a60f4b6..3f36a24 100755 --- a/opkg-update-index +++ b/opkg-update-index @@ -2,24 +2,21 @@ # SPDX-License-Identifier: GPL-2.0-only from __future__ import absolute_import -import sys, os -from glob import glob +import sys +import os import opkg -pkg_dir=sys.argv[1] + +pkg_dir = sys.argv[1] pkg_filename = sys.argv[2] -if ( not pkg_dir or not pkg_filename ): - sys.stderr.write("Usage: opkg-update-index \n") - sys.exit(1) +if (not pkg_dir or not pkg_filename): + sys.stderr.write("Usage: opkg-update-index \n") + sys.exit(1) packages = opkg.Packages() - packages.read_packages_file(pkg_dir + '/Packages') - names = list(packages.packages.keys()) - packages.add_package(opkg.Package(pkg_filename, relpath=pkg_dir)) - packages.write_packages_file(pkg_dir + '/Packages.new') os.rename(pkg_dir + '/Packages.new', pkg_dir + '/Packages')