/home/crealab/.cagefs/tmp/phpx27FvY
#!/bin/sh
echo 'nodejs(abi16) >= 16.20'
#!/bin/sh -efu

fatal() {
	echo "$*" >&2
	exit 1
}

pkg="$1"
[ -n "$pkg" -a -e "$pkg" ] ||
	fatal "No package supplied"

_dd() {
	local o="$1"; shift
	dd if="$pkg" skip="$o" iflag=skip_bytes status=none $*
}

calcsize() {
	offset=$(($1 + 8))

	local i b b0 b1 b2 b3 b4 b5 b6 b7

	i=0
	while [ $i -lt 8 ]; do
		b="$(_dd $(($offset + $i)) bs=1 count=1)"
		[ -z "$b" ] &&
			b="0" ||
			b="$(exec printf '%u\n' "'$b")"
		eval "b$i=\$b"
		i=$(($i + 1))
	done

	rsize=$((8 + ((($b0 << 24) + ($b1 << 16) + ($b2 << 8) + $b3) << 4) + ($b4 << 24) + ($b5 << 16) + ($b6 << 8) + $b7))
	offset=$(($offset + $rsize))
}

case "$(_dd 0 bs=8 count=1)" in
	"$(printf '\355\253\356\333')"*) ;; # '\xed\xab\xee\xdb'
	*) fatal "File doesn't look like rpm: $pkg" ;;
esac

calcsize 96
sigsize=$rsize

calcsize $(($offset + (8 - ($sigsize % 8)) % 8))
hdrsize=$rsize

case "$(_dd $offset bs=3 count=1)" in
	"$(printf '\102\132')"*) _dd $offset | bunzip2 ;; # '\x42\x5a'
	"$(printf '\037\213')"*) _dd $offset | gunzip  ;; # '\x1f\x8b'
	"$(printf '\375\067')"*) _dd $offset | xzcat   ;; # '\xfd\x37'
	"$(printf '\135\000')"*) _dd $offset | unlzma  ;; # '\x5d\x00'
	"$(printf '\050\265')"*) _dd $offset | unzstd  ;; # '\x28\xb5'
	*) fatal "Unrecognized rpm file: $pkg" ;;
esac
#!/bin/sh +x
# Kernel build can have many thousands of modules.
# kmod.prov is run for every one of them.
# Try to make this script run as fast as we can.
# For example, use shell string ops instead of external programs
# where possible.

IFS=$'\n'

read -r fname || exit

# Only process files from .../lib/modules/... subtree
[ "${fname#*/lib/modules/*}" != "$fname" ] || exit 0

kmod=${fname##*/}  # like basename, but faster

if [ "$kmod" = "modules.builtin" ]; then
        for j in $(cat -- "$fname"); do
                echo "kmod(${j##*/})"
        done
        exit 0
fi

kmod=${kmod%.gz}
kmod=${kmod%.xz}
if [ "${kmod%.ko}" != "$kmod" ]; then
        echo "kmod($kmod)"
fi
ELF>`6@��@8@@@@hh���`�`� h�h� h� � ���� �� �����  ���DDS�td���  P�td`�`�`���Q�tdR�tdh�h� h� ��/lib64/ld-linux-x86-64.so.2GNU�GNUGNUM�$�WM2s�R�������!T�@ TVBE���|�qXyT�n;P"�:���}I	��D��k��mb��[�%��x_�#��c���	��,3�g�A�0��V<��+� s��w�+ J: :zs�h� ?� �h� librpmio.so.8_ITM_deregisterTMCloneTable__gmon_start___ITM_registerTMCloneTablerpmDigestFinalrpmDigestUpdatepgpHexStrrpmDigestLengthrpmDigestInitlibbz2.so.1libz.so.1liblzma.so.5libzstd.so.1liblua-5.3.solibm.so.6libelf.so.1elf_versionelf_flagelfgelf_getshdrgelf_fsizeelf_nextscnelf_getphdrnumelf64_xlatetomgelf_getehdrelf_getdataelf_ndxscnelf_errmsggelf_getrelaelf_flagdataelf_begingelf_getrelgelf_update_shdrgelf_update_relgelf_getnotegelf_getsymgelf_getphdrgelf_update_ehdrelf_updateelf_getscnelf_kindgelf_update_relaelf_newdataelf_endelf_errnolibpopt.so.0poptFreeContextpoptGetContextpoptBadOptionpoptPrintHelppoptHelpOptionspoptGetArgspoptStrerrorpoptGetNextOptlibdw.so.1dwelf_strent_offdwelf_strtab_initdwelf_strtab_freedwelf_strtab_add_lendwelf_strtab_finalizelibcrypto.so.1.1libaudit.so.1libdl.so.2libpthread.so.0close__errno_locationopenlibc.so.6exitstrncmpstrrchrtfindputs__stack_chk_failreallocabortstrdupchmod__assert_failcallocstrlentsearchmemset__fprintf_chkstdoutmemcpymallocstderrfwritetdestroyqsort__cxa_finalize__xstatstrcmpstrerror__libc_start_main_edata__bss_startELFUTILS_0.167LIBPOPT_0ELFUTILS_1.6ELFUTILS_1.3ELFUTILS_1.0GLIBC_2.3.4GLIBC_2.4GLIBC_2.14GLIBC_2.2.5	
� '��	�N �
T��@���
����
����
��Pti	
�ii
	�����ui	�cui	�h� @7p� 7x� x�  � ��0� �� @� �P� �`� �� p� ��� 
��� �� �� (��� 2��� |� Р `�� �� p� � ��� %� � x� 0� Ј`� ;��� [�� I� � W�`� c��� r�� �� � ��`� ���� ��� �� � Č`� Ҍ�� �� ߌX� Pw`� @wȟ П 	؟ 5� H� L� N�� PP� h� p� x� �� �� �� �� �� 	�� 
�� �� 
�� ȝ Н ؝ � � � �� � � � �  � (� 0� 8� @� H� P�  X� !`� "h� #p� $x� %�� &�� '�� (�� )�� *�� +�� ,�� -�� .Ȟ /О 0؞ 1� 2� 3� 4�� 6� 7� 8� 9� : � ;(� <0� =8� >@� ?H� @P� AX� B`� Ch� Dp� Ex� F�� G�� I�� J�� K�� M�� O�� Q�� R�� S��H��H�A� H��t��H����5� �%� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1�������%�z D���%�z D���%�z D���%�z D���%�z D���%�z D���%�z D���%�z D���%�z D���%�z D���%}z D���%uz D���%mz D���%ez D���%]z D���%Uz D���%Mz D���%Ez D���%=z D���%5z D���%-z D���%%z D���%z D���%z D���%
z D���%z D���%�y D���%�y D���%�y D���%�y D���%�y D���%�y D���%�y D���%�y D���%�y D���%�y D���%�y D���%�y D���%�y D���%�y D���%�y D���%�y D���%}y D���%uy D���%my D���%ey D���%]y D���%Uy D���%My D���%Ey D���%=y D���%5y D���%-y D���%%y D���%y D���%y D���%
y D���%y D���%�x D���%�x D���%�x D���%�x D���%�x D���%�x D���%�x D���%�x D���%�x D���%�x D���%�x D���%�x D���%�x D���%�x D���%�x D���%�x D���%}x D���%ux DH�%�!�������f.�f���AWH��E1�H�
�x AVAUATUSH��H�= cH��dH�%(H��$�1��*���I���L���������t���
L�����H��H����H�8��H�hH����L�|~ I�;��H�s~ H�8H���H�@~ H�D$(H�H����H�4~ �2�����8��
H�.~ H�8H����I�;H��tH���H��} H�8H��t���A1����H�_w �H��H�D$�������
H�t$H��$���������H�\$��$H�߁΀����H��1��'����D$�����|$1Ҿ���I��H���t
H����������H��$�L��H��H�D$@����H����
��$���f���
��$�H�xHk�HH�������H��H����
L�l$pL��L�������&
H�|$p�
H�SP1��"H�t$@H��E1��H�D$pH�{L�3H�|$X�H�C`���$��AH�H��H���H�CHH�����taL�d$H�l$ H��L��I��DH�EHL��H��N�$�����L��I��@I�$H�EHJ�<�I���Y�����$�D9��H��L�d$H�l$ H�|$�U���1�H�CP�Z���f�{DH�CpH�ChH�CxHǃ�Hǃ�Hǃ�Hǃ�Hǃ�Hǃ�Hǃ�Hǃ�Hǃ�H�D$ �M	H�D$hA�H�D$8L�=`H�D$H�D$`H�D$0L��I��H�D$HH���2���uH�{ ���tH�|$ �)f�A�FDH��9���H��H��A�����u�A���A�vFL���V�L��H����€�����H�ƹH�=w_�����u�L���I$�H�pz H�D$(H�H���0���H�xz H�8H���Z���H����=���H�L$H��^1�1�1��8���L��� ����|$��������DL��=Wz u	�=Mz t
H�S`H����H�;1�����H����H��y ���tH�|$ ��H�;�����H����H�;��������|$�[�����$H�|$���H�{P�q���H�{h�HH����\���H����P���H���H���H�=�w H��t@H�_8�/���H��H��u�L������1�H��$�dH3%(�H�Ę[]A\A]A^A_�@H�Qr H�L$�H��YH�81��������H�D$ A��������I�>H�����1�H���|���H�D$P1�L�D$H�L$0L��H��H�|$P����H��������|$xuփ|$pu�H�t$PH�T$`H��<GNUu�H�L$hH�t$ H�L$H�L$tH�L$8�L�=�_H�\$H�D$hI�o�L��L�|$8D�sD�����L9�t5H��H9�u�H�L$8H�5YH�Nq �H�81���������H��w H�\$�(�����=�w uH�D$(H�8�vH�D$ H�T$81�H�|$HH8��1�D������I��H�D$(H�0H��t1�H��H���L��H��H��H�P����H�|$@�S
f�H��H�t$XH�D$xH�|$p�L��L���$�HDŽ$�@HDŽ$�HDŽ$���H���f�{@�D$xHDŽ$�8L�|$@tPf�H�;L������H�����S
L��L���K�H����H��$�H�t$pL�����*����C@9�|�E1�f�{D�D$x	HDŽ$�@��H�CHJ�,�J�<���L���S
L��L��H���o���o���o���o�)�$�)�$�)�$�)�$�HDŽ$���H����H��$�H�t$pL���e��$�t'H�CH1�H�<(�|���H����H�PH�0L���4��CDI��D9��#���1�H�t$hL��L����L�|$ H�T$8H�t$hH�|$HI?�U�H�|$h�;��L����H�D$ H�t$8H�|$HH8�r���H��H����H�����@���L�3L�{(��L���1���I�fDH��L���
�H��H��t7L��H���
�H�����@t�1ɃxH�PtH�H H�
I9�LB��H�\$PH��fDH��L����H��H���L��H����H��H���g�@u�L�@ H��L�D$���Hc�q L�D$M��H9�Hc�o LDbq H9�H�E0LD�o H��tN�L8�H��I!��}H�E t~O�<I9���L9Mt01�H��L�L$0L�D$���H���H�L�L$0L�D$L�E H��H��L�M����������+�H��X1��H��1���M��I9�u�L9Mu����L9M�r����������L��H�\$P��I�T�H��H!�H9C0�:���H�C0H�t$XL������!�������H� X1��H��1���H�L$H��W1�1�1����������c�H�"W1�1�H��1��������L�����������*�H�SS1�1�H��1���H�{P�l�H�{h�CH����W�H����K�H���C�����H�	W�1�1��9��������H��V1�1�H��1�������H�D$8H�D$H�������H��V1��H��1���������_�H��RH������H�k L��1�H�0������H�+���1�L��H���;�I��I�ؾH��H��j H�QH�81��%��[�H��j �+�H�=sQH�����1��\�����H�PVH����������<�����H�eVH������!����z�H�0VH����������8�/�H�L$�H�VQI��H�j H�81��j���H��i ��H�=�TH�� ��v�H��i �6�H�=�PH����L�H��i �6�H�=,PH�����"�f���1�I��^H��H���PTL��GH�
_GH�=��Zi �H�=�o H��o H9�tH�6i H��t	�����H�=�o H�5�o H)�H��H��H��?H�H�tH�
i H��t��fD�����=]o u+UH�=�h H��tH�=Vc ����d����5o ]������w�������G�����	��ff.�f���������G	��ff.�f�����f���������f�7�����7�f���f��f�7�@��Ή7���������H�H9r����������f����9����Ð�H��I��/��L��������.t[��/t&fDH��H���Q����t��/u�/u�@�/�WL�GH�q��/u@I��A���/t�H��L���D�GE��t&A��/t A��.u��W��tR��/tM�.�fDH��E����I9�r�@H��I9�t	�y�/t�I��L9��	A���L�A�M9����y�/t�UA�8/��I��M9�u�M��A�8/���.�WH��H���Q����/��������DA�x�/tM��M�P�M9�u�M��I�pH9���H��������/uH�����/t�L�����w��@A��/��fDH�����/t��W���M9�r����/�WH�OL�N��/tCH���&���L�H�.A��A�8.�q���A�x.�f����.�WH���QI�H�� ����/t�F/�WH�OL�N��/u�H��H�����/t����D�����L���T��������1�H9Ѻ������B������ff.��������H�H9r�������������H�H9r������Hc�H��H��H9��vlUSH��H��H�GHH�,�1�f�H����H��H��t0H�H��t�H�NH9��H�VH�H9�s�H)�H��H�[]�fDH��1�[]��1��ff.�f�������ATI��H��USH���N�H��L��H��H���]�1҅�uI�,���t</t1�[H��]A\�fD</u�@H���:/u�H���:/t���ff.��AUI��ATUH��SH��L�g0M��t
H�W8H���vz�@�P�H����H�}(��M��tI�$H�E0�1�H�H�E8H��H�H�u@D�lH��H������z�H��tOH9t H��1�H��[]A\A]�H��L��H��H���H�E8H��H��[]A\A]�DH�E(M���t����s���H��A���p��{�H�\A��01��V�fDAWAVAUATUH��SH��H������H���fH9-_f ��I��H�'i H-8f H��H�0�5���H�$H���xH��h H�8�y�H�<$H���m�L�{I��H�EN�D0M��H�D$LD�M��M��t9I��@w0H�S H��@w#�@H)�I9�wH�JL��H���Sf�I��@�@IC�H����H���H�{H���M��tI�H�C��L�H�H�S I����H�$h H��L��L�H�0��M��uV�EH�;L��L�����H�¸H����I�T$H��[]A\A]A^A_��H��1�[]A\A]A^A_��H�|$H�4$�E/I�VL����DH�C�;����H����H�;H��H�P�I�H��1��s����H��?��1��@�H��?��1��(�H��H��I1�1����AWAVI��AUATUH��SH��XHc^$H�t$1�dH�%(H�D$H1�H�GHH�<�H������1�I��H�EHH�<���I�V0H�g I��I�F(L�5�f H�I�H9�suH�L$L�l$0H�$D�hL��L�����H�����t$<H�$L����H����H�L���L��@H+D$H�D$@����tpH�H��H�I;r���L����H�D$H�x(���H�D$HdH3%(uuH��X[]A\A]A^A_ÿ�����e�H�wH1��H��1���������C�H�D>1��H��1���������!�H�OH1��H��1��y��D�@UH��AWAVAUATSH��hH�}�H�U�dH�%(H�E�1�H�E�H��tBH�ыH����������!�%����t������D�H�QHEщ��H�E�H��H)�H�U�H�E�A��L���H���M���7L;(�bL�H0M�C�1��fDI�	H��I��0I9��<I9�u�L��H�u�H;���=K�[H��H�1�L�(L�hH�@f�PH�` H�E�H�` H����I9��8N�4+H�U�L���vd H�u�H�U��F��M�|H�L�I9���H�I9��I�~�@d H�u�I�~�P�f�F f���+�d H�u�I�^
�F$��H�I9��+H�]�A�F
f�{ �C(I�FvA�VH�]�I�F�S)�H�]��S*�P�S+�P�S,�PH�D�S-I9�H�E��H���H�E�1�f�x �@-�DH�M�L�L
�^ A�9M���qH�@c L�M��L�(H�%c L� f.�L�����I��M��t]M��tXL��L��� ���H��tHH���s��L��H�E��g��H�u�L��H��H��H��H�|0H�u�HE�L���FH�HF�6��I��O�|7��A�?u���L�}�H��H��H��H��H��H��H���H)�H��H9�tH��H��$�H9�u�%�t	H)�H�L�H�D$H���A�?I��H�E�H�EI�$�K��M�<�L���X���M�|��A�?u�]�H�E�M�wH��H�E��A�>�6L��E1��[��1�L�`H��O�<&fDI��A�W��Ѓ���A	ń�x�"~iA�����H�E�E��H��;H�HP1�1�1��v�1��f���1�H�M;1�1��\�1�H�u�dH34%(�H�e�[A\A]A^A_]��D;m���H�/a H�0H��teH�a H�H��H�U�tRL���,���H��tEH�����H�U�H��x���H���l��H��x���H�u�H��H�TH���FHE�HFL)�H�FH�E�N��L��L�U��.��I��H�E�H�<L����L�U�H��H���A�>/�QI�EA�:/H�E��WH�}�I���L��L��L���C��H�}�L��L��B�(/H��,��H��H�����L�%�Y E�$A���tpH�` H�0H����H��D�E��!���D�E�H��I���	L��D�E��e��D�E�L�hD����A�<$L��L���!��H���tI�I)�u�H��M�����DI��A�~�x�DI��A�~������I��A�~�x�����I���w����H�U�H�u�H��L��x����9��H�E�L��x����/L�\����L��L��H��������DL��L��H�����H�}�L��L��B�+/H��������fDH��^ H�0H���%���H�����D�E�H��I���
��������H�u�H�]��F��HFH��f�~��� ���H�E�H�iA�1�H�HP1��]��1����H�4RH��H��H������H����H�u�H���L���H���@���H�E�M��H��61�1�H�HP1����1����H�E�H�7H�HP1�1�1�����1��x����E�������1���H�]�D��H�7H�KP�#���1����H�E�H�
7H�HP�H�E�H�^@H�HP�H�E�H�x6H�HP�H�HPH�7�v���H�6�1��G��1�������E�����UH��SH��H�H��tfDH����H��H��u�H�}(H��t�H�����H��H��u�H�}���H�}@H�5��/��H�}H��[]���ATI��USH���Q�H��t4H9�Y v0H�Y H��H���!��I�<$H��H�P�a��H��t!H�E[]A\�H��H��>1�1���[��H��4���E��DPXH�
gC��H�5<?H�=G?H���k��ff.�AWAVAUATI��USH��Hcn$dH�%(H��$�1�H�F(��tH��tHH�)\ H�I�T$0H�\ H�H��$�dH3%(�lH�Ę[]A\A]A^A_�fDHcF I��1�H��H���H�D$H�GHH��H���6��H�$H����H�8��H�4$H�����H����H�$H�x��I��H�$I��M�I���H9A�PH�M1�H��I�tHc�H�ÉD$H���
��A���H��H�D$0H�4[ �H����A��I�GH1�H�<����I��H����H�8��H��I�GHL��I�/��H�T$H�<��J��H�T$H��H�D$8�OI�}�%��H��I���I9E��H�-�Z H�D$0H�E����H�D$pE1�H��H�D$H�D$PH�D$ H�D$@H�D$(���H�T$ H�<$D�����H�t$XH�T$H�� L���!�����	���D$v;�V t;qU t;)U u~H�D$xH�T$XHD$`A�GA��f������f��>����f=�t
f=&�����	H�UH�D$PH+D$ID$H�H�EH�T$`H��D�p��P�H�EA��D9t$�
���	����H�T$(H�<$D�����H�D$@H�t$HH�D$`H�D$PH�t$X���f.�f��+t0f��2uv��e�d����kf�f��w*f���@���f��uL���:������1����8fDf��t�r*f��r$���������	����fDf=���I�OPM�$1��H��31��1���H�|$x�`���A��D9t$�����DH�}H9|$0��H�D$0H�
e��H)�H��H��H���n��H�EH�D$8H�D$8H�L$0I�D$0H�X I�L$(H���f���
�P����T���f����@����D���f����-����1����H�|$0�^��H�EH�D$0�H�
�>�H�5Y:H�=i2������H�
x>�
H�55:H�=j:�h��H�
Y>�H�5:H�=�1�I��H�
:>�H�5�9H�=�1�*������I�OP�H��9�01����H�
�=�H�5�9H�=21����H�
�=�H�5�9H�=�9����H�
�=�H�5|9H�=�0���H�
�=�H�5]9H�=�0���AWAVI��AUATUSH��dH�%(H��$�1�H�=1Q H�2Q t0�H�H��@H�@��@��@�H�x�u���U fA�~D�RA��f.�A�FDI��D9��.L��D��H��A���u�I���t�A���A�vFL�����H�=�8H��H�$��€�D��E���	fA�~u�A�����	�W���o���H�4$�H�=�8��€����O���H�=P H�7H���<�����H�<$L�->P ��E1���H�DH�$�f.�I��@I�u�A��H�������H�<$������u�A���3Ic�H�=�O I��H���l$A�FDD9�����A�F
<��<��H�D�H��T H�f�H�wT H���H�aT H���H�KT H�=CO ���D$oL�%�:�D$�$L�t$�<$��H�|$H�5O L�=O ����H�O ��S L�H�D$HI9���#I�GH�D$H9D$H�M��L��I�^��S ��I�|H�L�H�|$ H9��H�|$HH9|$ �H��I�^��S D��A�@�D�eS ���H��kS L�-�S I�uH���o��H;
�N �
E�F
�)S D�������D�S ����H
IN H�z��2I��H�5[�H�
���O$H�D$0H���L�l$1�1��I��A�V��Ѓ���	Ä�x�"������\���H��H��� �H�|$0�H���@�5(H��H���H�8�1�1��f�I��I�v�V��Ѓ���	DŽ�x�#�����A�
M�I��H��}f.�1�E1�I��A�v������A	�@��x�"�DE����D9h�A1�E1�@I��A�v������A	�@��x�"�dA���BA��v
A�� �2HcHH��H�ȃ�D�y�PD�A�\���@H�QL H�0L�h@H��u�0I��@I�u�A��H���H�<$�B����u�Ic�H�=L H�D$H��H�H�xI��tNA�����@�E��I��H���H!H�4H�
�N I�E�DH��H�A8H��u�L�i8I�FH1�N��L��L�D$�I��H���� H�8L�D$�� H��L��H�D$�!��H�L$H���G H�y�� I���H9A�w H�I�MI�EH�AA�m I�EL�l$H�#K I��J�<(�D���@I�NPL�$1�1�H�u+1������!����H�4$H�=/3���I�NP1�H�631�1�����H��$�dH3<%(��H�ĸ[]A\A]A^A_��A�����D9h�����A��
H��Ic�H�4����H�������L�t$I�NPH�p.�1�1��"��H�|$0�(!�1fDL�t$A�����I�NPH��21�1�1�����H�|$0� ��:���D9����L�t$H�V+1�1�1�I�NP�����DH��N H�:H9��~���H�H9�v"H�V�H��I�UH9��a���H��H�J�H9�r�H9��K����VH�
�N Ѓ9	E��4����=�N �j�=�N �]�=zN �PL�t$�=hN t{H�=GI ������=JN �N u	�=6N tIH�=L ���V���=N ��M t H�=lI ���-����M �|$�#�|$otH��K H��L���o�H�[8H��u�1�������������H�.��H��M H�`��H��M H�r��H�kM H�t��H�UM ����L�t$����H��1�f�I��A�V��Ѓ���A	DŽ�x�E������"��H�+�0���H�|$H�5�G L�=�G ��H��G ��L L�H�D$HL9�����D$�
L�t$H��+1�1��I�NP�z�����H�5�G L���V�����A��H�rJ 9P �mH�@8H��u�I�NPH�M+1�1���'���r���H��L�t$�������L�t$D�E1�1�H��(1�I�NP����H������H�|$0�����f.�H�D$A��1�1�H��/E1�H�HP1����H�|$0�L;t$H�xI�FH�D$H9D$H���L�t$H��'1�1�1�I�NP�k�����L�t$H�b$1�1�1�I�NP�K���a���L�t$H��.1�1�1�I�NP�+���A���L�t$H�r$1�1�1�I�NP����!���L�t$H�=aF I�NPtH�,'1�1�1���������h$�$���H��.1�1�1���������I�NPL�$1�1�H�j&1��������H��$�L�l$L�t$H�D$8f�L;t$ ����1�1ɐI��A�v������	�@��x�"��DŽ$����������H�t$8H�|$0�I��H����	D�XE��~��D$1�H�D$�D$(fDA�t�A�l���������x���A�O������<��	ȃ�����t	���J�� ������Ic�L�>��DI��A�~�x�DH��A9_��$�Ń�#l$(��u~H�wI H�|$H�0H��tjH��teH��B D�A���D�D$(tP�k��H��H��tC�8t>H�����D�D$(L�xD���	H��B �8L��H���t��H���tH�I)�u�fD���UH�|$����M���U����!�������������H�=�E ��L����H I�}H���jD�$E������H;5�E �NH�|$H��H-�E H�t$@�U��H�����H�D$H�YH H�8�
H�D$H�hhL���mH I�uH���5��H���^�fDI�������=!H u�HcH I��h���1�1�@I��A�V��Ѓ���	Ƅ�x�"�FH�
?/�lH�5�*H�=�+����1�1�@I��A�~�������	�@��x�#M���������t	�������L����G I�u������D$H����D�$E����A�t��D$(�<���@I������I���w����A�M�t�b���f.�L���G ��M�t�C���L����F ��M�t�*���f�I���������$����T���L9t$ ����������=�F ��A�t����f�H��F H�8H9�����H�L9�s"H�F�H��I�EH9������H��H�H�I9�w�I9������F�L$H�5lF ��>	D��D$���H�|$����L���F��H��H�D$H��E H�(H��t9H��E H�H��H�D$@����H��H�����$��������E L�����M�t���@�������I����DH�=�B ��L����E I�uH���+D�$E��uvA��L;iB ��H�-LB Lŀ}/uH�|$�CH�D$H�hhH�E H�8�����L��H������������$E I���J���f��<$���~����=E �����L����D I�uH���O�D$pH�D$H�|$pH����H����1��H���%H�H�x�\��I�U��H��tH�
�D H;s	L;2�aL��I���gD ���f.�H�yD L�L9������H�I9�v"H�W�H��I�UL9��f���H��H�J�I9�w�I9��P����W�4H�=D �8	��D��6���L����C I�}�����H�����H�D$1�L���L���L9��e��J�H��H�IH��L�L�L9�rBL9�wkI�MH�pH��tH��C H;s	L;1�JL���sC A�t�������\���L��H9���L�I��K�RH��L�L�L9�r�I��L��L9�v�H�y�d���f��$�`������X���H�L$�1H����������!�%����t��H�T$`�����D�H�qHDΉ�@�H��H��H+L$H�L$X�-���H�T$`H�D$PH������L�T$PH�L$XH��M�DMD�L9��H��; L�D$@I��H�L$H��H�81�������H�D$H�t$@H�xh�������@���I�����H�bB H�:H9�����H�L9�s+H�Vf.�H��I�UH9������H��H�J�I9�w�I9�������VH�
 B Ѓ9	E��o���H�
�A L�L9����H�7I9�v%H�O@H��I�ML9�����H��H�q�I9�w�I9�������OH�5�A ȃ>	E����H��A H�:H9������H�I9�v%H�V@H��I�UH9��~���H��H�J�I9�w�I9��h����VH�
`A Ѓ9	E��Q���H�<A H�:H9������H�L9�s%H�V@H��I�UH9������H��H�J�I9�w�I9�������VH�
A Ѓ9	E��k���H�T$�t$H�|$������������@ ���L��H��L��L�D$XH�L$PL�T$@�O���H�L$PL�D$X�/L�T$@L)�H��K�<�������L�t$D��$�H�3I�NP��H�c@ �8	���q�@ �x���H�
D@ �9	���B��? ����/H��L�D$�z���L�D$H9�tnH)�L�D$PH�xH�D$@躾��H�T$@H��H��H��H�D$肽��H�D$@L�D$P�D�_���+qL����? A�t�������s���+rL���o? �*���H�=4#L�D$@葿��L�D$@H�D$�����7? �D$�4$��t[�=R? u
�=H? ��H�== ���$�X��tR�����=? L�t$���=
? �����=�> ���=�> t
H�=�< ue��=�> tML�|$Hc�; I�GHM�ohH�<�H��; H�@�۽��L��H��H��譼��H�EH�z; H�EI�Gp�$�:�f�H�I< H�D$ H��$�H�D$(H�\$ H�|$H����H��H�[�> L�pI�L9��E1�A�D��E��A��DE���dD�+Ic�H�kE���A����H�=�$Jc�H�>���H���}�x�H������H�\�|@H��H�]�{�x�$H��= H�߅��^��L��= I�8H������$�H�D$H�F��H�|$(L�D$H������H����H�H�x���L�D$��I�H��tH�=5= H;s	H9�JH���< H�]��H�I9���H��D�+H�kE����I9���H��H�]��< D�E�ȍA�D�ƒ��A�����A���A�E��t$H�D$H�A�1�A�H�HP1��9���E���i����$��uqIc�H��W���H��H���{�x�fDH���{�x�A�I9������< �|$o��E�@�|$oH�D$ H�@8H�D$ H�����������DH���; L�< M�M������H�D$1�H���L���L9��L���J�H��H�RH��H�L�L9�r;L9�wdI�H�pH��tH��; H;s	H9��H��[; H�]�c���L��H9���L�I��K�IH��H�L�L9�r�I��L��L9�v�H�z�k�����L�?; I�H������H�D$H�]H�xh�������H�; L�M9�����I�9H9�v#I�QI��I�L9������H��H�z�H9�r�H9�����A�QH�5�: Ѓ>	E�����H�����H��: L�L9�����H�7H9�v$H�W@H��I�L9���H��H�r�H9�r�H9������WH�5i: Ѓ>	E�����H�5E: H�>H9�����H�2H9�vH��I�H9������H�2H9�r�H9����H�5: �>	�(	�B����H�: �8	t*�r��9 �Z���H�5�9 �>	t �B��9 ���+rH���9 �.�����H��+r�{9 ���L�t$H�*1�I�NP��L�t$H��1�1�1�I�NP�����2�D��H�)1�1�����L�|$Hc
�4 H��4 I�WHH�<�H�H�@H�L$ �O���I���H�D$(H���۷��I���H����H�|$L�|$(�0H�
���I�_H���I�H���H�14 H��H������H���M�/��H�D$L���XA�x��H����A�@L��H�ލP�"���A�F��I�H�|$H�D$H�D$H;���?H�D$(H�H�|$H�\$ L�H�|$I��L��L��H)�M��II�~A�xI�@�n���A�vL����7 A�v I�}��7 A�v$I�}Av��7 A�F(I�}A�E
fA�~ v
A�F)I�}A�EA�F*1�H�o�A�F+�GA�F,�GA�F-�GfA�~ �ƒ�H�H�\H���O��LH��t��U��HA�F-H��H�Hŀ;���f.�H��6 H��H�0���I��H��tnH��6 H�0H��H�t$8�?���L��H�D$0�2���H�T$0H�t$8H��I��荴��H�D$0H�H�hM�����H�����H�\�;t*A�~�x���H�����H��H��L�hL��L��;������EA�FL�{L�m����A�FL��L���XH�D$ IH)�H)�L��H��I���������/H��L��L�����J�D-H�h�[���H�H��H��H��H�W�H��H�T�H)�H�T�H�H)�H��H���H�����{��L�t$0���_H��5 L��H�0���I��H���AH�h5 H�0H��H�t$8���L��H���ձ��H�t$8H��L��H��L��/���L�kH����L��觱��1�M�|1�I��A�w������	�@��x�"~�����I���ʀA�U��ƒ���u�A�UI�u1�1�I��A��������	�@��x�"~�����H���ʀ�V��ƒ���u�H�~1�1�I��A�w������	�@��x�"~�����H���ʀ�W��ƒ���u�A�?L�otOH�D$0�@���L��记��L��L��H�XH��I��	�������/L��H��L��I�\-L�k�������L�t$0A�EI��I�������U�T��T����Hc-y/ �����L�|$1�I�GHH�<��i���L��1�H��H��H��L����L���H�EH��L�lL���L$ I��H��I��H���t���H��H���bM9��=E1�L��$�H�D$H���1f.��ۯ��H��t7H��$�D�mI��H��H�E�M9�vI�|$ L��D��H��u�����H��uɃ��g���H�y1��H��1�迲���T�f�T����H�l$�L��E1�H�
	��H���!���H�D$pL�t$0H�D$H�D$(H�D$H���|$ D�t�H�T$(D��H������H���h���H�t$pH�D$L���M9�sQL���K�|mH��I�8I�|80H�D�RN�TI9�r�=DH��H�H��0�JH�LH9�s!I��M9�u�H�A1��1��˱��H�zH)�H��H�HB�|$ ttH�T$(D��H��H�D$p������tuH�D$H�D$H9D$0����H�ߺ����H���W����R�f�L��D��H��肯��H���j���H��$����L��D��H��H��$�薯����u���誮��H��1��H��1�����H�
k���L��H���{����e�����L�t$�H�(�01�I�NP�ð��H�پ�H��誰��H�
�3H�5�H�=��ۭ��B���D��H�>1�1���h���H�1��1��S������L�t$H�21�1��I�NP�0���L�t$I��1�H��
1�I�NP�����$�X�������H�
���H�5�H�=R
�-���H�
f��H�5�H�=
�����D$������H�
8��H�5�H�=%
���H�
��H�5�H�=�����|���I�NP�H�D�01��S�����������f���H��H���@��1�H9����H�
�- L���L��H)�H��H��H��?H�H�H�4�H;>v%�IH��H)�H��H��H��?H�H�H��H98rH��H9�u�H�H9�r��I��H�HL9�u�L����H����PH��' H���H�CH�81��A����|���ff.����AVI��AUI��ATI��US�6����H�H���ī��H��H��t,�H��诫��H�CH��t&H�k L�3L�kL�c�C@H��[]A\A]A^�@H��1������@��ATI��USH�H�Gt2�_ ��x*Hc�H��H�<(H��v
A�T$I�D$��H�����u�H��萬��[L��]A\鄬��@��ATUSH�H�W H�Gt>�Ճ�x7Hc�I��H���H�<H��v
A�T$I�D$��H�����u�I�T$ [H��]1�H��A\����f���AWAVA��1�AUL��ATUSH��L� L�G�G8I��I�,�H����H��I��I��H��tH��A�T$��uiM�D$I�O�L��1�H��A�L$<D�rD��B�3A�L$<H��L9�rD)���I�,�H��t&H��t�L��H��A�T$��uA�L$<M�D$�D1�H��H��[]A\A]A^A_�@��UH��SH��H��H���H��H��H�߉�[]�������AWA��AVI��AUATUSH��(L�o L�OH�t$�L$����I�M�L��1�A�F8H��L��E1�j1�I����I��f.�H��I�H�8H��tDH��t.H�t$A�V��uiM�NA�/A�F<I��L9�r�E)�D���@M��LD�����T$���I�F(M���I�$H��(L��[]A\A]A^A_�@I^I�����I�F(K�|-J�/H��H9�����K��L�L$����A�N@L�L$I�F ����I�F0I)F(L��I�F0L�eI��vZL�L$L��A�I�N 1�I�~A��L�L$L�Y�L��I��L�Ѝr1�H����H���`����2H��H9�v;L��I�H��u�M�"H��H9�w�L���K���M�n M�N�`���fDE1����)��@I������H��裧��H��t�I�FL�L$�-�����ATA��UH��SH��H���D��H��H�߉�[]A\����fD��U1�SH��H�����H�8H��tH��H�CH��t��H�EH�C0H��[]�f���USH��H�GH9��h���H�W H��H��H��H9��Q���H�>H���D���H�CH��t��H�EH�C0H��[]�fD��AUI��ATI��USH��H�_H�G H�,�H�;v
L��H��A�Յ�t	H��H9�w�H��[]A\A]�f���H�G ����H�G(H+G0����G8��t�W<f�f���H*��H*��^��f����AWI��AVI��AUA��ATL�%l UH�-l SL)�H��菟��H��t1��L��L��D��A��H��H9�u�H��[]A\A]A^A_�ff.������H��H���Couldn't allocate new string entries blockCouldn't insert new strtab idxCouldn't allocate new string storageCould not create new string table entryCouldn't update relocations: %sCouldn't add more debug_line tables%s: Invalid .line_table offset 0x%zx%s: 64-bit DWARF not supported%s: .debug_line CU does not fit into section%s: DWARF version %d unhandled%s: .debug_line CU prologue does not fit into CU%s: .debug_line opcode table does not fit into CU.debug_line offset 0x%x referenced multiple times%s: Wrong directory table index %udata != NULL && data->d_buf != NULLelf_getdata (scn, data) == NULLdata->d_size == dso->shdr[i].sh_sizesymdata != NULL && symdata->d_buf != NULLelf_getdata (dso->scn[dso->shdr[i].sh_link], symdata) == NULLsymdata->d_size == dso->shdr[dso->shdr[i].sh_link].sh_size%s: Unhandled relocation %d in %s section%s: Unknown debugging section %s%s: Found two copies of %s section%s: Could not allocate more macro sections%s: .debug_info CU header too small%s: DWARF CU abbrev offset too large%s: Invalid DWARF pointer size %d%s: DWARF pointer size differs between CUs%s: Duplicate DWARF abbreviation %d%s: DWARF abbreviation does not end with 2 zeros%s: Could not find DWARF abbreviation %dWarning, not replacing comp_dir '%s' prefix ('%s' -> '%s') encoded as DW_FORM_string. Replacement too large.
%s: Bad string pointer index %zd for comp_dir%s: Bad string pointer index %zd for unit nameNo memory for new .debug_line table (0x%zx bytes)%s: Could not allocate line relocationsCouldn't update relocation: %sunhandled .debug_macro version: %dunhandled .debug_macro flags: 0x%xCannot handle 8 byte macro offsets: %sNo .debug_macro reloc section: %s%s: Could not read .debug_abbrev.debug_line relocation offset out of rangeError on option %s: %s.
Run '%s --help' to see a full list of available command line options.
You must specify a base dir if you specify a dest dir
--build-id-seed (-s) needs --build-id (-i)
--build-id-seed (-s) string should be at least 1 char
Failed to open input file '%s': %s
Couldn't get number of phdrs: %sStabs debuginfo not supported: %s
Failed to compute header checksum: %s
Cannot handle %Zu-byte build ID
base build directory of objectsdirectory to rewrite base-dir intofile where to put list of source and header file namesrecompute build ID note and print ID on stdoutif recomputing the build ID note use this string as hash seeddo not recompute build ID note even when -i or -s are givenBad string pointer index %zdCouldn't get relocation: %sCouldn't get symbol: %s%s: No .line_table section.%s: Reading file tabletools/debugedit.cret != NULL%s: Could not allocate memorysymdata->d_off == 0.debug_macro.rel.debug_.rela.debug_%s: Wrong ELF data enconding%s: .debug_info too small%s: .debug_abbrev not present%s: Unknown DWARF DW_FORM_%d/len < UINT_MAXt->size_diff == 0Unhandled DW_MACRO op 0x%xdebugeditlibrary out of date
cannot open ELF file: %s"%s" is not an ELF filecannot get the ELF header: %s"%s" is not a shared libraryCould not open DSO.stab.debug_infoCouldn't get shdr: %s
Couldn't update shdr: %s
Couldn't update ehdr: %s
Failed to update file: %s
Failed to write file: %s
elf_end failed: %s
base-dirdest-dirlist-filebuild-id-seedno-recompute-build-idHelp options:.debug_abbrev.debug_line.debug_aranges.debug_pubnames.debug_pubtypes.debug_macinfo.debug_loc.debug_str.debug_frame.debug_ranges.debug_types.debug_gdb_scripts���������������x��h��h��������������������������x�����x��h��h��������h��������������������������h�����l��l�����:��������7��string_find_entrysetup_relbufedit_dwarf2_lineedit_attributesedit_dwarf2	
Cannot find prime bigger than %lu
;�5`����0����L����h����	���`�����(���<0���P@���dP���x`����p������������������������Щ��@���`���,p���@����T����h@����P���������Ю��0����������`���<��l������������������0�0��\��������|@�������(	0�`	@�t	P��	���	���	zRx�(���/D$4p����FJw�?:*3$"\����t�����̦���ئ���Ԧ��	�Ц���̦���Ȧ��Ħ��	����(̦��<Ȧ��PĦ��id ���x,����(����4���4�@����U�A�G G
DAGDCAH�������	(����dB�G�A �q
DBGL,ة��
B�E�A �D(�D0�
(F ABBAY
(D ABBF`|����@B�B�B �B(�A0�D8�GPb
8A0A(B BBBHD
8C0A(B BBBHL�t����B�B�E �B(�A0�D8�D�
8A0A(B BBBA,0ĭ��=A�C
M�����&
I$`Ե��pA�D�D `AA,����{B�D�A �B
ABA�l���%AA^H������B�B�B �B(�D0�A8�G�[
8A0A(B BBBGL ����&B�B�E �B(�A0�A8�G��
8A0A(B BBBI$zRx��������,����
L������F�O�B �B(�A0�A8�S��
8A0A(B BBBE�(�$�
$ ��<<��|F�E�E �D(�A0�O
(A BBBE(|��\F�D�A �FDB(�,�gF�A�A �NEGD�p��F�B�G �E(�A0�A8�D@�8D0A(B BBB$��(E�D�J FIAHD�F�E�E �B(�A0�A8�D`�
8D0A(B BBBE zRx�`������(����(���*F�D�D �TAB$���>E�C�G lAA$��ZE�A�D MAAzRx� �� ��4t��GF�E�D �A(�D0l(A ABB���	���
���-D���eF�E�E �E(�H0�H8�G@n8A0A(B BBB4�@77x� �������N�9JXc��
X~h� p� ���o0�`
	P�  �0P	���o���o@���o�o����o&�� ��� 0@P`p�������� 0@P`p��������    0 @ P ` p � � � � � � � � !! !0!@!P!`!p!�!�!�!�!�!�!�!�!"" "0"@"P"`"p"�"������b�� ��d�� �
�l�� (�2�i|� `��sp� ��%�nx� Ј;�[�I�W�c�r�����������ČҌ�ߌ
=�������?��������������?������������������?�������Pw@wGA$3a1��6GA$3p1113P'U~GA*GA$annobin gcc 8.5.0 20210514GA$plugin name: gcc-annobinGA$running gcc 8.5.0 20210514GA*GA*GA!
GA*FORTIFYGA+GLIBCXX_ASSERTIONSGA*cf_protectionGA+omit_frame_pointerGA+stack_clashGA!stack_realignGA*GOW*�P'7wGA$3a1�6e~GA$3p1113@w�}GA*GA$annobin gcc 8.5.0 20210514GA$plugin name: gcc-annobinGA$running gcc 8.5.0 20210514GA*GA*GA!
GA*FORTIFYGA+GLIBCXX_ASSERTIONSGA*GOW*�GA*cf_protectionGA+omit_frame_pointerGA+stack_clashGA!stack_realignGA*GOW*�}U~
GA*FORTIFYP77wGA+GLIBCXX_ASSERTIONS
GA*FORTIFY@wU~GA+GLIBCXX_ASSERTIONSdebugedit-4.14.3-32.el8_10.x86_64.debug����7zXZ�ִF!t/���]?�E�h=��ڊ�2N���P��Ut��5��[�S�`��4��\������֣Įpl�?�X5���}�N��p��"�Ųi�!O^.r$�~���������Ɉ�'Wno����ߓѤʯ��Ȯ�Ou.8�x�٩�r#�P�k���VˆU;��7{5e���+)WB+�G�o��[z��\���׼>+�n�m�t0��B
�㪣%6�e\k���
n��ez6K�����q��jO�7�p��EmN$E�
�mV�ul�B��£�ΥqS��e�����eacxe"��w��ER.��{��!��7�1K��g�ɦi���Q�2�j^`��:��,9턁�Ȱ�Sn��a-T��;����]���"���d25�V��hG�lU�A������`�\�S>0h�XҪ�s���匰-0A�t�w�'�GM��VM�+�e��E�_��:�sqS�Tt��
�t���W�$y�$�_��1�㘽q��&��4
�]��	?��{���ʟn4vX��u��6�,�S�۴/*��SD�&�s��裡97��l�ܼ�."�0���4�"yE���2��nJ��Z�A� ���� K0z[h���,��5��_�n�����+��Z�[�V��Lܘ�kJ�;2��ۃme�0��������]-�Z�Jc+�^��P�OoH��J�A��́�r
�
����],��i��Z�޽Gt�|D�`�
���1֭���X�76u0��;LAOy$X�y܌�c��5k襓�cn	��;�\sM��g<�Ճ)�	R�iSC���]�ʖ�^lY�ܢ��R�Z��V�w��ݥ���8@#`��@��A���{��m{R���+�����m�$;��mlq5�7k�ʟ���<$��;
p��%%JPf--�W��X� c�8y��BRpHfǻ�����)�ڲ����l����Wh�#��$}x��Sg��Q��Y�`")�9���(:v�yD��Ys�d�\��|k��SY�G��L��$g��ᒀ��%m�6?�b�tZ(u��>9�:����� �yXT䀔�6��.��\�F�X��1;^a��>�T�:����|�M�^���
'↑�)Lh5W�e+n��u
iޚ�Mj��Cd�yD��]�h�=��`�۰�/���9�#���{_����DF�w96����v��P�@��\Ǝ��z���./Qv�� �g����&.�*�O�!�[b�>���VG����s��`k���Դ�[��'GR��B���Oهv�y�8����֝�|�(ߧ���ej8�pZ�doνO��f�L�O�j�~�+��vdv�]���F(s_Xi�g�J�Nu�D��(tDg��pk�-1���:|�r66��F�;�-"D�#G���0�,���dY�s;������Į�^-=m[H��.PL�$��g�YZ.shstrtab.interp.note.gnu.property.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata���� &�� 4$G���o000Q``(Y��	a���o���n���o@@�}00P�B�� ���������"�"��P'P'W�X~X~
�p~p~��`�`�����H�h� h��p� p��x� x���� ����P� P���� �h h� h��
�`h�� 0�,/\��D�>#!/usr/bin/python2

"""Modify a dependency listed in a package.json file"""

# Copyright 2013 T.C. Hollingsworth <tchollingsworth@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

import json
import optparse
import os
import re
import shutil
import sys

RE_VERSION = re.compile(r'\s*v?([<>=~^]{0,2})\s*([0-9][0-9\.\-]*)\s*')

p = optparse.OptionParser(
        description='Modifies dependency entries in package.json files')

p.add_option('-r', '--remove', action='store_true')
p.add_option('--dev', action='store_const', const='devDependencies',
             dest='deptype', help='affect devDependencies')
p.add_option('--optional', action='store_const', const='optionalDependencies',
             dest='deptype', help='affect optionalDependencies')
p.add_option('--caret', action='store_true',
             help='convert all or specified dependencies to use the caret operator')

options, args = p.parse_args()

if not os.path.exists('package.json~'):
    shutil.copy2('package.json', 'package.json~')

md = json.load(open('package.json'))

deptype = options.deptype if options.deptype is not None else 'dependencies'

if deptype not in md:
    md[deptype] = {}

# convert alternate JSON dependency representations to a dictionary
if not options.caret and not isinstance(md[deptype], dict):
    if isinstance(md[deptype], list):
        deps = md[deptype]
        md[deptype] = {}
        for dep in deps:
            md[deptype][dep] = '*'
    elif isinstance(md[deptype], basestring):
        md[deptype] = { md[deptype] : '*' }

if options.remove:
    dep = args[0]
    del md[deptype][dep]
elif options.caret:
    if not isinstance(md[deptype], dict):
        sys.stderr.write('All dependencies are unversioned.  Unable to apply ' +
                         'caret operator.\n')
        sys.exit(2)

    deps = args if len(args) > 0 else md[deptype].keys()
    for dep in deps:
        if md[deptype][dep][0] == '^':
            continue
        elif md[deptype][dep][0] in ('~','0','1','2','3','4','5','6','7','8','9'):
            ver = re.match(RE_VERSION, md[deptype][dep]).group(2)
            md[deptype][dep] = '^' + ver
        else:
            sys.stderr.write('Attempted to convert non-numeric or tilde ' +
                'dependency to caret.  This is not permitted.\n')
            sys.exit(1)
else:
    dep = args[0]

    if len(args) > 1:
        ver = args[1]
    else:
        ver = '*'

    md[deptype][dep] = ver

fh = open('package.json', 'w')
data = json.JSONEncoder(indent=4).encode(md)
fh.write(data)
fh.close()