]> git.ipfire.org Git - thirdparty/openwrt.git/commit
build: remove redundant shebang from apk lifecycle scripts
authorGeorge Sapkin <george@sapk.in>
Mon, 5 Jan 2026 22:56:06 +0000 (00:56 +0200)
committerRobert Marko <robimarko@gmail.com>
Fri, 16 Jan 2026 16:13:00 +0000 (17:13 +0100)
commitf74790057f601e4d178bcc2f30065566f549e289
tree3e032b8a093bd20d7d7378f71c54867ab2597140
parent46244b6b0becf2634c2bbef67ec6331c3ed274e4
build: remove redundant shebang from apk lifecycle scripts

Due to the way apk lifecycle scripts are defined, they might end up with
multiple shebangs. Remove them.

Before:

  post-upgrade: |
    #!/bin/sh
    export PKG_UPGRADE=1
    #!/bin/sh
    [ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
    [ -s ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
    . ${IPKG_INSTROOT}/lib/functions.sh
    export root="${IPKG_INSTROOT}"
    export pkgname="adblock-fast"
    add_group_and_user
    default_postinst
    #!/bin/sh
    # check if we are on real system
    if [ -z "${IPKG_INSTROOT}" ]; then
     /etc/init.d/adblock-fast enable
    fi
    exit 0

After:

  post-upgrade: |
    #!/bin/sh
    export PKG_UPGRADE=1
    [ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
    [ -s ${IPKG_INSTROOT}/lib/functions.sh ] || exit 0
    . ${IPKG_INSTROOT}/lib/functions.sh
    export root="${IPKG_INSTROOT}"
    export pkgname="adblock-fast"
    add_group_and_user
    default_postinst
    # check if we are on real system
    if [ -z "${IPKG_INSTROOT}" ]; then
     /etc/init.d/adblock-fast enable
    fi
    exit 0

Fixes: b52e897 ("include/package-pack: remove leading whitespace from install scripts")
Fixes: 03880e2 ("include/package-pack: add missing apk package lifecycle events")
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21369
(cherry picked from commit 1dec4683f6a91cb0734e97186738b0ea413bb356)
Link: https://github.com/openwrt/openwrt/pull/21547
Signed-off-by: Robert Marko <robimarko@gmail.com>
include/package-pack.mk