OSDN Git Service

fixed noaut opt
authorkokkiemouse <kokkiemouse@gmail.com>
Wed, 11 Nov 2020 07:55:45 +0000 (16:55 +0900)
committerkokkiemouse <kokkiemouse@gmail.com>
Wed, 11 Nov 2020 07:55:45 +0000 (16:55 +0900)
Signed-off-by: kokkiemouse <kokkiemouse@gmail.com>
build.sh
system/aur_scripts/aur_prepare.sh
system/cpp-src/mkalteriso/build_setting.cpp
system/cpp-src/mkalteriso/build_setting.h
system/cpp-src/mkalteriso/command_collection.cpp
system/cpp-src/mkalteriso/command_collection.h
system/cpp-src/mkalteriso/main.cpp

index d3c8232..219c47e 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -546,7 +546,7 @@ prepare_build() {
             mkalteriso_option="${mkalteriso_option} -x"
         fi
         if [[ "${noaur}" = false ]]; then
-            mkalteriso_option="${mkalteriso_option} -s tdn"
+            mkalteriso_option="${mkalteriso_option} --aur"
         fi
 
         prepare_rebuild
index c32d8b9..a131455 100755 (executable)
@@ -51,6 +51,7 @@ remove "/aurbuild_temp/aur_prepare.sh"
 for _aur_pkg in ${*}; do
     #echo  "cd ~ ; rm -rf "${_aur_pkg}"; git clone https://aur.archlinux.org/${_aur_pkg}.git" > "/aurbuild_temp/aur_prepare.sh"
     #chmod 777 "/aurbuild_temp/aur_prepare.sh"
-    echo "yay -S ${_aur_pkg} -y --nocleanmenu --nodiffmenu --noeditmenu --noupgrademenu"
+    echo "yay -S ${_aur_pkg} -y --nocleanmenu --nodiffmenu --noeditmenu --noupgrademenu" > "/aurbuild_temp/aur_prepare.sh"
+    chmod 777 "/aurbuild_temp/aur_prepare.sh"
     sudo -u aurbuild "/aurbuild_temp/aur_prepare.sh"
 done
index d3d88f8..4dc83c3 100644 (file)
@@ -119,3 +119,9 @@ bool build_setting::get_wsl(){
 void build_setting::set_wsl(bool blkun){
     enable_wsl=blkun;
 }
+bool build_setting::get_aur(){
+    return enable_aur;
+}
+void build_setting::set_aur(bool bl){
+    enable_aur=bl;
+}
index 7e9810b..df82b27 100644 (file)
@@ -47,6 +47,8 @@ public:
     bool get_debug_mode();
     void set_wsl(bool);
     bool get_wsl();
+    void set_aur(bool);
+    bool get_aur();
 private:
     bool quiet;
     QString architecture;
@@ -68,6 +70,7 @@ private:
     QStringList command_args;
     bool debug_mode;
     bool enable_wsl;
+    bool enable_aur;
 signals:
 
 };
index f918780..e84ffd8 100644 (file)
@@ -2,7 +2,7 @@
 
 command_collection::command_collection(QObject *parent) : QObject(parent)
 {
-umount_kun=false;
+umount_kun_old=false;
 }
 void command_collection::set_build_setting(build_setting* bss){
     bskun=bss;
@@ -56,6 +56,9 @@ int command_collection::_chroot_init(){
     if(!dir.exists("airootfs")){
         dir.mkpath("airootfs");
     }
+    if(bskun->get_aur()){
+
+    }
     if(bskun->get_wsl()){
 
         _pacman("base base-devel git");
@@ -200,8 +203,8 @@ int command_collection::_mkairootfs_sfs(){
     _msg_success("Done!");
     return 0;
 }
-int command_collection::_mount_airootfs(){
-    umount_kun=true;
+int command_collection::_mount_airootfs_old(){
+    umount_kun_old=true;
     QDir workkun(bskun->get_work_dir());
     if(!workkun.exists("mnt/airootfs")){
         workkun.mkpath("mnt/airootfs");
@@ -219,7 +222,7 @@ int command_collection::_mount_airootfs(){
     return 0;
 
 }
-void command_collection::_umount_airootfs(){
+void command_collection::_umount_airootfs_old(){
     _msg_info("Unmounting '" + bskun->get_work_dir() + "/mnt/airootfs'");
     QString umount_cmdrun="umount -d \"" + bskun->get_work_dir() + "/mnt/airootfs\"";
     _msg_info(umount_cmdrun);
@@ -230,12 +233,12 @@ void command_collection::_umount_airootfs(){
     system(rmdirkun.toUtf8().data());
 
 }
-void command_collection::force_umount(){
-    if(umount_kun){
-        _umount_airootfs();
+void command_collection::force_umount_old(){
+    if(umount_kun_old){
+        _umount_airootfs_old();
     }
 }
-int command_collection::_mkairootfs_img(){
+int command_collection::_mkairootfs_img_old(){
     int ret;
     QDir workdirkun(bskun->get_work_dir());
     if(!workdirkun.exists("airootfs")){
@@ -265,7 +268,7 @@ int command_collection::_mkairootfs_img(){
         return 5;
     }
     _msg_success("Done!");
-    ret=_mount_airootfs();
+    ret=_mount_airootfs_old();
     if(ret != 0){
         return ret;
     }
@@ -286,7 +289,7 @@ int command_collection::_mkairootfs_img(){
         return 7;
     }
     _msg_success("Done!");
-    _umount_airootfs();
+    _umount_airootfs_old();
     workdirkun.mkpath("iso/" + bskun->get_install_dir() + "/" + bskun->get_architecture());
     _msg_info("Creating SquashFS image, this may take some time...");
     QString mksquashfskun="mksquashfs \"" + workdirstr + "/airootfs.img\" \"" + workdirstr + "/iso/" + bskun->get_install_dir() + "/" + bskun->get_architecture()
@@ -312,7 +315,7 @@ int command_collection::command_prepare(){
             return 2;
         }
     }else{
-        if(_mkairootfs_img()!=0){
+        if(_mkairootfs_img_old()!=0){
             return 3;
         }
     }
index dbec871..de856f3 100644 (file)
@@ -22,10 +22,10 @@ public:
     int command_pkglist();
     int command_tarball(QString);
     int command_iso(QString);
-    void force_umount();
+    void force_umount_old();
 private:
     build_setting* bskun=nullptr;
-    bool umount_kun;
+    bool umount_kun_old;
     enum show_config_type{
         INIT=0,
         INSTALL=1,
@@ -49,13 +49,13 @@ private:
     void _mksignature();
     void _checksum_common(QString) ;
     void _msg_infodbg(QString);
-    int _mkairootfs_img();
-    int _mount_airootfs();
+    int _mkairootfs_img_old();
+    int _mount_airootfs_old();
     template<class... LNKUN> int max_lenkun(LNKUN... args);
     template<class... LNKUNS> int max_lenkun_QString(LNKUNS... args);
     template<class... SHOWVALKUN> void show_conf_l(int maxkun,void (*do_msgshow)(QString),SHOWVALKUN... txtargkun);
     template<class... SHOWVALKUN> void show_conf_l(void (*do_msgshow)(QString),SHOWVALKUN... txtargkun);
-    void _umount_airootfs();
+    void _umount_airootfs_old();
     template<class... SHOWVALKUN> void show_conf_dkun(void (*do_msgshow)(QString),SHOWVALKUN... argkun);
     QString img_name;
     static void stubkun(QString);
index 63cc140..9162ee8 100644 (file)
@@ -6,7 +6,7 @@ int main(int argc, char *argv[])
     AppMain m(0,&a);
     QTimer::singleShot(0,&m,SLOT(run()));
     int retkun= a.exec();
-    m.cmd_collect.force_umount();
+    m.cmd_collect.force_umount_old();
     return retkun;
 }
 bool isroot(){
@@ -51,6 +51,7 @@ void AppMain::run()
     build_setting_obj.set_quiet(true);
     build_setting_obj.set_use_gpg_key(false);
     build_setting_obj.set_wsl(false);
+    build_setting_obj.set_aur(false);
     time_t     now;
     struct tm  *ts;
     char       buf[80];
@@ -79,13 +80,14 @@ void AppMain::run()
     QCommandLineOption option_verbose("v","verbose");
     QCommandLineOption option_debug("d","debug");
     QCommandLineOption option_x("x","x");
+    QCommandLineOption option_aur(QStringList() << "aur","Enable aur");
     QCommandLineOption option_wsl(QStringList() << "wsl","for wsl");
     QCommandLineOption option_gpg_key("g","gpg key","gpg key");
     QCommandLineOption option_help1(QStringList() << "h" << "help" << "?","help");
 
     parser.addOptions({option_Architecture,option_PACKAGE,option_command,option_file_pacman,option_work_dir
                       ,option_out_dir,option_sfs_mode,option_sfs_comp,option_sfs_special_option,option_iso_label,option_iso_publisher,option_iso_application,option_install_dir
-                      ,option_gpg_key});
+                      ,option_gpg_key,option_aur});
     parser.addOption(option_verbose);
     parser.addOption(option_x);
     parser.addOption(option_commands);
@@ -136,6 +138,9 @@ void AppMain::run()
     if(parser.isSet(option_wsl)){
         build_setting_obj.set_wsl(true);
     }
+    if(parser.isSet(option_aur)){
+        build_setting_obj.set_aur(true);
+    }
     build_setting_obj.set_command_args(parser.positionalArguments());
     cmd_collect.set_build_setting(&build_setting_obj);
     if(parser.positionalArguments().at(0)=="init"){