2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2013-01-18 13:08:43 +01:00
|
|
|
#
|
|
|
|
# sg3_utils
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2013-01-18 13:08:43 +01:00
|
|
|
|
2016-03-02 22:40:01 +01:00
|
|
|
SG3_UTILS_VERSION = 1.42
|
2013-09-06 08:14:15 +02:00
|
|
|
SG3_UTILS_SOURCE = sg3_utils-$(SG3_UTILS_VERSION).tar.xz
|
.mk files: bulk aligment and whitespace cleanup of assignments
The Buildroot coding style defines one space around make assignments and
does not align the assignment symbols.
This patch does a bulk fix of offending packages. The package
infrastructures (or more in general assignments to calculated variable
names, like $(2)_FOO) are not touched.
Alignment of line continuation characters (\) is kept as-is.
The sed command used to do this replacement is:
find * -name "*.mk" | xargs sed -i \
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#'
Brief explanation of this command:
^\([A-Z0-9a-z_]\+\) a regular variable at the beginning of the line
\([?:+]\?=\) any assignment character =, :=, ?=, +=
\([^\\]\+\) any string not containing a line continuation
\([^\\ \t]\+\s*\\\) string, optional whitespace, followed by a
line continuation character
\(\s*\\\) optional whitespace, followed by a line
continuation character
Hence, the first subexpression handles empty assignments, the second
handles regular assignments, the third handles regular assignments with
line continuation, and the fourth empty assignments with line
continuation.
This expression was tested on following test text: (initial tab not
included)
FOO = spaces before
FOO = spaces before and after
FOO = tab before
FOO = tab and spaces before
FOO = tab after
FOO = tab and spaces after
FOO = spaces and tab after
FOO = \
FOO = bar \
FOO = bar space \
FOO = \
GENIMAGE_DEPENDENCIES = host-pkgconf libconfuse
FOO += spaces before
FOO ?= spaces before and after
FOO :=
FOO =
FOO =
FOO =
FOO =
$(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C
AT91BOOTSTRAP3_DEFCONFIG = \
AXEL_DISABLE_I18N=--i18n=0
After this bulk change, following manual fixups were done:
- fix line continuation alignment in cegui06 and spice (the sed
expression leaves the number of whitespace between the value and line
continuation character intact, but the whitespace before that could have
changed, causing misalignment.
- qt5base was reverted, as this package uses extensive alignment which
actually makes the code more readable.
Finally, the end result was manually reviewed.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-07 09:06:03 +02:00
|
|
|
SG3_UTILS_SITE = http://sg.danny.cz/sg/p
|
2017-04-21 13:18:52 +02:00
|
|
|
SG3_UTILS_LICENSE = BSD-3-Clause (library)
|
|
|
|
# Some utils progs are GPL-2.0+ licensed while others are BSD-3-Clause
|
2013-01-18 13:08:43 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_SG3_UTILS_PROGS),y)
|
2017-04-21 13:18:52 +02:00
|
|
|
SG3_UTILS_LICENSE := $(SG3_UTILS_LICENSE), GPL-2.0+ (programs), BSD-3-Clause (programs)
|
2013-01-18 13:08:43 +01:00
|
|
|
endif
|
|
|
|
SG3_UTILS_LICENSE_FILES = COPYING BSD_LICENSE
|
|
|
|
|
2016-08-14 19:45:36 +02:00
|
|
|
# Patching configure.ac
|
|
|
|
SG3_UTILS_AUTORECONF = YES
|
|
|
|
|
2013-01-18 13:08:43 +01:00
|
|
|
# install the libsgutils2 library
|
|
|
|
SG3_UTILS_INSTALL_STAGING = YES
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_SG3_UTILS_PROGS),)
|
|
|
|
define SG3_UTILS_REMOVE_PROGS
|
|
|
|
for prog in \
|
2014-01-29 14:11:40 +01:00
|
|
|
compare_and_write copy_results dd decode_sense \
|
|
|
|
emc_trespass format get_config \
|
2013-01-18 13:08:43 +01:00
|
|
|
get_lba_status ident inq logs luns map26 \
|
|
|
|
map sgm_dd modes opcodes sgp_dd persist prevent \
|
|
|
|
raw rbuf rdac read readcap read_block_limits \
|
2016-03-02 22:40:01 +01:00
|
|
|
read_attr read_buffer read_long reassign referrals \
|
2014-06-14 13:58:41 +02:00
|
|
|
rep_zones requests reset reset_wp rmsn rtpg safte sanitize \
|
2014-11-18 18:05:17 +01:00
|
|
|
sat_identify sat_phy_event sat_read_gplog sat_set_features \
|
|
|
|
scan senddiag ses ses_microcode start stpg sync test_rwbuf \
|
2016-03-02 22:40:01 +01:00
|
|
|
timestamp turs unmap verify vpd write_buffer write_long \
|
|
|
|
write_same write_verify wr_mode xcopy zone; do \
|
2013-01-18 13:08:43 +01:00
|
|
|
$(RM) $(TARGET_DIR)/usr/bin/sg_$${prog} ; \
|
|
|
|
done
|
2014-01-29 14:11:40 +01:00
|
|
|
for prog in \
|
|
|
|
logging_level mandat readcap ready satl start stop \
|
|
|
|
temperature; do \
|
|
|
|
$(RM) $(TARGET_DIR)/usr/bin/scsi_$${prog} ; \
|
|
|
|
done
|
|
|
|
for prog in \
|
|
|
|
sginfo sgm_dd sgp_dd; do \
|
|
|
|
$(RM) $(TARGET_DIR)/usr/bin/$${prog}; \
|
|
|
|
done
|
2013-01-18 13:08:43 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
SG3_UTILS_POST_INSTALL_TARGET_HOOKS += SG3_UTILS_REMOVE_PROGS
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(eval $(autotools-package))
|