From b83413422137f2008575cc2255753c3537356999 Mon Sep 17 00:00:00 2001 From: YZ-Bruh Date: Mon, 22 Jul 2024 08:52:42 +0300 Subject: [PATCH] pmt: Use timestamp instead of architecture in xz package name and use sudo when creating deb package --- SETUP-DEBS.md | 0 build/deb/deb.mk | 10 +++++++++- jni/Makefile | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) mode change 100644 => 100755 SETUP-DEBS.md diff --git a/SETUP-DEBS.md b/SETUP-DEBS.md old mode 100644 new mode 100755 diff --git a/build/deb/deb.mk b/build/deb/deb.mk index 81016ab..c7e1b5f 100755 --- a/build/deb/deb.mk +++ b/build/deb/deb.mk @@ -31,6 +31,14 @@ else ifeq ($(FOR_THIS),32) DEB_ARCH_NAME := armeabi-v7a endif +ifneq ($(wildcard /dev/block/by-name),) + SUDO := su +else ifeq ($(wildcard /system/build.prop),) + SUDO := sudo +else + SUDO := +endif + # controls the presence of file/directory. usage: $(call check_local,,) define check_local # the first argument is taken and controlled by the file/directory with -e option @@ -90,7 +98,7 @@ all: cp $(BINARY_DIR)/$(TARGET) $(DEBTERMUX_USR)/bin || abort; \ printf " - Starting dpkg-deb...\n"; \ sleep 2; \ - chmod -R 755 *; \ + $(SUDO) chmod -R 755 *; \ dpkg-deb -b $(TEMP_DIR) $(DEB_DIR)/$(TARGET)-$(DEB_ARCH_NAME).deb || abort; \ # cleanup template directory rm -rf $(TEMP_DIR); \ diff --git a/jni/Makefile b/jni/Makefile index 167476c..08860c0 100755 --- a/jni/Makefile +++ b/jni/Makefile @@ -134,10 +134,10 @@ all: mv *.a $(STATICLIB_DIR) || abort_build; \ printf "\n - Generating package...\n"; \ cp $(BINARY_DIR)/$(TARGET) $(PACKAGE_DIR) || abort_build; \ - printf " XZ $(OUT_DIRNAME)/package/$(TARGET)-$(ARCH).xz" + printf " XZ $(OUT_DIRNAME)/package/$(TARGET)-`date +%Y%m%d`.xz" xz $(PACKAGE_DIR)/$(TARGET) || abort_build; \ sleep 1; \ - mv $(PACKAGE_DIR)/$(TARGET).xz $(PACKAGE_DIR)/$(TARGET)-$(ARCH).xz || abort_build; \ + mv $(PACKAGE_DIR)/$(TARGET).xz $(PACKAGE_DIR)/$(TARGET)-`date +%Y%m%d`.xz || abort_build; \ printf "\n - Success"; \ sleep 1; \ printf "\n\n ----------------------------------- \n"