5566 * Contributors : Nil Null <[email protected] > 77 * Created On : <2023-09-05>
8- * Last Modified : <2024-09-14 >
8+ * Last Modified : <2025-07-31 >
99 * ------------------------------------------------------------*/
1010
1111/**
@@ -34,20 +34,19 @@ os_netbsd_getsrc (char *option)
3434 chsrc_view_file ("/usr/pkg/etc/pkgin/repositories.conf" );
3535}
3636
37+
3738/**
38- * 参考:
39+ * @consult
3940 * 1. https://mirrors.tuna.tsinghua.edu.cn/help/pkgsrc/
4041 * 2. https://book.bsdcn.org/di-27-zhang-netbsd/di-27.2-jie-huan-yuan-yu-bao-guan-li-qi.html
4142 *
42- * 根据 @ykla (https://github.com/ykla)
43+ * 根据 @ykla
4344 * NetBSD 默认状态下没有 pkgsrc,用户可能安装了也可能没安装
44- *
45- * HELP: 未经测试
4645 */
4746void
4847os_netbsd_setsrc (char * option )
4948{
50- chsrc_ensure_root (); // HELP: 不知道是否需要确保root权限
49+ chsrc_ensure_root ();
5150
5251 chsrc_yield_source_and_confirm (os_netbsd );
5352
@@ -57,11 +56,29 @@ os_netbsd_setsrc (char *option)
5756 char * vercmd = "cat /etc/os-release | grep \"VERSION=\" | grep -Po \"[8-9].[0-9]+\"" ;
5857 char * version = xy_run (vercmd , 0 );
5958
60- char * url = xy_strjoin (5 , source .url , arch , "/" , version , "/All" );
59+ char * url = xy_strjoin (5 , chef_ensure_trailing_slash ( source .url ) , arch , "/" , version , "/All" );
6160 chsrc_overwrite_file (url , "/usr/pkg/etc/pkgin/repositories.conf" );
6261
6362 chsrc_determine_chgtype (ChgType_Untested );
6463 chsrc_conclude (& source );
6564}
6665
67- def_target (os_netbsd );
66+
67+ Feature_t
68+ os_netbsd_feat (char * option )
69+ {
70+ Feature_t f = {0 };
71+
72+ f .can_get = true;
73+ f .can_reset = false;
74+
75+ f .cap_locally = CanNot ;
76+ f .cap_locally_explain = NULL ;
77+ f .can_english = true;
78+ f .can_user_define = false;
79+
80+ f .note = NULL ;
81+ return f ;
82+ }
83+
84+ def_target_gsf (os_netbsd );
0 commit comments