Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* aar.c generated by valac 0.18.1, the Vala compiler
- * generated from aar.vala, do not modify */
- #include <glib.h>
- #include <glib-object.h>
- #include <stdlib.h>
- #include <string.h>
- #include <glib/gstdio.h>
- #include <libsoup/soup.h>
- #include <libxml/HTMLparser.h>
- #include <libxml/HTMLtree.h>
- #include <libxml/xpath.h>
- #include <stdio.h>
- #include <libxml/tree.h>
- #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
- #define _g_free0(var) (var = (g_free (var), NULL))
- #define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
- #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
- #define _xmlXPathFreeContext0(var) ((var == NULL) ? NULL : (var = (xmlXPathFreeContext (var), NULL)))
- #define _htmlFreeParserCtxt0(var) ((var == NULL) ? NULL : (var = (htmlFreeParserCtxt (var), NULL)))
- #define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
- typedef enum {
- IO_ERROR_Null
- } IOError;
- #define IO_ERROR io_error_quark ()
- GQuark io_error_quark (void);
- void io_download_file (const gchar* uri, const gchar* dest_file, GError** error);
- guint8* io_download_data (const gchar* uri, int* result_length1);
- static guint8* _vala_array_dup1 (guint8* self, int length);
- gchar* io_download_string (const gchar* uri);
- void _vala_main (gchar** args, int args_length1);
- static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
- static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
- static gint _vala_array_length (gpointer array);
- GQuark io_error_quark (void) {
- return g_quark_from_static_string ("io_error-quark");
- }
- void io_download_file (const gchar* uri, const gchar* dest_file, GError** error) {
- const gchar* _tmp0_;
- const gchar* _tmp2_;
- gint _tmp3_ = 0;
- guint8* _tmp4_ = NULL;
- guint8* data;
- gint data_length1;
- gint _data_size_;
- guint8* _tmp5_;
- gint _tmp5__length1;
- const gchar* _tmp7_;
- guint8* _tmp8_;
- gint _tmp8__length1;
- GError * _inner_error_ = NULL;
- g_return_if_fail (uri != NULL);
- g_return_if_fail (dest_file != NULL);
- _tmp0_ = dest_file;
- if (_tmp0_ == NULL) {
- GError* _tmp1_;
- _tmp1_ = g_error_new_literal (IO_ERROR, IO_ERROR_Null, "name of destination cannot be null");
- _inner_error_ = _tmp1_;
- if (_inner_error_->domain == IO_ERROR) {
- g_propagate_error (error, _inner_error_);
- return;
- } else {
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return;
- }
- }
- _tmp2_ = uri;
- _tmp4_ = io_download_data (_tmp2_, &_tmp3_);
- data = _tmp4_;
- data_length1 = _tmp3_;
- _data_size_ = data_length1;
- _tmp5_ = data;
- _tmp5__length1 = data_length1;
- if (_tmp5__length1 < 1) {
- GError* _tmp6_;
- _tmp6_ = g_error_new_literal (IO_ERROR, IO_ERROR_Null, "data length is too short or null");
- _inner_error_ = _tmp6_;
- if (_inner_error_->domain == IO_ERROR) {
- g_propagate_error (error, _inner_error_);
- data = (g_free (data), NULL);
- return;
- } else {
- data = (g_free (data), NULL);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return;
- }
- }
- _tmp7_ = dest_file;
- _tmp8_ = data;
- _tmp8__length1 = data_length1;
- g_file_set_contents (_tmp7_, (const char*) _tmp8_, (size_t) _tmp8__length1, &_inner_error_);
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == IO_ERROR) {
- g_propagate_error (error, _inner_error_);
- data = (g_free (data), NULL);
- return;
- } else {
- data = (g_free (data), NULL);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return;
- }
- }
- data = (g_free (data), NULL);
- }
- static guint8* _vala_array_dup1 (guint8* self, int length) {
- return g_memdup (self, length * sizeof (guint8));
- }
- guint8* io_download_data (const gchar* uri, int* result_length1) {
- guint8* result = NULL;
- SoupSessionSync* _tmp0_;
- SoupSessionSync* session;
- const gchar* _tmp1_;
- SoupMessage* _tmp2_;
- SoupMessage* message;
- SoupMessageBody* _tmp3_;
- guint8* _tmp4_;
- gint _tmp4__length1;
- guint8* _tmp5_;
- gint _tmp5__length1;
- guint8* _tmp6_;
- gint _tmp6__length1;
- g_return_val_if_fail (uri != NULL, NULL);
- _tmp0_ = (SoupSessionSync*) soup_session_sync_new ();
- session = _tmp0_;
- _tmp1_ = uri;
- _tmp2_ = soup_message_new ("GET", _tmp1_);
- message = _tmp2_;
- soup_session_send_message ((SoupSession*) session, message);
- _tmp3_ = message->response_body;
- _tmp4_ = _tmp3_->data;
- _tmp4__length1 = (gint) _tmp3_->length;
- _tmp5_ = (_tmp4_ != NULL) ? _vala_array_dup1 (_tmp4_, _tmp4__length1) : ((gpointer) _tmp4_);
- _tmp5__length1 = _tmp4__length1;
- _tmp6_ = _tmp5_;
- _tmp6__length1 = _tmp5__length1;
- if (result_length1) {
- *result_length1 = _tmp6__length1;
- }
- result = _tmp6_;
- _g_object_unref0 (message);
- _g_object_unref0 (session);
- return result;
- }
- gchar* io_download_string (const gchar* uri) {
- gchar* result = NULL;
- const gchar* _tmp0_;
- gint _tmp1_ = 0;
- guint8* _tmp2_ = NULL;
- g_return_val_if_fail (uri != NULL, NULL);
- _tmp0_ = uri;
- _tmp2_ = io_download_data (_tmp0_, &_tmp1_);
- result = (gchar*) _tmp2_;
- return result;
- }
- static gint string_index_of (const gchar* self, const gchar* needle, gint start_index) {
- gint result = 0;
- gint _tmp0_;
- const gchar* _tmp1_;
- gchar* _tmp2_ = NULL;
- gchar* _result_;
- gchar* _tmp3_;
- g_return_val_if_fail (self != NULL, 0);
- g_return_val_if_fail (needle != NULL, 0);
- _tmp0_ = start_index;
- _tmp1_ = needle;
- _tmp2_ = strstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_);
- _result_ = _tmp2_;
- _tmp3_ = _result_;
- if (_tmp3_ != NULL) {
- gchar* _tmp4_;
- _tmp4_ = _result_;
- result = (gint) (_tmp4_ - ((gchar*) self));
- return result;
- } else {
- result = -1;
- return result;
- }
- }
- static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
- gchar* result = NULL;
- GError * _inner_error_ = NULL;
- g_return_val_if_fail (self != NULL, NULL);
- g_return_val_if_fail (old != NULL, NULL);
- g_return_val_if_fail (replacement != NULL, NULL);
- {
- const gchar* _tmp0_;
- gchar* _tmp1_ = NULL;
- gchar* _tmp2_;
- GRegex* _tmp3_;
- GRegex* _tmp4_;
- GRegex* regex;
- GRegex* _tmp5_;
- const gchar* _tmp6_;
- gchar* _tmp7_ = NULL;
- gchar* _tmp8_;
- _tmp0_ = old;
- _tmp1_ = g_regex_escape_string (_tmp0_, -1);
- _tmp2_ = _tmp1_;
- _tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
- _tmp4_ = _tmp3_;
- _g_free0 (_tmp2_);
- regex = _tmp4_;
- if (_inner_error_ != NULL) {
- if (_inner_error_->domain == G_REGEX_ERROR) {
- goto __catch0_g_regex_error;
- }
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return NULL;
- }
- _tmp5_ = regex;
- _tmp6_ = replacement;
- _tmp7_ = g_regex_replace_literal (_tmp5_, self, (gssize) (-1), 0, _tmp6_, 0, &_inner_error_);
- _tmp8_ = _tmp7_;
- if (_inner_error_ != NULL) {
- _g_regex_unref0 (regex);
- if (_inner_error_->domain == G_REGEX_ERROR) {
- goto __catch0_g_regex_error;
- }
- _g_regex_unref0 (regex);
- g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return NULL;
- }
- result = _tmp8_;
- _g_regex_unref0 (regex);
- return result;
- }
- goto __finally0;
- __catch0_g_regex_error:
- {
- GError* e = NULL;
- e = _inner_error_;
- _inner_error_ = NULL;
- g_assert_not_reached ();
- _g_error_free0 (e);
- }
- __finally0:
- if (_inner_error_ != NULL) {
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return NULL;
- }
- }
- static gchar* g_file_stream_read_line (FILE* self) {
- gchar* result = NULL;
- gint c = 0;
- GString* ret;
- GString* _tmp7_;
- g_return_val_if_fail (self != NULL, NULL);
- ret = NULL;
- while (TRUE) {
- gint _tmp0_ = 0;
- gint _tmp1_;
- GString* _tmp2_;
- gint _tmp4_;
- GString* _tmp5_;
- gint _tmp6_;
- _tmp0_ = fgetc (self);
- c = _tmp0_;
- _tmp1_ = c;
- if (!(_tmp1_ != EOF)) {
- break;
- }
- _tmp2_ = ret;
- if (_tmp2_ == NULL) {
- GString* _tmp3_;
- _tmp3_ = g_string_new ("");
- _g_string_free0 (ret);
- ret = _tmp3_;
- }
- _tmp4_ = c;
- if (_tmp4_ == ((gint) '\n')) {
- break;
- }
- _tmp5_ = ret;
- _tmp6_ = c;
- g_string_append_c ((GString*) _tmp5_, (gchar) _tmp6_);
- }
- _tmp7_ = ret;
- if (_tmp7_ == NULL) {
- result = NULL;
- _g_string_free0 (ret);
- return result;
- } else {
- GString* _tmp8_;
- const gchar* _tmp9_;
- gchar* _tmp10_;
- _tmp8_ = ret;
- _tmp9_ = ((GString*) _tmp8_)->str;
- _tmp10_ = g_strdup (_tmp9_);
- result = _tmp10_;
- _g_string_free0 (ret);
- return result;
- }
- _g_string_free0 (ret);
- }
- void _vala_main (gchar** args, int args_length1) {
- gchar** _tmp0_;
- gint _tmp0__length1;
- const gchar* _tmp1_;
- gint _tmp2_ = 0;
- gchar** _tmp3_;
- gint _tmp3__length1;
- gchar** _tmp4_;
- gint _tmp4__length1;
- const gchar* _tmp5_;
- gchar** _tmp6_;
- gchar** _tmp7_ = NULL;
- gchar** t;
- gint t_length1;
- gint _t_size_;
- gchar** _tmp8_;
- gint _tmp8__length1;
- const gchar* _tmp9_;
- gchar** _tmp10_;
- gchar** _tmp11_ = NULL;
- gchar** _tmp12_;
- gint _tmp12__length1;
- const gchar* _tmp13_;
- gchar* _tmp14_;
- gchar* _tmp15_;
- gchar* maintener;
- gchar** _tmp16_;
- gint _tmp16__length1;
- const gchar* _tmp17_;
- gchar* _tmp18_;
- gchar* dir;
- gchar** _tmp19_;
- gint _tmp19__length1;
- gchar** _tmp20_;
- gint _tmp20__length1;
- const gchar* _tmp21_;
- gchar* _tmp22_;
- gchar* _tmp23_;
- gchar** _tmp24_;
- gint _tmp24__length1;
- gchar** _tmp25_;
- gint _tmp25__length1;
- const gchar* _tmp26_;
- gchar* _tmp27_ = NULL;
- gchar* _tmp28_;
- gchar** _tmp29_;
- gint _tmp29__length1;
- gchar* _tmp30_ = NULL;
- gchar* ppa;
- const gchar* _tmp31_;
- htmlParserCtxt* _tmp32_;
- htmlParserCtxt* ctx;
- htmlParserCtxt* _tmp33_;
- htmlParserCtxt* _tmp34_;
- xmlDoc* _tmp35_ = NULL;
- xmlDoc* doc;
- xmlDoc* _tmp36_;
- xmlXPathContext* _tmp37_;
- xmlXPathContext* c;
- xmlXPathContext* _tmp38_;
- xmlXPathObject* _tmp39_ = NULL;
- xmlXPathObject* o;
- xmlXPathObject* _tmp40_;
- xmlNodeSet* _tmp41_;
- xmlNodeSet* nodeset;
- FILE* _tmp42_;
- xmlNodeSet* _tmp43_;
- xmlNode* _tmp44_ = NULL;
- gchar* _tmp45_ = NULL;
- gchar* _tmp46_;
- const gchar* _tmp47_;
- gchar* _tmp48_;
- gchar* _tmp49_;
- gchar* _tmp50_;
- gchar* _tmp51_;
- const gchar* _tmp52_;
- gchar* _tmp53_;
- gchar* _tmp54_;
- gchar* _tmp55_;
- gchar* _tmp56_;
- gchar** _tmp57_;
- gint _tmp57__length1;
- const gchar* _tmp58_;
- gchar* _tmp59_;
- gchar* _tmp60_;
- gchar* _tmp61_;
- gchar* _tmp62_;
- gchar* _tmp63_;
- gchar* _tmp64_;
- const gchar* _tmp65_;
- gchar* _tmp66_;
- gchar* _tmp67_;
- gchar* _tmp68_;
- gchar* _tmp69_;
- const gchar* _tmp70_;
- gchar* _tmp71_;
- gchar* _tmp72_;
- gchar* _tmp73_;
- gchar* _tmp74_;
- gchar** _tmp75_;
- gint _tmp75__length1;
- const gchar* _tmp76_;
- gchar* _tmp77_;
- gchar* _tmp78_;
- gchar* _tmp79_;
- gchar* _tmp80_;
- gchar* s;
- const gchar* _tmp81_;
- gchar* _tmp82_;
- gchar* _tmp83_;
- gchar* _tmp84_;
- gchar* _tmp85_;
- const gchar* _tmp86_;
- gchar* _tmp87_;
- gchar* _tmp88_;
- gchar* _tmp89_;
- gchar* _tmp90_;
- const gchar* _tmp91_;
- FILE* _tmp92_;
- FILE* _tmp93_;
- gchar* _tmp94_ = NULL;
- gchar* option;
- const gchar* _tmp95_;
- gchar* _tmp96_ = NULL;
- gchar* _tmp97_;
- gboolean _tmp98_;
- GError * _inner_error_ = NULL;
- _tmp0_ = args;
- _tmp0__length1 = args_length1;
- _tmp1_ = _tmp0_[1];
- _tmp2_ = string_index_of (_tmp1_, "ppa:", 0);
- if (_tmp2_ == (-1)) {
- return;
- }
- _tmp3_ = args;
- _tmp3__length1 = args_length1;
- if (_tmp3__length1 < 2) {
- g_print ("usage: add-apt-repository <ppa> <ubuntu_version>\\n\n" \
- "\t\tex: add-apt-repository ppa:keks9n/monodevelop-latest raring");
- return;
- }
- _tmp4_ = args;
- _tmp4__length1 = args_length1;
- _tmp5_ = _tmp4_[1];
- _tmp7_ = _tmp6_ = g_strsplit (_tmp5_, "/", 0);
- t = _tmp7_;
- t_length1 = _vala_array_length (_tmp6_);
- _t_size_ = t_length1;
- _tmp8_ = t;
- _tmp8__length1 = t_length1;
- _tmp9_ = _tmp8_[0];
- _tmp11_ = _tmp10_ = g_strsplit (_tmp9_, ":", 0);
- _tmp12_ = _tmp11_;
- _tmp12__length1 = _vala_array_length (_tmp10_);
- _tmp13_ = _tmp12_[1];
- _tmp14_ = g_strdup (_tmp13_);
- _tmp15_ = _tmp14_;
- _tmp12_ = (_vala_array_free (_tmp12_, _tmp12__length1, (GDestroyNotify) g_free), NULL);
- maintener = _tmp15_;
- _tmp16_ = t;
- _tmp16__length1 = t_length1;
- _tmp17_ = _tmp16_[1];
- _tmp18_ = g_strdup (_tmp17_);
- dir = _tmp18_;
- _tmp19_ = t;
- _tmp19__length1 = t_length1;
- _tmp20_ = t;
- _tmp20__length1 = t_length1;
- _tmp21_ = _tmp20_[1];
- _tmp22_ = g_strconcat ("+archive/", _tmp21_, NULL);
- _g_free0 (_tmp19_[1]);
- _tmp19_[1] = _tmp22_;
- _tmp23_ = _tmp19_[1];
- _tmp24_ = t;
- _tmp24__length1 = t_length1;
- _tmp25_ = t;
- _tmp25__length1 = t_length1;
- _tmp26_ = _tmp25_[0];
- _tmp27_ = string_replace (_tmp26_, "ppa:", "http://launchpad.net/~");
- _g_free0 (_tmp24_[0]);
- _tmp24_[0] = _tmp27_;
- _tmp28_ = _tmp24_[0];
- _tmp29_ = t;
- _tmp29__length1 = t_length1;
- _tmp30_ = g_strjoinv ("/", _tmp29_);
- ppa = _tmp30_;
- _tmp31_ = ppa;
- io_download_file (_tmp31_, ".temp.html", &_inner_error_);
- if (_inner_error_ != NULL) {
- _g_free0 (ppa);
- _g_free0 (dir);
- _g_free0 (maintener);
- t = (_vala_array_free (t, t_length1, (GDestroyNotify) g_free), NULL);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return;
- }
- _tmp32_ = htmlNewParserCtxt ();
- ctx = _tmp32_;
- _tmp33_ = ctx;
- htmlCtxtUseOptions (_tmp33_, (gint) (((HTML_PARSE_NOERROR | HTML_PARSE_NOBLANKS) | HTML_PARSE_NOWARNING) | HTML_PARSE_NONET));
- _tmp34_ = ctx;
- _tmp35_ = htmlCtxtReadFile (_tmp34_, ".temp.html", NULL, 0);
- doc = _tmp35_;
- _tmp36_ = doc;
- _tmp37_ = xmlXPathNewContext (_tmp36_);
- c = _tmp37_;
- _tmp38_ = c;
- _tmp39_ = xmlXPathEval ("//div[@class='yui3-editable_text-text']", _tmp38_);
- o = _tmp39_;
- _tmp40_ = o;
- _tmp41_ = _tmp40_->nodesetval;
- nodeset = _tmp41_;
- _tmp42_ = stdout;
- _tmp43_ = nodeset;
- _tmp44_ = xmlXPathNodeSetItem (_tmp43_, 0);
- _tmp45_ = xmlNodeGetContent (_tmp44_);
- _tmp46_ = _tmp45_;
- fprintf (_tmp42_, "%s\n", _tmp46_);
- _g_free0 (_tmp46_);
- _tmp47_ = maintener;
- _tmp48_ = g_strconcat ("deb http://ppa.launchpad.net/", _tmp47_, NULL);
- _tmp49_ = _tmp48_;
- _tmp50_ = g_strconcat (_tmp49_, "/", NULL);
- _tmp51_ = _tmp50_;
- _tmp52_ = dir;
- _tmp53_ = g_strconcat (_tmp51_, _tmp52_, NULL);
- _tmp54_ = _tmp53_;
- _tmp55_ = g_strconcat (_tmp54_, "/ubuntu ", NULL);
- _tmp56_ = _tmp55_;
- _tmp57_ = args;
- _tmp57__length1 = args_length1;
- _tmp58_ = _tmp57_[2];
- _tmp59_ = g_strconcat (_tmp56_, _tmp58_, NULL);
- _tmp60_ = _tmp59_;
- _tmp61_ = g_strconcat (_tmp60_, " main\n", NULL);
- _tmp62_ = _tmp61_;
- _tmp63_ = g_strconcat (_tmp62_, "deb-src http://ppa.launchpad.net/", NULL);
- _tmp64_ = _tmp63_;
- _tmp65_ = maintener;
- _tmp66_ = g_strconcat (_tmp64_, _tmp65_, NULL);
- _tmp67_ = _tmp66_;
- _tmp68_ = g_strconcat (_tmp67_, "/", NULL);
- _tmp69_ = _tmp68_;
- _tmp70_ = dir;
- _tmp71_ = g_strconcat (_tmp69_, _tmp70_, NULL);
- _tmp72_ = _tmp71_;
- _tmp73_ = g_strconcat (_tmp72_, "/ubuntu ", NULL);
- _tmp74_ = _tmp73_;
- _tmp75_ = args;
- _tmp75__length1 = args_length1;
- _tmp76_ = _tmp75_[2];
- _tmp77_ = g_strconcat (_tmp74_, _tmp76_, NULL);
- _tmp78_ = _tmp77_;
- _tmp79_ = g_strconcat (_tmp78_, " main", NULL);
- _tmp80_ = _tmp79_;
- _g_free0 (_tmp78_);
- _g_free0 (_tmp74_);
- _g_free0 (_tmp72_);
- _g_free0 (_tmp69_);
- _g_free0 (_tmp67_);
- _g_free0 (_tmp64_);
- _g_free0 (_tmp62_);
- _g_free0 (_tmp60_);
- _g_free0 (_tmp56_);
- _g_free0 (_tmp54_);
- _g_free0 (_tmp51_);
- _g_free0 (_tmp49_);
- s = _tmp80_;
- _tmp81_ = maintener;
- _tmp82_ = g_strconcat ("ppa-", _tmp81_, NULL);
- _tmp83_ = _tmp82_;
- _tmp84_ = g_strconcat (_tmp83_, "-", NULL);
- _tmp85_ = _tmp84_;
- _tmp86_ = dir;
- _tmp87_ = g_strconcat (_tmp85_, _tmp86_, NULL);
- _tmp88_ = _tmp87_;
- _tmp89_ = g_strconcat (_tmp88_, ".list", NULL);
- _tmp90_ = _tmp89_;
- _tmp91_ = s;
- g_file_set_contents (_tmp90_, _tmp91_, (gssize) (-1), &_inner_error_);
- _g_free0 (_tmp90_);
- _g_free0 (_tmp88_);
- _g_free0 (_tmp85_);
- _g_free0 (_tmp83_);
- if (_inner_error_ != NULL) {
- _g_free0 (s);
- _xmlXPathFreeContext0 (c);
- _htmlFreeParserCtxt0 (ctx);
- _g_free0 (ppa);
- _g_free0 (dir);
- _g_free0 (maintener);
- t = (_vala_array_free (t, t_length1, (GDestroyNotify) g_free), NULL);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return;
- }
- _tmp92_ = stdout;
- fprintf (_tmp92_, "add this ppa ? [y/n] : ");
- _tmp93_ = stdin;
- _tmp94_ = g_file_stream_read_line (_tmp93_);
- option = _tmp94_;
- _tmp95_ = option;
- _tmp96_ = g_utf8_strdown (_tmp95_, (gssize) (-1));
- _tmp97_ = _tmp96_;
- _tmp98_ = g_strcmp0 (_tmp97_, "y") == 0;
- _g_free0 (_tmp97_);
- if (_tmp98_) {
- const gchar* _tmp99_;
- gchar* _tmp100_;
- gchar* _tmp101_;
- gchar* _tmp102_;
- gchar* _tmp103_;
- const gchar* _tmp104_;
- gchar* _tmp105_;
- gchar* _tmp106_;
- gchar* _tmp107_;
- gchar* _tmp108_;
- const gchar* _tmp109_;
- gchar* _tmp110_;
- gchar* _tmp111_;
- gchar* _tmp112_;
- gchar* _tmp113_;
- const gchar* _tmp114_;
- gchar* _tmp115_;
- gchar* _tmp116_;
- gchar* _tmp117_;
- gchar* _tmp118_;
- gchar* k = NULL;
- gchar* l = NULL;
- FILE* _tmp119_;
- gchar* _tmp120_ = NULL;
- gchar* _tmp121_ = NULL;
- const gchar* _tmp122_;
- gchar** _tmp123_;
- gchar** _tmp124_ = NULL;
- gchar** _tmp125_;
- gint _tmp125__length1;
- const gchar* _tmp126_;
- gchar* _tmp127_;
- const gchar* _tmp128_;
- gchar* _tmp129_;
- gchar* _tmp130_;
- gchar* _tmp131_ = NULL;
- gchar* _tmp132_ = NULL;
- FILE* _tmp133_;
- _tmp99_ = maintener;
- _tmp100_ = g_strconcat ("sudo mv ppa-", _tmp99_, NULL);
- _tmp101_ = _tmp100_;
- _tmp102_ = g_strconcat (_tmp101_, "-", NULL);
- _tmp103_ = _tmp102_;
- _tmp104_ = dir;
- _tmp105_ = g_strconcat (_tmp103_, _tmp104_, NULL);
- _tmp106_ = _tmp105_;
- _tmp107_ = g_strconcat (_tmp106_, ".list /etc/apt/sources.list.d/ppa-", NULL);
- _tmp108_ = _tmp107_;
- _tmp109_ = maintener;
- _tmp110_ = g_strconcat (_tmp108_, _tmp109_, NULL);
- _tmp111_ = _tmp110_;
- _tmp112_ = g_strconcat (_tmp111_, "-", NULL);
- _tmp113_ = _tmp112_;
- _tmp114_ = dir;
- _tmp115_ = g_strconcat (_tmp113_, _tmp114_, NULL);
- _tmp116_ = _tmp115_;
- _tmp117_ = g_strconcat (_tmp116_, ".list", NULL);
- _tmp118_ = _tmp117_;
- g_spawn_command_line_async (_tmp118_, &_inner_error_);
- _g_free0 (_tmp118_);
- _g_free0 (_tmp116_);
- _g_free0 (_tmp113_);
- _g_free0 (_tmp111_);
- _g_free0 (_tmp108_);
- _g_free0 (_tmp106_);
- _g_free0 (_tmp103_);
- _g_free0 (_tmp101_);
- if (_inner_error_ != NULL) {
- _g_free0 (option);
- _g_free0 (s);
- _xmlXPathFreeContext0 (c);
- _htmlFreeParserCtxt0 (ctx);
- _g_free0 (ppa);
- _g_free0 (dir);
- _g_free0 (maintener);
- t = (_vala_array_free (t, t_length1, (GDestroyNotify) g_free), NULL);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return;
- }
- _tmp119_ = stdout;
- fprintf (_tmp119_, "\n");
- g_spawn_command_line_sync ("sudo apt-get update", &_tmp120_, &_tmp121_, NULL, &_inner_error_);
- _g_free0 (l);
- l = _tmp120_;
- _g_free0 (k);
- k = _tmp121_;
- if (_inner_error_ != NULL) {
- _g_free0 (l);
- _g_free0 (k);
- _g_free0 (option);
- _g_free0 (s);
- _xmlXPathFreeContext0 (c);
- _htmlFreeParserCtxt0 (ctx);
- _g_free0 (ppa);
- _g_free0 (dir);
- _g_free0 (maintener);
- t = (_vala_array_free (t, t_length1, (GDestroyNotify) g_free), NULL);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return;
- }
- _tmp122_ = k;
- _tmp124_ = _tmp123_ = g_strsplit (_tmp122_, " NO_PUBKEY ", 0);
- _tmp125_ = _tmp124_;
- _tmp125__length1 = _vala_array_length (_tmp123_);
- _tmp126_ = _tmp125_[1];
- _tmp127_ = g_strdup (_tmp126_);
- _g_free0 (k);
- k = _tmp127_;
- _tmp125_ = (_vala_array_free (_tmp125_, _tmp125__length1, (GDestroyNotify) g_free), NULL);
- _tmp128_ = k;
- _tmp129_ = g_strconcat ("sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ", _tmp128_, NULL);
- _tmp130_ = _tmp129_;
- g_spawn_command_line_sync (_tmp130_, &_tmp131_, &_tmp132_, NULL, &_inner_error_);
- _g_free0 (k);
- k = _tmp131_;
- _g_free0 (l);
- l = _tmp132_;
- _g_free0 (_tmp130_);
- if (_inner_error_ != NULL) {
- _g_free0 (l);
- _g_free0 (k);
- _g_free0 (option);
- _g_free0 (s);
- _xmlXPathFreeContext0 (c);
- _htmlFreeParserCtxt0 (ctx);
- _g_free0 (ppa);
- _g_free0 (dir);
- _g_free0 (maintener);
- t = (_vala_array_free (t, t_length1, (GDestroyNotify) g_free), NULL);
- g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
- g_clear_error (&_inner_error_);
- return;
- }
- _tmp133_ = stdout;
- fprintf (_tmp133_, "key acquired !\n");
- _g_free0 (l);
- _g_free0 (k);
- }
- _g_free0 (option);
- _g_free0 (s);
- _xmlXPathFreeContext0 (c);
- _htmlFreeParserCtxt0 (ctx);
- _g_free0 (ppa);
- _g_free0 (dir);
- _g_free0 (maintener);
- t = (_vala_array_free (t, t_length1, (GDestroyNotify) g_free), NULL);
- }
- int main (int argc, char ** argv) {
- g_type_init ();
- _vala_main (argv, argc);
- return 0;
- }
- static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
- if ((array != NULL) && (destroy_func != NULL)) {
- int i;
- for (i = 0; i < array_length; i = i + 1) {
- if (((gpointer*) array)[i] != NULL) {
- destroy_func (((gpointer*) array)[i]);
- }
- }
- }
- }
- static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
- _vala_array_destroy (array, array_length, destroy_func);
- g_free (array);
- }
- static gint _vala_array_length (gpointer array) {
- int length;
- length = 0;
- if (array) {
- while (((gpointer*) array)[length]) {
- length++;
- }
- }
- return length;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement